diff --git a/README.md b/README.md index 52e8aaa4..aff3af19 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,12 @@ Simple, local, material design notes. +
+ Screenshot of the notes list + Screenshots of the note editor + Screenshot of the bin +
+ ## Features ### Take notes @@ -40,6 +46,10 @@ Simple, local, material design notes. - Choose if you want your theme to be dynamic (use colors from your system, if supported) - Choose your language (see the [supported ones](#supported-languages)) +## Screenshots + +See more screenshots [here](assets/screenshots). + ## Supported languages - English: 100% diff --git a/assets/data/data_screenshots.json b/assets/data/data_screenshots.json new file mode 100644 index 00000000..cfd82be4 --- /dev/null +++ b/assets/data/data_screenshots.json @@ -0,0 +1,50 @@ +[ + { + "deleted": false, + "pinned": true, + "created_time": "2024-02-08T19:38:47.174208", + "edited_time": "2024-02-08T19:52:18.551315", + "title": "Welcome to Material Notes", + "content": "[{\"insert\":\"Simple, local, material design notes\\n\\n\"}]" + }, + { + "deleted": false, + "pinned": false, + "created_time": "2024-02-08T19:42:36.799343", + "edited_time": "2024-02-08T19:48:24.809869", + "title": "Share & backup", + "content": "[{\"insert\":\"Share text to create a note\\nShare notes as text\\nBackup notes as JSON\\n\"}]" + }, + { + "deleted": true, + "pinned": false, + "created_time": "2024-02-08T19:51:24.586171", + "edited_time": "2024-02-08T19:51:44.551382", + "title": "Recover notes from the bin !", + "content": "[{\"insert\":\"\\n\"}]" + }, + { + "deleted": false, + "pinned": false, + "created_time": "2024-02-08T19:43:32.194535", + "edited_time": "2024-02-08T19:48:20.806446", + "title": "Customize", + "content": "[{\"insert\":\"Choose your theme (including black)\\nUse a dynamic theme\\nChoose your language\\n\"}]" + }, + { + "deleted": false, + "pinned": false, + "created_time": "2024-02-08T19:39:47.595979", + "edited_time": "2024-02-08T19:48:56.383382", + "title": "Take notes", + "content": "[{\"insert\":\"Write text notes (title + content)\"},{\"insert\":\"\\n\",\"attributes\":{\"block\":\"cl\",\"checked\":true}},{\"insert\":\"Add checklists\"},{\"insert\":\"\\n\",\"attributes\":{\"block\":\"cl\"}},{\"insert\":\"Use quick action to add from your homescreen\"},{\"insert\":\"\\n\",\"attributes\":{\"block\":\"cl\",\"checked\":true}}]" + }, + { + "deleted": false, + "pinned": false, + "created_time": "2024-02-08T19:41:27.742611", + "edited_time": "2024-02-08T19:48:30.195413", + "title": "Organize", + "content": "[{\"insert\":\"Search\\nPin & recover from the bin\\nSort (date or title, ascending or descending)\\n\"}]" + } +] \ No newline at end of file diff --git a/assets/screenshots/bin.jpg b/assets/screenshots/bin.jpg new file mode 100644 index 00000000..36c133d2 Binary files /dev/null and b/assets/screenshots/bin.jpg differ diff --git a/assets/screenshots/bin_selection.jpg b/assets/screenshots/bin_selection.jpg new file mode 100644 index 00000000..ee8e330a Binary files /dev/null and b/assets/screenshots/bin_selection.jpg differ diff --git a/assets/screenshots/dynamic_theming_black.jpg b/assets/screenshots/dynamic_theming_black.jpg new file mode 100644 index 00000000..9f0ee06f Binary files /dev/null and b/assets/screenshots/dynamic_theming_black.jpg differ diff --git a/assets/screenshots/dynamic_theming_dark.jpg b/assets/screenshots/dynamic_theming_dark.jpg new file mode 100644 index 00000000..e44dd190 Binary files /dev/null and b/assets/screenshots/dynamic_theming_dark.jpg differ diff --git a/assets/screenshots/dynamic_theming_light.jpg b/assets/screenshots/dynamic_theming_light.jpg new file mode 100644 index 00000000..a4ddd215 Binary files /dev/null and b/assets/screenshots/dynamic_theming_light.jpg differ diff --git a/assets/screenshots/editor.jpg b/assets/screenshots/editor.jpg new file mode 100644 index 00000000..136be02a Binary files /dev/null and b/assets/screenshots/editor.jpg differ diff --git a/assets/screenshots/editor_about.jpg b/assets/screenshots/editor_about.jpg new file mode 100644 index 00000000..3fac2247 Binary files /dev/null and b/assets/screenshots/editor_about.jpg differ diff --git a/assets/screenshots/light.jpg b/assets/screenshots/light.jpg new file mode 100644 index 00000000..3d9b94dd Binary files /dev/null and b/assets/screenshots/light.jpg differ diff --git a/assets/screenshots/notes.jpg b/assets/screenshots/notes.jpg new file mode 100644 index 00000000..7bc05ca1 Binary files /dev/null and b/assets/screenshots/notes.jpg differ diff --git a/assets/screenshots/notes_selection.jpg b/assets/screenshots/notes_selection.jpg new file mode 100644 index 00000000..8bbc5e64 Binary files /dev/null and b/assets/screenshots/notes_selection.jpg differ diff --git a/assets/screenshots/search.jpg b/assets/screenshots/search.jpg new file mode 100644 index 00000000..8bd2e9ac Binary files /dev/null and b/assets/screenshots/search.jpg differ diff --git a/assets/screenshots/settings_1.jpg b/assets/screenshots/settings_1.jpg new file mode 100644 index 00000000..7015ccff Binary files /dev/null and b/assets/screenshots/settings_1.jpg differ diff --git a/assets/screenshots/settings_2.jpg b/assets/screenshots/settings_2.jpg new file mode 100644 index 00000000..75929ec7 Binary files /dev/null and b/assets/screenshots/settings_2.jpg differ diff --git a/assets/screenshots/sort.jpg b/assets/screenshots/sort.jpg new file mode 100644 index 00000000..b933e305 Binary files /dev/null and b/assets/screenshots/sort.jpg differ diff --git a/lib/main.dart b/lib/main.dart index ca738ac8..3c726f85 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -13,6 +13,11 @@ Future main() async { final widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle( + systemNavigationBarColor: Colors.transparent, + ), + ); FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); diff --git a/lib/models/note/note.dart b/lib/models/note/note.dart index 11129fab..9ba4aad1 100644 --- a/lib/models/note/note.dart +++ b/lib/models/note/note.dart @@ -4,14 +4,12 @@ import 'package:equatable/equatable.dart'; import 'package:fleather/fleather.dart'; import 'package:isar/isar.dart'; import 'package:json_annotation/json_annotation.dart'; -import 'package:uuid/uuid.dart'; +import 'package:localmaterialnotes/utils/constants/constants.dart'; part 'note.g.dart'; // ignore_for_file: must_be_immutable -const uuid = Uuid(); - @JsonSerializable() @Collection(inheritance: false) class Note extends Equatable { diff --git a/lib/pages/editor/editor_page.dart b/lib/pages/editor/editor_page.dart index b18c5184..e2ad990e 100644 --- a/lib/pages/editor/editor_page.dart +++ b/lib/pages/editor/editor_page.dart @@ -69,6 +69,7 @@ class _EditorState extends ConsumerState { TextField( readOnly: widget.readOnly, autofocus: widget.autofocus, + textCapitalization: TextCapitalization.sentences, textInputAction: TextInputAction.next, style: Theme.of(context).textTheme.titleLarge, decoration: InputDecoration.collapsed( diff --git a/lib/pages/settings/settings_page.dart b/lib/pages/settings/settings_page.dart index 591eaa86..49908491 100644 --- a/lib/pages/settings/settings_page.dart +++ b/lib/pages/settings/settings_page.dart @@ -4,6 +4,7 @@ import 'package:flutter_settings_ui/flutter_settings_ui.dart'; import 'package:locale_names/locale_names.dart'; import 'package:localmaterialnotes/pages/settings/interactions.dart'; import 'package:localmaterialnotes/utils/constants/constants.dart'; +import 'package:localmaterialnotes/utils/constants/paddings.dart'; import 'package:localmaterialnotes/utils/extensions/string_extension.dart'; import 'package:localmaterialnotes/utils/info_manager.dart'; import 'package:localmaterialnotes/utils/preferences/confirmations.dart'; @@ -24,6 +25,7 @@ class _SettingsPageState extends ConsumerState { Widget build(BuildContext context) { return SettingsList( platform: DevicePlatform.android, + contentPadding: Paddings.custom.bottomSystemUi, lightTheme: SettingsThemeData( settingsListBackground: Theme.of(context).colorScheme.background, ), diff --git a/lib/utils/constants/constants.dart b/lib/utils/constants/constants.dart index 944b2a74..5d1977a7 100644 --- a/lib/utils/constants/constants.dart +++ b/lib/utils/constants/constants.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:localmaterialnotes/l10n/app_localizations.g.dart'; import 'package:localmaterialnotes/utils/theme_manager.dart'; +import 'package:uuid/uuid.dart'; final themeModeNotifier = ValueNotifier(ThemeManager().themeMode); final dynamicThemingNotifier = ValueNotifier(ThemeManager().useDynamicTheming); @@ -10,3 +11,5 @@ final navigatorKey = GlobalKey(debugLabel: 'Root navigator key') final drawerKey = GlobalKey(debugLabel: 'Drawer key'); final localizations = AppLocalizations.of(navigatorKey.currentContext!)!; + +const uuid = Uuid(); diff --git a/lib/utils/constants/paddings.dart b/lib/utils/constants/paddings.dart index c5f741c6..8b668178 100644 --- a/lib/utils/constants/paddings.dart +++ b/lib/utils/constants/paddings.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:localmaterialnotes/utils/constants/constants.dart'; enum Paddings { custom(0), @@ -26,24 +27,14 @@ enum Paddings { EdgeInsets get bottom => EdgeInsets.only(bottom: _padding); - EdgeInsets get fab => const EdgeInsets.only(bottom: kFloatingActionButtonMargin + 64); + EdgeInsets get bottomSystemUi => EdgeInsets.only(bottom: MediaQuery.of(navigatorKey.currentContext!).padding.bottom); - EdgeInsets get miniFab => const EdgeInsets.only(bottom: kFloatingActionButtonMargin + 48); + EdgeInsets get fab => const EdgeInsets.only(bottom: kFloatingActionButtonMargin + 64); EdgeInsets get page => const EdgeInsets.all(16); EdgeInsets get pageButBottom => const EdgeInsets.only(top: 16, left: 16, right: 16); - EdgeInsets get pageHorizontal => const EdgeInsets.symmetric(horizontal: 16); - - EdgeInsets get pageVertical => const EdgeInsets.symmetric(vertical: 16); - - EdgeInsets get drawer => const EdgeInsets.all(8); - - EdgeInsets get editorDesktop => const EdgeInsets.all(16); - - EdgeInsets get editorMobile => const EdgeInsets.all(4); - EdgeInsets get appBarActionsEnd => const EdgeInsets.only(right: 8); final double _padding; diff --git a/lib/utils/database_manager.dart b/lib/utils/database_manager.dart index 650a1505..6ad6df24 100644 --- a/lib/utils/database_manager.dart +++ b/lib/utils/database_manager.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:file_picker/file_picker.dart'; +import 'package:is_first_run/is_first_run.dart'; import 'package:isar/isar.dart'; import 'package:localmaterialnotes/models/note/note.dart'; import 'package:localmaterialnotes/utils/constants/constants.dart'; @@ -20,24 +21,38 @@ class DatabaseManager { DatabaseManager._internal(); - String databaseName = 'materialnotes'; - late String databaseDirectory; - late Isar database; + final _databaseName = 'materialnotes'; + late String _databaseDirectory; + late Isar _database; + + final _welcomeNote = Note( + id: uuid.v4(), + deleted: false, + pinned: true, + createdTime: DateTime.now(), + editedTime: DateTime.now(), + title: 'Welcome to Material Notes', + content: '[{"insert":"Simple, local, material design notes\\n\\n"}]', + ); Future init() async { - databaseDirectory = (await getApplicationDocumentsDirectory()).path; - database = await Isar.open( + _databaseDirectory = (await getApplicationDocumentsDirectory()).path; + _database = await Isar.open( [NoteSchema], - name: databaseName, - directory: databaseDirectory, + name: _databaseName, + directory: _databaseDirectory, ); + + if (await IsFirstRun.isFirstCall()) { + await add(_welcomeNote); + } } Future> getAll({bool deleted = false}) async { final sortMethod = SortMethod.methodFromPreferences(); final sortAscending = SortMethod.ascendingFromPreferences; - final sortedByPinned = database.notes.where().deletedEqualTo(deleted).sortByPinnedDesc(); + final sortedByPinned = _database.notes.where().deletedEqualTo(deleted).sortByPinnedDesc(); switch (sortMethod) { case SortMethod.date: @@ -54,14 +69,14 @@ class DatabaseManager { } Future add(Note note) async { - await database.writeTxn(() async { - await database.notes.put(note); + await _database.writeTxn(() async { + await _database.notes.put(note); }); } Future addAll(List notes) async { - await database.writeTxn(() async { - await database.notes.putAll(notes); + await _database.writeTxn(() async { + await _database.notes.putAll(notes); }); } @@ -70,14 +85,14 @@ class DatabaseManager { } Future delete(Id id) async { - await database.writeTxn(() async { - await database.notes.delete(id); + await _database.writeTxn(() async { + await _database.notes.delete(id); }); } Future deleteAll() async { - await database.writeTxn(() async { - await database.notes.where().deletedEqualTo(true).deleteAll(); + await _database.writeTxn(() async { + await _database.notes.where().deletedEqualTo(true).deleteAll(); }); } @@ -91,7 +106,7 @@ class DatabaseManager { final timestamp = DateTime.timestamp(); final exportFile = File('$exportDirectory/materialnotes_export_${timestamp.filename}.json'); - final notes = await database.notes.where().findAll(); + final notes = await _database.notes.where().findAll(); final notesJson = jsonEncode(notes); await exportFile.writeAsString(notesJson); } diff --git a/pubspec.lock b/pubspec.lock index ed703aec..397b53bc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -525,6 +525,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" + is_first_run: + dependency: "direct main" + description: + name: is_first_run + sha256: "344d9783cbce7b9b90c45b398f85afa1c4a13bb26dcc726d1ee2ec873c8b9b8b" + url: "https://pub.dev" + source: hosted + version: "1.0.0" isar: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index ce351c8b..0e32b6ab 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Simple, local, material design notes repository: https://github.com/maelchiotti/LocalMaterialNotes documentation: https://github.com/maelchiotti/LocalMaterialNotes/wiki -version: 1.0.0 +version: 1.0.1 publish_to: none environment: @@ -27,6 +27,7 @@ dependencies: flutter_settings_ui: ^3.0.0 go_router: ^13.1.0 intl: ^0.18.1 + is_first_run: ^1.0.0 isar: ^3.1.0+1 isar_flutter_libs: ^3.1.0+1 json_annotation: ^4.8.1