added about and help texts, font size slider
This commit is contained in:
parent
4fcd6db6fd
commit
750a228921
6 changed files with 230 additions and 9 deletions
|
|
@ -9,6 +9,8 @@ import 'package:permission_handler/permission_handler.dart';
|
|||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'note_editor.dart';
|
||||
import 'read_only.dart';
|
||||
import 'texts.dart';
|
||||
|
||||
class NoteListScreen extends StatefulWidget {
|
||||
final void Function(bool) toggleTheme;
|
||||
|
|
@ -487,18 +489,36 @@ class _NoteListScreenState extends State<NoteListScreen> {
|
|||
case ':emptytrash':
|
||||
_confirmEmptyTrash();
|
||||
break;
|
||||
case ':about':
|
||||
_showInfoPage(context, "About", aboutContent);
|
||||
break;
|
||||
case ':help':
|
||||
_showInfoPage(context, "Help", helpContent);
|
||||
default:
|
||||
return; // Do nothing for unrecognized commands
|
||||
}
|
||||
searchController.clear();
|
||||
}
|
||||
|
||||
_showInfoPage(BuildContext context, String title, String content) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ReadOnlyPage(
|
||||
title: title,
|
||||
content: content,
|
||||
isDarkMode: widget.isDarkMode,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: TextField(
|
||||
enableInteractiveSelection: true,
|
||||
autocorrect: false,
|
||||
|
|
@ -549,7 +569,13 @@ class _NoteListScreenState extends State<NoteListScreen> {
|
|||
case 'Empty Trash':
|
||||
_confirmEmptyTrash();
|
||||
break;
|
||||
}
|
||||
case 'Help':
|
||||
_showInfoPage(context, "Help", helpContent);
|
||||
break;
|
||||
case 'About':
|
||||
_showInfoPage(context, "About", aboutContent);
|
||||
break;
|
||||
}
|
||||
},
|
||||
itemBuilder: (BuildContext context) => [
|
||||
PopupMenuItem<String>(
|
||||
|
|
@ -625,6 +651,7 @@ class _NoteListScreenState extends State<NoteListScreen> {
|
|||
title: Text('Set Notes Directory'),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem<String>(
|
||||
value: 'Empty Trash',
|
||||
child: ListTile(
|
||||
|
|
@ -633,13 +660,28 @@ class _NoteListScreenState extends State<NoteListScreen> {
|
|||
style: TextStyle(color: Colors.redAccent)),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem<String>(
|
||||
value: 'Help',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.help_outline),
|
||||
title: Text('Help'),
|
||||
),
|
||||
),
|
||||
PopupMenuItem<String>(
|
||||
value: 'About',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.info_outline),
|
||||
title: Text('About'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||
padding: EdgeInsets.only(left: 10),
|
||||
child: ListView.builder(
|
||||
itemCount: filteredNotes.length,
|
||||
itemBuilder: (context, index) {
|
||||
|
|
@ -735,4 +777,4 @@ class _NoteListScreenState extends State<NoteListScreen> {
|
|||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue