cleanup
This commit is contained in:
parent
9704433b4c
commit
2906453316
4 changed files with 14 additions and 14 deletions
|
|
@ -15,7 +15,7 @@ class WrappedCodeField extends StatefulWidget {
|
|||
super.key,
|
||||
required this.controller,
|
||||
this.expands = false,
|
||||
this.wrap = true, // ✅ Enable wrapping by default
|
||||
this.wrap = true,
|
||||
this.textStyle,
|
||||
this.cursorColor,
|
||||
this.padding = EdgeInsets.zero,
|
||||
|
|
@ -56,7 +56,7 @@ class _WrappedCodeFieldState extends State<WrappedCodeField> {
|
|||
controller: widget.controller,
|
||||
expands: widget.expands,
|
||||
minLines: widget.expands ? null : 1,
|
||||
maxLines: widget.expands ? null : null, // Allows text to grow dynamically
|
||||
maxLines: widget.expands ? null : null,
|
||||
scrollPhysics: widget.wrap ? const NeverScrollableScrollPhysics() : null,
|
||||
style: widget.textStyle ?? const TextStyle(fontSize: 16),
|
||||
cursorColor: widget.cursorColor ?? Colors.white,
|
||||
|
|
|
|||
|
|
@ -263,11 +263,11 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
setState(() {
|
||||
app.isPinned = !app.isPinned;
|
||||
if (app.isPinned) {
|
||||
app.isDemoted = false; // Cannot be pinned and demoted at the same time
|
||||
app.isDemoted = false;
|
||||
}
|
||||
});
|
||||
await SharedPreferencesService().setBool("isPinned_${app.packageName}", app.isPinned);
|
||||
if (app.isPinned) { // pinning clears demote
|
||||
if (app.isPinned) {
|
||||
await SharedPreferencesService().setBool("isDemoted_${app.packageName}", false);
|
||||
}
|
||||
_filterApps();
|
||||
|
|
@ -277,11 +277,11 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
setState(() {
|
||||
app.isDemoted = !app.isDemoted;
|
||||
if (app.isDemoted) {
|
||||
app.isPinned = false; // Cannot be pinned and demoted at the same time
|
||||
app.isPinned = false;
|
||||
}
|
||||
});
|
||||
await SharedPreferencesService().setBool("isDemoted_${app.packageName}", app.isDemoted);
|
||||
if (app.isDemoted) { // demoting clears pin
|
||||
if (app.isDemoted) {
|
||||
await SharedPreferencesService().setBool("isPinned_${app.packageName}", false);
|
||||
}
|
||||
_filterApps();
|
||||
|
|
@ -300,6 +300,10 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
setState(() {
|
||||
|
|
@ -314,10 +318,6 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
},
|
||||
child: Text('Save'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text('Cancel'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
@ -415,7 +415,7 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
hintText: 'Search apps...',
|
||||
border: InputBorder.none,
|
||||
),
|
||||
style: TextStyle(color: Colors.white),
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.onSurface),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
|
|
@ -595,7 +595,7 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
overflow: TextOverflow.ellipsis,
|
||||
)
|
||||
: null,
|
||||
trailing: _buildTrailingIcon(app), // Add trailing icon
|
||||
trailing: _buildTrailingIcon(app),
|
||||
onTap: () => _launchApp(app),
|
||||
onLongPress: () => _showContextMenu(context, app),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'package:flutter_code_editor/flutter_code_editor.dart';
|
|||
import 'markdown.dart';
|
||||
import 'day.dart';
|
||||
import 'night.dart';
|
||||
import 'codefield.dart'; // Ensure this includes WrappedCodeField
|
||||
import 'codefield.dart';
|
||||
|
||||
class ReadOnlyPage extends StatelessWidget {
|
||||
final String title;
|
||||
|
|
|
|||
|
|
@ -66,6 +66,6 @@ class AppSettings extends ChangeNotifier {
|
|||
break;
|
||||
}
|
||||
await _prefsService.setBool(key, value);
|
||||
notifyListeners(); // Notify listeners after updating the setting
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue