This commit is contained in:
randogoth 2026-06-19 14:04:15 +03:00
parent 9704433b4c
commit 2906453316
4 changed files with 14 additions and 14 deletions

View file

@ -15,7 +15,7 @@ class WrappedCodeField extends StatefulWidget {
super.key, super.key,
required this.controller, required this.controller,
this.expands = false, this.expands = false,
this.wrap = true, // Enable wrapping by default this.wrap = true,
this.textStyle, this.textStyle,
this.cursorColor, this.cursorColor,
this.padding = EdgeInsets.zero, this.padding = EdgeInsets.zero,
@ -56,7 +56,7 @@ class _WrappedCodeFieldState extends State<WrappedCodeField> {
controller: widget.controller, controller: widget.controller,
expands: widget.expands, expands: widget.expands,
minLines: widget.expands ? null : 1, 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, scrollPhysics: widget.wrap ? const NeverScrollableScrollPhysics() : null,
style: widget.textStyle ?? const TextStyle(fontSize: 16), style: widget.textStyle ?? const TextStyle(fontSize: 16),
cursorColor: widget.cursorColor ?? Colors.white, cursorColor: widget.cursorColor ?? Colors.white,

View file

@ -263,11 +263,11 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
setState(() { setState(() {
app.isPinned = !app.isPinned; app.isPinned = !app.isPinned;
if (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); await SharedPreferencesService().setBool("isPinned_${app.packageName}", app.isPinned);
if (app.isPinned) { // pinning clears demote if (app.isPinned) {
await SharedPreferencesService().setBool("isDemoted_${app.packageName}", false); await SharedPreferencesService().setBool("isDemoted_${app.packageName}", false);
} }
_filterApps(); _filterApps();
@ -277,11 +277,11 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
setState(() { setState(() {
app.isDemoted = !app.isDemoted; app.isDemoted = !app.isDemoted;
if (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); await SharedPreferencesService().setBool("isDemoted_${app.packageName}", app.isDemoted);
if (app.isDemoted) { // demoting clears pin if (app.isDemoted) {
await SharedPreferencesService().setBool("isPinned_${app.packageName}", false); await SharedPreferencesService().setBool("isPinned_${app.packageName}", false);
} }
_filterApps(); _filterApps();
@ -300,6 +300,10 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
), ),
), ),
actions: [ actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: Text('Cancel'),
),
TextButton( TextButton(
onPressed: () async { onPressed: () async {
setState(() { setState(() {
@ -314,10 +318,6 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
}, },
child: Text('Save'), 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...', hintText: 'Search apps...',
border: InputBorder.none, border: InputBorder.none,
), ),
style: TextStyle(color: Colors.white), style: TextStyle(color: Theme.of(context).colorScheme.onSurface),
), ),
actions: [ actions: [
Padding( Padding(
@ -595,7 +595,7 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
) )
: null, : null,
trailing: _buildTrailingIcon(app), // Add trailing icon trailing: _buildTrailingIcon(app),
onTap: () => _launchApp(app), onTap: () => _launchApp(app),
onLongPress: () => _showContextMenu(context, app), onLongPress: () => _showContextMenu(context, app),
), ),

View file

@ -3,7 +3,7 @@ import 'package:flutter_code_editor/flutter_code_editor.dart';
import 'markdown.dart'; import 'markdown.dart';
import 'day.dart'; import 'day.dart';
import 'night.dart'; import 'night.dart';
import 'codefield.dart'; // Ensure this includes WrappedCodeField import 'codefield.dart';
class ReadOnlyPage extends StatelessWidget { class ReadOnlyPage extends StatelessWidget {
final String title; final String title;

View file

@ -66,6 +66,6 @@ class AppSettings extends ChangeNotifier {
break; break;
} }
await _prefsService.setBool(key, value); await _prefsService.setBool(key, value);
notifyListeners(); // Notify listeners after updating the setting notifyListeners();
} }
} }