Skip to content

Commit

Permalink
Add switch themes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhzdhd committed Jan 5, 2023
1 parent bf35ee4 commit 78861be
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion lib/src/settings/providers/theme_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
final themeStateProvider =
StateNotifierProvider<_ThemeModel, ThemeDataModel>((ref) => _ThemeModel());

const _accentLightColor = Color.fromARGB(255, 0, 0, 176);
const _accentLightColor = Color.fromARGB(255, 85, 136, 156);
const _primaryLightColor = Color.fromARGB(255, 227, 245, 255);
const _secondaryLightColor = Color.fromARGB(255, 244, 247, 255);
final lightTheme = ThemeDataModel(
Expand Down Expand Up @@ -52,6 +52,13 @@ final lightTheme = ThemeDataModel(
foregroundColor: _primaryDarkColor,
),
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith(
((states) => states.contains(MaterialState.selected)
? _accentLightColor
: _primaryDarkColor.withOpacity(0.7)),
),
),
inputDecorationTheme: const InputDecorationTheme(
border: OutlineInputBorder(),
labelStyle: TextStyle(color: _accentLightColor),
Expand Down Expand Up @@ -112,6 +119,13 @@ final darkTheme = ThemeDataModel(
foregroundColor: _primaryLightColor,
),
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith(
((states) => states.contains(MaterialState.selected)
? _accentDarkColor
: _primaryLightColor.withOpacity(0.7)),
),
),
inputDecorationTheme: const InputDecorationTheme(
border: OutlineInputBorder(),
labelStyle: TextStyle(color: _accentDarkColor),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/settings/widgets/update_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class _InfoDialogWidgetState extends State<InfoDialogWidget> {
),
actions: [
Visibility(
visible: widget.isLatestVersion &&
(defaultTargetPlatform == TargetPlatform.android), // !
visible: !widget.isLatestVersion &&
(defaultTargetPlatform == TargetPlatform.android),
child: ElevatedButton(
onPressed: () async {
await FlutterDownloader.enqueue(
Expand Down

0 comments on commit 78861be

Please sign in to comment.