-
-
Notifications
You must be signed in to change notification settings - Fork 873
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
Showing
6 changed files
with
119 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,72 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ThemeConfig { | ||
static Color lightPrimary = const Color(0xffF5F5F5); | ||
static Color darkPrimary = const Color(0xff1f1f1f); | ||
static Color lightAccent = const Color(0xff2ca8e2); | ||
static Color darkAccent = const Color(0xff2ca8e2); | ||
static Color lightBG = Colors.white; | ||
static Color darkBG = const Color(0xff121212); | ||
static Color smokeWhite = const Color(0xffF5F5F5); | ||
const Color lightPrimary = Color(0xffF5F5F5); | ||
const Color darkPrimary = Color(0xff1f1f1f); | ||
const Color lightAccent = Color(0xff2ca8e2); | ||
const Color darkAccent = Color(0xff2ca8e2); | ||
const Color lightBG = Colors.white; | ||
const Color darkBG = Color(0xff121212); | ||
const Color smokeWhite = Color(0xffF5F5F5); | ||
|
||
static ThemeData lightTheme = ThemeData( | ||
colorScheme: ColorScheme.fromSwatch().copyWith( | ||
secondary: lightBG, | ||
brightness: Brightness.light, | ||
), | ||
primaryColor: lightPrimary, | ||
scaffoldBackgroundColor: lightBG, | ||
navigationRailTheme: NavigationRailThemeData( | ||
backgroundColor: smokeWhite, | ||
), | ||
appBarTheme: AppBarTheme( | ||
color: lightPrimary, | ||
elevation: 0.0, | ||
titleTextStyle: const TextStyle( | ||
color: Colors.black, | ||
fontSize: 20, | ||
fontWeight: FontWeight.w800, | ||
), | ||
iconTheme: const IconThemeData( | ||
color: Colors.black, | ||
final ThemeData lightTheme = ThemeData( | ||
colorScheme: ColorScheme.fromSwatch().copyWith( | ||
secondary: lightBG, | ||
brightness: Brightness.light, | ||
), | ||
primaryColor: lightPrimary, | ||
scaffoldBackgroundColor: lightBG, | ||
navigationRailTheme: const NavigationRailThemeData( | ||
backgroundColor: smokeWhite, | ||
), | ||
tabBarTheme: const TabBarTheme( | ||
labelColor: Colors.black, | ||
unselectedLabelColor: Colors.grey, | ||
indicator: UnderlineTabIndicator( | ||
borderSide: BorderSide( | ||
color: lightAccent, | ||
width: 2.0, | ||
), | ||
), | ||
); | ||
), | ||
appBarTheme: const AppBarTheme( | ||
color: lightPrimary, | ||
elevation: 0.0, | ||
titleTextStyle: TextStyle( | ||
color: Colors.black, | ||
fontSize: 20, | ||
fontWeight: FontWeight.w800, | ||
), | ||
iconTheme: IconThemeData(color: Colors.black), | ||
), | ||
); | ||
|
||
static ThemeData darkTheme = ThemeData( | ||
final ThemeData darkTheme = ThemeData( | ||
brightness: Brightness.dark, | ||
colorScheme: ColorScheme.fromSwatch().copyWith( | ||
secondary: darkBG, | ||
brightness: Brightness.dark, | ||
colorScheme: ColorScheme.fromSwatch().copyWith( | ||
secondary: darkBG, | ||
brightness: Brightness.dark, | ||
), | ||
primaryColor: darkPrimary, | ||
scaffoldBackgroundColor: darkBG, | ||
navigationRailTheme: NavigationRailThemeData( | ||
backgroundColor: darkPrimary, | ||
), | ||
appBarTheme: AppBarTheme( | ||
color: darkPrimary, | ||
elevation: 0.0, | ||
titleTextStyle: const TextStyle( | ||
color: Colors.white, | ||
fontSize: 20, | ||
fontWeight: FontWeight.w800, | ||
), | ||
iconTheme: const IconThemeData( | ||
color: Colors.white, | ||
), | ||
primaryColor: darkPrimary, | ||
scaffoldBackgroundColor: darkBG, | ||
navigationRailTheme: const NavigationRailThemeData( | ||
backgroundColor: darkPrimary, | ||
), | ||
tabBarTheme: const TabBarTheme( | ||
indicator: UnderlineTabIndicator( | ||
borderSide: BorderSide( | ||
color: lightAccent, | ||
width: 2.0, | ||
), | ||
), | ||
); | ||
} | ||
), | ||
appBarTheme: const AppBarTheme( | ||
color: darkPrimary, | ||
elevation: 0.0, | ||
titleTextStyle: TextStyle( | ||
color: Colors.white, | ||
fontSize: 20, | ||
fontWeight: FontWeight.w800, | ||
), | ||
iconTheme: IconThemeData(color: Colors.white), | ||
), | ||
); |
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,45 @@ | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:logman/logman.dart'; | ||
|
||
class RiverpodObserver extends ProviderObserver { | ||
final logman = Logman.instance; | ||
|
||
@override | ||
void didAddProvider( | ||
ProviderBase<Object?> provider, | ||
Object? value, | ||
ProviderContainer container, | ||
) { | ||
logman.recordSimpleLog('Provider $provider was initialized with $value'); | ||
} | ||
|
||
@override | ||
void didDisposeProvider( | ||
ProviderBase<Object?> provider, | ||
ProviderContainer container, | ||
) { | ||
logman.recordSimpleLog('Provider $provider was disposed'); | ||
} | ||
|
||
@override | ||
void didUpdateProvider( | ||
ProviderBase<Object?> provider, | ||
Object? previousValue, | ||
Object? newValue, | ||
ProviderContainer container, | ||
) { | ||
logman.recordSimpleLog( | ||
'Provider $provider updated from $previousValue to $newValue', | ||
); | ||
} | ||
|
||
@override | ||
void providerDidFail( | ||
ProviderBase<Object?> provider, | ||
Object error, | ||
StackTrace stackTrace, | ||
ProviderContainer container, | ||
) { | ||
logman.recordSimpleLog('Provider $provider threw $error at $stackTrace'); | ||
} | ||
} |
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 @@ | ||
export 'riverpod_observer.dart'; |