-
Notifications
You must be signed in to change notification settings - Fork 228
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
10 changed files
with
251 additions
and
211 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
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,81 +1,33 @@ | ||
import 'package:flutter_app/resources/themes/dark_theme.dart'; | ||
import 'package:flutter_app/resources/themes/light_theme.dart'; | ||
import 'package:flutter_app/resources/themes/styles/color_styles.dart'; | ||
import 'package:flutter_app/resources/themes/styles/dark_theme_colors.dart'; | ||
import 'package:flutter_app/resources/themes/styles/light_theme_colors.dart'; | ||
import 'package:nylo_framework/nylo_framework.dart'; | ||
|
||
import '/resources/themes/dark_theme.dart'; | ||
import '/resources/themes/light_theme.dart'; | ||
import '/resources/themes/styles/color_styles.dart'; | ||
import '/resources/themes/styles/dark_theme_colors.dart'; | ||
import '/resources/themes/styles/light_theme_colors.dart'; | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Theme Config | ||
| Flutter Themes | ||
| Run the below in the terminal to add a new theme. | ||
| "dart run nylo_framework:main make:theme bright_theme" | ||
| | ||
| Learn more: https://nylo.dev/docs/5.x/themes-and-styling | ||
|-------------------------------------------------------------------------- | ||
*/ | ||
|
||
// App Themes | ||
final List<BaseThemeConfig<ColorStyles>> appThemes = [ | ||
ThemeConfig.light(), | ||
ThemeConfig.dark(), | ||
]; | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Theme Colors | ||
|-------------------------------------------------------------------------- | ||
*/ | ||
|
||
// Light Colors | ||
ColorStyles lightColors = LightThemeColors(); | ||
|
||
// Dark Colors | ||
ColorStyles darkColors = DarkThemeColors(); | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Themes | ||
|-------------------------------------------------------------------------- | ||
*/ | ||
|
||
// Preset Themes | ||
class ThemeConfig { | ||
// LIGHT | ||
static BaseThemeConfig<ColorStyles> light() => BaseThemeConfig<ColorStyles>( | ||
id: "default_light_theme", | ||
description: "Light theme", | ||
theme: lightTheme(lightColors), | ||
colors: lightColors, | ||
); | ||
|
||
// DARK | ||
static BaseThemeConfig<ColorStyles> dark() => BaseThemeConfig<ColorStyles>( | ||
id: "default_dark_theme", | ||
description: "Dark theme", | ||
theme: darkTheme(darkColors), | ||
colors: darkColors, | ||
); | ||
|
||
// E.G. CUSTOM THEME | ||
/// Run: "flutter pub run nylo_framework:main make:theme bright_theme" // example bright_theme | ||
// Creates a basic theme in /resources/themes/bright_theme.dart | ||
// Creates the themes colors in /resources/themes/styles/bright_theme_colors.dart | ||
|
||
// First add the colors which was created into the above section like the following: | ||
// Bright Colors | ||
/// ColorStyles brightColors = BrightThemeColors(); | ||
// Next, uncomment the below: | ||
/// static BaseThemeConfig<ColorStyles> bright() => BaseThemeConfig<ColorStyles>( | ||
/// id: "default_bright_theme", | ||
/// description: "Bright theme", | ||
/// theme: brightTheme(brightColors), | ||
/// colors: brightColors, | ||
/// ); | ||
// To then use this theme, add it to the [appThemes] above like the following: | ||
// final appThemes = [ | ||
/// ThemeConfig.bright(), // new theme | ||
// | ||
// ThemeConfig.light(), | ||
// | ||
// ThemeConfig.dark(), | ||
// ]; | ||
} | ||
BaseThemeConfig<ColorStyles>( | ||
id: getEnv('LIGHT_THEME_ID'), | ||
description: "Light theme", | ||
theme: lightTheme, | ||
colors: LightThemeColors(), | ||
), | ||
BaseThemeConfig<ColorStyles>( | ||
id: getEnv('DARK_THEME_ID'), | ||
description: "Dark theme", | ||
theme: darkTheme, | ||
colors: DarkThemeColors(), | ||
), | ||
]; |
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
Oops, something went wrong.