-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34280e2
commit d5a59d6
Showing
8 changed files
with
102 additions
and
2 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
36 changes: 36 additions & 0 deletions
36
.../features/settings/presentation/general/quick_search_toggle/quick_search_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,36 @@ | ||
// 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 'quick_search_toggle_tile.g.dart'; | ||
|
||
@riverpod | ||
class QuickSearchToggle extends _$QuickSearchToggle | ||
with SharedPreferenceClientMixin<bool> { | ||
@override | ||
bool? build() => initialize(DBKeys.quickSearchToggle); | ||
} | ||
|
||
class QuickSearchToggleTile extends HookConsumerWidget { | ||
const QuickSearchToggleTile({super.key}); | ||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return SwitchListTile( | ||
controlAffinity: ListTileControlAffinity.trailing, | ||
secondary: const Icon(Icons.search_rounded), | ||
title: Text(context.l10n!.quickSearch), | ||
onChanged: ref.read(quickSearchToggleProvider.notifier).update, | ||
value: ref.watch(quickSearchToggleProvider).ifNull(), | ||
); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...eatures/settings/presentation/general/quick_search_toggle/quick_search_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.
25 changes: 25 additions & 0 deletions
25
.../features/settings/presentation/general/quick_search_toggle/reader_invert_tap_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