diff --git a/lib/codefield.dart b/lib/codefield.dart index b42b26b..cdff437 100644 --- a/lib/codefield.dart +++ b/lib/codefield.dart @@ -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 { 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, diff --git a/lib/main.dart b/lib/main.dart index 65bc817..175c082 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -263,11 +263,11 @@ class _AppLauncherScreenState extends State 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 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 with WidgetsBindi ), ), actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text('Cancel'), + ), TextButton( onPressed: () async { setState(() { @@ -314,10 +318,6 @@ class _AppLauncherScreenState extends State with WidgetsBindi }, child: Text('Save'), ), - TextButton( - onPressed: () => Navigator.of(context).pop(), - child: Text('Cancel'), - ), ], ), ); @@ -415,7 +415,7 @@ class _AppLauncherScreenState extends State 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 with WidgetsBindi overflow: TextOverflow.ellipsis, ) : null, - trailing: _buildTrailingIcon(app), // Add trailing icon + trailing: _buildTrailingIcon(app), onTap: () => _launchApp(app), onLongPress: () => _showContextMenu(context, app), ), diff --git a/lib/read_only.dart b/lib/read_only.dart index 2c14485..c943536 100644 --- a/lib/read_only.dart +++ b/lib/read_only.dart @@ -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; diff --git a/lib/settings.dart b/lib/settings.dart index 62d1ddf..b6c0b09 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -66,6 +66,6 @@ class AppSettings extends ChangeNotifier { break; } await _prefsService.setBool(key, value); - notifyListeners(); // Notify listeners after updating the setting + notifyListeners(); } } \ No newline at end of file