-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added reader swipe toggle and hide nav bar in reader (#202)
- Loading branch information
1 parent
b2e18d5
commit dff5a24
Showing
16 changed files
with
214 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c/features/quick_open/presentation/quick_search/controller/quick_search_controller.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...resentation/reader/widgets/reader_swipe_toggle_tile/reader_swipe_chapter_toggle_tile.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2022 Contributors to the Suwayomi project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
||
import '../../../../../../constants/db_keys.dart'; | ||
|
||
import '../../../../../../utils/extensions/custom_extensions.dart'; | ||
import '../../../../../../utils/mixin/shared_preferences_client_mixin.dart'; | ||
|
||
part 'reader_swipe_chapter_toggle_tile.g.dart'; | ||
|
||
@riverpod | ||
class SwipeChapterToggle extends _$SwipeChapterToggle | ||
with SharedPreferenceClientMixin<bool> { | ||
@override | ||
bool? build() => initialize( | ||
ref, | ||
key: DBKeys.swipeToggle.name, | ||
initial: DBKeys.swipeToggle.initial, | ||
); | ||
} | ||
|
||
class SwipeChapterToggleTile extends HookConsumerWidget { | ||
const SwipeChapterToggleTile({super.key}); | ||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return SwitchListTile( | ||
controlAffinity: ListTileControlAffinity.trailing, | ||
secondary: const Icon(Icons.swipe_rounded), | ||
title: Text(context.l10n!.readerSwipeChapterToggle), | ||
subtitle: Text(context.l10n!.readerSwipeChapterToggleDescription), | ||
onChanged: ref.read(swipeChapterToggleProvider.notifier).update, | ||
value: ref.watch(swipeChapterToggleProvider).ifNull(), | ||
); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...sentation/reader/widgets/reader_swipe_toggle_tile/reader_swipe_chapter_toggle_tile.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.