-
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.
added disable reader scroll animation (#150)
- Loading branch information
1 parent
3951ab5
commit 8d0d2c3
Showing
7 changed files
with
101 additions
and
17 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
41 changes: 41 additions & 0 deletions
41
...resentation/reader/widgets/reader_scroll_animation_tile/reader_scroll_animation_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,41 @@ | ||
// 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_scroll_animation_tile.g.dart'; | ||
|
||
@riverpod | ||
class ReaderScrollAnimation extends _$ReaderScrollAnimation | ||
with SharedPreferenceClientMixin<bool> { | ||
@override | ||
bool? build() => initialize( | ||
ref, | ||
key: DBKeys.scrollAnimation.name, | ||
initial: DBKeys.scrollAnimation.initial, | ||
); | ||
} | ||
|
||
class ReaderScrollAnimationTile extends HookConsumerWidget { | ||
const ReaderScrollAnimationTile({super.key}); | ||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return SwitchListTile( | ||
controlAffinity: ListTileControlAffinity.trailing, | ||
secondary: const Icon(Icons.animation_rounded), | ||
title: Text(context.l10n!.readerScrollAnimation), | ||
onChanged: ref.read(readerScrollAnimationProvider.notifier).update, | ||
value: ref.watch(readerScrollAnimationProvider).ifNull(), | ||
); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...sentation/reader/widgets/reader_scroll_animation_tile/reader_scroll_animation_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