-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't use material3
- Loading branch information
Showing
1 changed file
with
19 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,56 @@ | ||
// ignore_for_file: deprecated_member_use | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
// This file is adapted from | ||
// https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/gallery/themes.dart | ||
|
||
final kLightTheme = _buildLightTheme(); | ||
final kDarkTheme = _buildDarkTheme(); | ||
const _primaryColor = Color(0xFF0175c2); | ||
const _secondaryColor = Color(0xFF13B9FD); | ||
|
||
ThemeData _buildLightTheme() { | ||
const Color primaryColor = Color(0xFF0175c2); | ||
const Color secondaryColor = Color(0xFF13B9FD); | ||
final ColorScheme colorScheme = const ColorScheme.light().copyWith( | ||
primary: primaryColor, | ||
secondary: secondaryColor, | ||
final colorScheme = const ColorScheme.light().copyWith( | ||
primary: _primaryColor, | ||
secondary: _secondaryColor, | ||
background: Colors.white, | ||
error: const Color(0xFFB00020), | ||
); | ||
final ThemeData base = ThemeData( | ||
return ThemeData( | ||
useMaterial3: false, | ||
brightness: Brightness.light, | ||
colorScheme: colorScheme, | ||
primaryColor: primaryColor, | ||
primaryColor: _primaryColor, | ||
indicatorColor: Colors.white, | ||
toggleableActiveColor: const Color(0xFF1E88E5), | ||
splashColor: Colors.white24, | ||
splashFactory: InkRipple.splashFactory, | ||
canvasColor: Colors.white, | ||
scaffoldBackgroundColor: Colors.white, | ||
backgroundColor: Colors.white, | ||
errorColor: const Color(0xFFB00020), | ||
buttonTheme: ButtonThemeData( | ||
colorScheme: colorScheme, | ||
textTheme: ButtonTextTheme.primary, | ||
), | ||
); | ||
return base.copyWith( | ||
textTheme: base.textTheme, | ||
primaryTextTheme: base.primaryTextTheme, | ||
); | ||
} | ||
|
||
ThemeData _buildDarkTheme() { | ||
const Color primaryColor = Color(0xFF0175c2); | ||
const Color secondaryColor = Color(0xFF13B9FD); | ||
final ColorScheme colorScheme = const ColorScheme.dark().copyWith( | ||
primary: primaryColor, | ||
secondary: secondaryColor, | ||
final colorScheme = const ColorScheme.dark().copyWith( | ||
primary: _primaryColor, | ||
secondary: _secondaryColor, | ||
background: const Color(0xFF202124), | ||
error: const Color(0xFFB00020), | ||
); | ||
final ThemeData base = ThemeData( | ||
return ThemeData( | ||
useMaterial3: false, | ||
brightness: Brightness.dark, | ||
primaryColor: primaryColor, | ||
primaryColor: _primaryColor, | ||
primaryColorDark: const Color(0xFF0050a0), | ||
primaryColorLight: secondaryColor, | ||
primaryColorLight: _secondaryColor, | ||
indicatorColor: Colors.white, | ||
toggleableActiveColor: const Color(0xFF6997DF), | ||
canvasColor: const Color(0xFF202124), | ||
scaffoldBackgroundColor: const Color(0xFF202124), | ||
backgroundColor: const Color(0xFF202124), | ||
errorColor: const Color(0xFFB00020), | ||
buttonTheme: ButtonThemeData( | ||
colorScheme: colorScheme, | ||
textTheme: ButtonTextTheme.primary, | ||
), | ||
); | ||
return base.copyWith( | ||
textTheme: base.textTheme, | ||
primaryTextTheme: base.primaryTextTheme, | ||
); | ||
} |