-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from meg4cyberc4t/improvements
Removing ThemeResolver, theme is now initialized only in ThemeStateMixin
- Loading branch information
Showing
2 changed files
with
12 additions
and
41 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:web_template/src/common/theme/theme_resolver.dart'; | ||
|
||
/// The mixing ThemeStateMixin provides the functionality for | ||
/// managing themes. | ||
mixin ThemeStateMixin<T extends StatefulWidget> on State<T> { | ||
/// The main class of the navigaiton package. | ||
late final ThemeResolver _themeResolver; | ||
|
||
@override | ||
void initState() { | ||
_themeResolver = ThemeResolver(); | ||
super.initState(); | ||
} | ||
/// The dark theme of the application | ||
final ThemeData darkTheme = ThemeData.from( | ||
colorScheme: ColorScheme.fromSwatch( | ||
primarySwatch: Colors.lightGreen, | ||
brightness: Brightness.dark, | ||
), | ||
); | ||
|
||
/// The light theme of the application | ||
ThemeData get lightTheme => _themeResolver.light; | ||
|
||
/// The dark theme of the application | ||
ThemeData get darkTheme => _themeResolver.dark; | ||
final ThemeData lightTheme = ThemeData.from( | ||
colorScheme: ColorScheme.fromSwatch( | ||
primarySwatch: Colors.green, | ||
), | ||
); | ||
} |