Skip to content

Commit

Permalink
v1.2.0 (#18)
Browse files Browse the repository at this point in the history
* Improvements (#10)

* fix: "import" strings in french

* fix: small improvements to routes

* refactor: clean app/build.gradle

* fix: Kotlin plugin import

* feat: use floating snack bars

* fix: decode imported file as UTF-8

* fix: use launchUrl instead of launchUrlString whenever possible

* fix: padding at bottom of editor

* chore: upgrade fleather version

* fix: remove drawer on editor page

* feat: use radio buttons where appropriate in settings dialogs

* chore: bump app version

* docs: remake screenshots

* docs: add screenshots to README

* Readme (#13)

* docs: fix screenshots alts

* docs: remove alternatives and update credits

* Add "get it on" badges

* Icon (#14)

* docs: fix screenshots alts

* docs: remove alternatives and update credits

* Add "get it on" badges

* feat: add adaptive icon including monochrome

* ci: try to fix pub get for flutter_launcher_icons

* Improvements (#12)

* docs: fix screenshots alts

* docs: remove alternatives and update credits

* Add "get it on" badges

* feat: add adaptive icon including monochrome

* feat: add hint text to the editor

* feat: autofocus note body instead of title

* feat: delete note if it is empty

* feat: delete note if it is empty

* feat: remove distracting transition between notes list / bin and the note editor

* Icon (#14)

* docs: fix screenshots alts

* docs: remove alternatives and update credits

* Add "get it on" badges

* feat: add adaptive icon including monochrome

* ci: try to fix pub get for flutter_launcher_icons

* chore: get dependencies

* chore: format

* chore: get dependencies

* Banners (#15)

* docs: fix screenshots alts

* docs: remove alternatives and update credits

* Add "get it on" badges

* feat: add adaptive icon including monochrome

* feat: add hint text to the editor

* feat: autofocus note body instead of title

* feat: delete note if it is empty

* feat: delete note if it is empty

* feat: remove distracting transition between notes list / bin and the note editor

* feat: update play store and github banners

* Icon (#14)

* docs: fix screenshots alts

* docs: remove alternatives and update credits

* Add "get it on" badges

* feat: add adaptive icon including monochrome

* ci: try to fix pub get for flutter_launcher_icons

* Improvements (#12)

* docs: fix screenshots alts

* docs: remove alternatives and update credits

* Add "get it on" badges

* feat: add adaptive icon including monochrome

* feat: add hint text to the editor

* feat: autofocus note body instead of title

* feat: delete note if it is empty

* feat: delete note if it is empty

* feat: remove distracting transition between notes list / bin and the note editor

* Icon (#14)

* docs: fix screenshots alts

* docs: remove alternatives and update credits

* Add "get it on" badges

* feat: add adaptive icon including monochrome

* ci: try to fix pub get for flutter_launcher_icons

* chore: get dependencies

* chore: format

* chore: get dependencies

* chore: format

* Tiles (#17)

* fix: exit selection mode when adding a note

* fix: fix tiles background color when scrolling and improve selected coloring

* fix: fix padding for fab by adding bottom system ui padding

* Pubspec (#16)

* chore: bump version

* chore: upgrade dependencies and regenerate files

* Tiles (#17)

* fix: exit selection mode when adding a note

* fix: fix tiles background color when scrolling and improve selected coloring

* fix: fix padding for fab by adding bottom system ui padding

* Fixes (#19)

* feat: improve error handling and snackbar messages for export and import

* fix: add note action crashing when the current route was not the notes list and when app was closed

* fix: remove useless editor FocusNode

* fix: action of quick action

* fix: remove prints

* style: enforce always_put_control_body_on_new_line and curly_braces_in_flow_control_structures (#21)

* fix: editor no longer resets focus when page rebuilds (#22)

* Add Turkish localization (#23)

* feat: add turkish .arb file and generate strings

* refactor: improve handling of hardcoded localizations

* refactor: remove useless usePathUrlStrategy

* docs: add Turkish to supported languages

* docs: add credits for localizations and contributing section to README

* fix: wrong locale in locale check for hardcoded strings

* style: remove prints

* docs: add localization section to new CONTRIBUTING.md

* feat: add missing hardcoded localization

* fix: set version to 1.2.0 instead of 1.2.1 (#24)
  • Loading branch information
maelchiotti authored Apr 15, 2024
1 parent 5a6e31b commit 2e6a2cd
Show file tree
Hide file tree
Showing 69 changed files with 978 additions and 341 deletions.
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contributing

## Localization

In order to improve or add support for a language, please follow these steps:

- Localized strings can be found in two different places:
- The `app_XX.arb` file located in [`lib/l10n`](lib/l10n) (where `XX` corresponds to the language code), that contains the vast majority of all strings. Please make sure that you do not localize any parameter name (ex: `{parameter}`) and that you do escape single quotes (ex: `I''m ok` instead of `I'm ok`).
- The [`hardcoded_localizations.dart`](lib/l10n/hardcoded_localizations.dart), that contains a few specific strings that need to be hardcoded.
- Localized strings can be generated with the `flutter gen-l10n` command. Check that the [`unstranslated.txt`](lib/l10n/untranslated.txt) file is empty, otherwise it will indicate which strings you did not translate.
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
[![Releases](https://img.shields.io/github/v/release/maelchiotti/LocalMaterialNotes)](https://github.com/maelchiotti/LocalMaterialNotes/releases)
[![Issues](https://img.shields.io/github/issues/maelchiotti/LocalMaterialNotes)](https://github.com/maelchiotti/LocalMaterialNotes/issues)

[<img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" width="256">](https://play.google.com/store/apps/details?id=com.maelchiotti.localmaterialnotes)
[<img alt="Get it on GitHub" src="https://raw.githubusercontent.com/Kunzisoft/Github-badge/main/get-it-on-github.png" width="256">](https://github.com/maelchiotti/LocalMaterialNotes/releases/latest)

</div>

# Local Material Notes
Expand All @@ -21,10 +24,10 @@ Simple, local, material design notes.
</div>

<div align="center">
<img alt="Screenshot of the notes list" src="assets/screenshots/latest_notes_selection.jpg" width="24%">
<img alt="Screenshots of the note editor" src="assets/screenshots/latest_search.jpg" width="24%">
<img alt="Screenshot of the bin" src="assets/screenshots/latest_theme_dynamic_dark.jpg" width="24%">
<img alt="Screenshot of the settings" src="assets/screenshots/latest_theme_dynamic_light.jpg" width="24%">
<img alt="Screenshot of the notes list in selection mode" src="assets/screenshots/latest_notes_selection.jpg" width="24%">
<img alt="Screenshots of the search feature" src="assets/screenshots/latest_search.jpg" width="24%">
<img alt="Screenshot of the notes list in the dark mode with dynamic theming" src="assets/screenshots/latest_theme_dynamic_dark.jpg" width="24%">
<img alt="Screenshot of the notes list in the light mode with dynamic theming" src="assets/screenshots/latest_theme_dynamic_light.jpg" width="24%">
</div>

## Features
Expand Down Expand Up @@ -65,16 +68,25 @@ See more screenshots [here](assets/screenshots).

## Supported languages

- English: 100%
- French: 100%

## Alternatives
- English
- French
- Turkish

- [Simplenote](https://simplenote.com) for simple text notes that are synchronized over your devices and available on several platforms. Also provides extra features such as tags, history and collaboration.
To improve or add support for a language, please see [CONTRIBUTING.md](CONTRIBUTING.md#localization).

## Credits

- [Material Design Icons](https://github.com/google/material-design-icons) for the [notes](https://fonts.google.com/icons?selected=Material+Symbols+Outlined:notes) icon used for the logo.
- [Material Files](https://github.com/zhanghai/MaterialFiles) for the general design inspiration, and especially the logo and its color.
- [Simplenote](https://simplenote.com) for the general layout of the app and its basic features.

### Localization

- Turkish: [xe1st](https://github.com/xe1st).

## Contributing

Please see [CONTRIBUTING.md](CONTRIBUTING.md).

---

Expand Down
7 changes: 6 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ analyzer:
exclude:
- '**.g.dart'
plugins:
- custom_lint
- custom_lint

linter:
rules:
- always_put_control_body_on_new_line
- curly_braces_in_flow_control_structures
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<application
android:label="Material Notes"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#2278e9</color>
</resources>
Binary file added assets/github/social_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/github/social_preview.psd
Binary file not shown.
Binary file removed assets/icons/icon_android_12.png
Binary file not shown.
Binary file added assets/icons/icon_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions assets/icons/icon_foreground.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/icon_foreground_monochrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/icons/icon_full.png
Binary file not shown.
16 changes: 0 additions & 16 deletions assets/icons/icon_full.svg

This file was deleted.

Binary file modified assets/play_store/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/play_store/banner.psd
Binary file not shown.
9 changes: 6 additions & 3 deletions flutter_launcher_icons.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# dart run flutter_launcher_icons
flutter_launcher_icons:
image_path: "assets/logos/icon.png"
android: "launcher_icon"
min_sdk_android: 34
image_path: "assets/icons/icon.png"
adaptive_icon_foreground: "assets/icons/icon_foreground.png"
adaptive_icon_monochrome: "assets/icons/icon_foreground_monochrome.png"
adaptive_icon_background: "#2278e9"
android: true
min_sdk_android: 21
ios: false
9 changes: 8 additions & 1 deletion lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import 'dart:async';

import 'package:after_layout/after_layout.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:localmaterialnotes/common/routing/router.dart';
import 'package:localmaterialnotes/l10n/app_localizations.g.dart';
import 'package:localmaterialnotes/utils/constants/constants.dart';
import 'package:localmaterialnotes/utils/locale_manager.dart';
import 'package:localmaterialnotes/utils/quick_actions_manager.dart';
import 'package:localmaterialnotes/utils/share_manager.dart';
import 'package:localmaterialnotes/utils/theme_manager.dart';

Expand All @@ -15,7 +17,7 @@ class App extends ConsumerStatefulWidget {
ConsumerState<App> createState() => _AppState();
}

class _AppState extends ConsumerState<App> {
class _AppState extends ConsumerState<App> with AfterLayoutMixin<App> {
late StreamSubscription _stream;

@override
Expand All @@ -26,6 +28,11 @@ class _AppState extends ConsumerState<App> {
_stream = listenSharedData(ref);
}

@override
void afterFirstLayout(BuildContext context) {
QuickActionsManager().init(navigatorKey.currentContext!, ref);
}

@override
void dispose() {
_stream.cancel();
Expand Down
15 changes: 9 additions & 6 deletions lib/common/actions/add.dart
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:localmaterialnotes/common/actions/select.dart';
import 'package:localmaterialnotes/common/routing/router.dart';
import 'package:localmaterialnotes/common/routing/router_route.dart';
import 'package:localmaterialnotes/models/note/note.dart';
import 'package:localmaterialnotes/providers/current_note/current_note_provider.dart';
import 'package:localmaterialnotes/providers/notes/notes_provider.dart';

Future<void> addNote(BuildContext context, WidgetRef ref, {String? content}) async {
exitSelectionMode(ref);

final note = content == null ? Note.empty() : Note.content(content);

ref.read(currentNoteProvider.notifier).set(note);
await ref.read(notesProvider.notifier).add(note);

if (!context.mounted) return;
if (!context.mounted) {
return;
}

final route = RouterRoute.editor.fullPath!;
final editorRoute = RouterRoute.editor.fullPath!;
final editorParameters = EditorParameters.from({'readonly': false, 'autofocus': true});

// If the editor is already opened with another note, replace the route with the new editor
RouterRoute.isEditor
? context.pushReplacement(route, extra: editorParameters)
: context.push(route, extra: editorParameters);
? context.pushReplacement(editorRoute, extra: editorParameters)
: context.push(editorRoute, extra: editorParameters);
}
8 changes: 6 additions & 2 deletions lib/common/actions/delete.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import 'package:localmaterialnotes/providers/selection_mode/selection_mode_provi
import 'package:localmaterialnotes/utils/constants/constants.dart';

Future<bool> deleteNote(BuildContext context, WidgetRef ref, Note? note) async {
if (note == null) return false;
if (note == null) {
return false;
}

if (await showConfirmationDialog(
context,
Expand Down Expand Up @@ -47,7 +49,9 @@ Future<void> deleteNotes(BuildContext context, WidgetRef ref, List<Note> notes)
}

Future<bool> permanentlyDeleteNote(BuildContext context, WidgetRef ref, Note? note) async {
if (note == null) return false;
if (note == null) {
return false;
}

if (await showConfirmationDialog(
context,
Expand Down
4 changes: 3 additions & 1 deletion lib/common/actions/pin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import 'package:localmaterialnotes/models/note/note.dart';
import 'package:localmaterialnotes/providers/notes/notes_provider.dart';

Future<bool> togglePinNote(BuildContext context, WidgetRef ref, Note? note) async {
if (note == null) return false;
if (note == null) {
return false;
}

await ref.read(notesProvider.notifier).togglePin(note);

Expand Down
4 changes: 3 additions & 1 deletion lib/common/actions/restore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import 'package:localmaterialnotes/providers/current_note/current_note_provider.
import 'package:localmaterialnotes/utils/constants/constants.dart';

Future<bool> restoreNote(BuildContext context, WidgetRef ref, Note? note) async {
if (note == null) return false;
if (note == null) {
return false;
}

if (await showConfirmationDialog(
context,
Expand Down
8 changes: 6 additions & 2 deletions lib/common/navigation/app_bars/back_menu_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ class _BackAppBarState extends ConsumerState<BackMenuAppBar> {
Future<void> _onMenuOptionSelected(MenuOption menuOption) async {
final note = ref.read(currentNoteProvider);

if (note == null) return;
if (note == null) {
return;
}

switch (menuOption) {
case MenuOption.togglePin:
Expand Down Expand Up @@ -53,7 +55,9 @@ class _BackAppBarState extends ConsumerState<BackMenuAppBar> {
void _toggleChecklist() {
final editorController = ref.read(editorControllerProvider);

if (editorController == null) return;
if (editorController == null) {
return;
}

final isToggled = editorController.getSelectionStyle().containsSame(ParchmentAttribute.block.checkList);
editorController.formatSelection(
Expand Down
8 changes: 6 additions & 2 deletions lib/common/navigation/app_bars/search_sort_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class _SearchAppBarState extends ConsumerState<SearchSortAppBar> {
bool sortAscending = SortMethod.ascendingFromPreferences;

List<NoteTile> _filterNotes(String? search, List<Note> notes) {
if (search == null || search.isEmpty) return [];
if (search == null || search.isEmpty) {
return [];
}

return notes.where((note) {
return note.containsText(search);
Expand Down Expand Up @@ -117,7 +119,9 @@ class _SearchAppBarState extends ConsumerState<SearchSortAppBar> {
),
ref.watch(provider).when(
data: (notes) {
if (notes.isEmpty) return searchButtonPlaceholder;
if (notes.isEmpty) {
return searchButtonPlaceholder;
}

return SearchAnchor(
viewHintText: localizations.tooltip_search,
Expand Down
4 changes: 3 additions & 1 deletion lib/common/placeholders/empty_placeholder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class EmptyPlaceholder extends StatelessWidget {

@override
Widget build(BuildContext context) {
if (icon == null || text == null) return Container();
if (icon == null || text == null) {
return Container();
}

return Center(
child: Padding(
Expand Down
10 changes: 8 additions & 2 deletions lib/common/routing/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ PreferredSizeWidget? _getAppBar(BuildContext context) {
}

Widget? _getDrawer() {
if (RouterRoute.currentRoute.drawerIndex == null) return null;
if (RouterRoute.currentRoute.drawerIndex == null) {
return null;
}

return const SideNavigation();
}
Expand Down Expand Up @@ -65,7 +67,11 @@ final router = GoRouter(
routes: [
GoRoute(
path: RouterRoute.editor.path,
builder: (context, state) => EditorPage(state.extra as EditorParameters),
pageBuilder: (context, state) {
return NoTransitionPage(
child: EditorPage(state.extra as EditorParameters),
);
},
),
],
),
Expand Down
8 changes: 6 additions & 2 deletions lib/common/routing/router_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,19 @@ enum RouterRoute {
static int get currentDrawerIndex {
final drawerIndex = currentRoute.drawerIndex;

if (drawerIndex == null) throw Exception('No current drawer index');
if (drawerIndex == null) {
throw Exception('No current drawer index');
}

return drawerIndex;
}

static RouterRoute getRouteFromIndex(int index) {
final route = values.firstWhereOrNull((route) => route.drawerIndex == index);

if (route == null) throw Exception('No route for index: $index');
if (route == null) {
throw Exception('No route for index: $index');
}

return route;
}
Expand Down
Loading

0 comments on commit 2e6a2cd

Please sign in to comment.