-
Notifications
You must be signed in to change notification settings - Fork 152
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
31 changed files
with
3,052 additions
and
173 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class TextThemeForDevs extends StatelessWidget { | ||
const TextThemeForDevs({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar(), | ||
body: SizedBox( | ||
width: double.maxFinite, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
|
||
children: [ | ||
|
||
Text("Resonate", style: Theme.of(context).textTheme.displayLarge,), | ||
Text("Resonate", style: Theme.of(context).textTheme.displayMedium,), | ||
Text("Resonate", style: Theme.of(context).textTheme.displaySmall,), | ||
|
||
Text("Resonate", style: Theme.of(context).textTheme.headlineLarge,), | ||
Text("Resonate", style: Theme.of(context).textTheme.headlineMedium,), | ||
Text("Resonate", style: Theme.of(context).textTheme.headlineSmall,), | ||
|
||
Text("Resonate", style: Theme.of(context).textTheme.titleLarge,), | ||
Text("Resonate", style: Theme.of(context).textTheme.titleMedium,), | ||
Text("Resonate", style: Theme.of(context).textTheme.titleSmall,), | ||
|
||
Text("Resonate", style: Theme.of(context).textTheme.bodyLarge,), | ||
Text("Resonate", style: Theme.of(context).textTheme.bodyMedium,), | ||
Text("Resonate", style: Theme.of(context).textTheme.bodySmall,), | ||
|
||
Text("Resonate", style: Theme.of(context).textTheme.labelLarge,), | ||
Text("Resonate", style: Theme.of(context).textTheme.labelMedium,), | ||
Text("Resonate", style: Theme.of(context).textTheme.labelSmall,), | ||
|
||
|
||
|
||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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,13 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ThemeColorModel { | ||
final Color color; | ||
final String name; | ||
final Color onColor; | ||
|
||
ThemeColorModel({ | ||
required this.color, | ||
required this.name, | ||
required this.onColor, | ||
}); | ||
} |
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,58 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:resonate/for_developers/theme_color_model.dart'; | ||
|
||
class ThemeColorsPage extends StatelessWidget { | ||
const ThemeColorsPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final List<ThemeColorModel> list = [ | ||
ThemeColorModel( | ||
color: Theme.of(context).colorScheme.primary, | ||
name: "primary", | ||
onColor: Theme.of(context).colorScheme.onPrimary, | ||
), | ||
ThemeColorModel( | ||
color: Theme.of(context).colorScheme.secondary, | ||
name: "secondary", | ||
onColor: Theme.of(context).colorScheme.onSecondary, | ||
), | ||
ThemeColorModel( | ||
color: Theme.of(context).colorScheme.tertiary, | ||
name: "tertiary", | ||
onColor: Theme.of(context).colorScheme.onTertiary, | ||
), | ||
ThemeColorModel( | ||
color: Theme.of(context).colorScheme.background, | ||
name: "background", | ||
onColor: Theme.of(context).colorScheme.onBackground, | ||
), | ||
ThemeColorModel( | ||
color: Theme.of(context).colorScheme.surface, | ||
name: "surface", | ||
onColor: Theme.of(context).colorScheme.onSurface, | ||
), | ||
|
||
]; | ||
|
||
return Scaffold( | ||
appBar: AppBar(), | ||
body: ListView.builder( | ||
itemBuilder: (context, index) { | ||
return Container( | ||
alignment: Alignment.center, | ||
width: double.maxFinite, | ||
height: 100, | ||
color: list[index].color, | ||
child: Text(list[index].name, style: TextStyle( | ||
color: list[index].onColor, | ||
fontSize: 24, | ||
fontWeight: FontWeight.bold, | ||
),), | ||
); | ||
}, | ||
itemCount: list.length, | ||
), | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ThemeModel { | ||
final String name; | ||
final Color primaryColor; | ||
final Color onPrimaryColor; | ||
final Color secondaryColor; | ||
final Color onSecondaryColor; | ||
final Color surfaceColor; | ||
final Color onSurfaceColor; | ||
final Color backgroundColor; | ||
final ThemeMode themeMode; | ||
|
||
const ThemeModel({ | ||
required this.name, | ||
required this.primaryColor, | ||
required this.onPrimaryColor, | ||
required this.secondaryColor, | ||
required this.onSecondaryColor, | ||
required this.surfaceColor, | ||
required this.onSurfaceColor, | ||
required this.backgroundColor, | ||
required this.themeMode, | ||
}); | ||
} |
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,140 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:google_fonts/google_fonts.dart'; | ||
import 'package:resonate/models/themes_model.dart'; | ||
|
||
import '../utils/ui_sizes.dart'; | ||
|
||
class NewTheme { | ||
static ThemeData setLightTheme(ThemeModel theme) { | ||
return ThemeData( | ||
fontFamily: GoogleFonts.poppins().fontFamily, | ||
colorScheme: ColorScheme.light( | ||
brightness: Brightness.light, | ||
primary: theme.primaryColor, | ||
onPrimary: theme.onPrimaryColor, | ||
secondary: theme.secondaryColor, | ||
onSecondary: theme.onSecondaryColor, | ||
surface: theme.surfaceColor, | ||
onSurface: theme.onSurfaceColor, | ||
surfaceTint: Colors.transparent, | ||
background: theme.backgroundColor, | ||
), | ||
appBarTheme: AppBarTheme( | ||
surfaceTintColor: Colors.transparent, | ||
backgroundColor: theme.backgroundColor | ||
), | ||
textTheme: const TextTheme( | ||
bodyLarge: TextStyle( | ||
// Flutter uses this TextStyle in InputFormField for styling user input text | ||
color: Colors.black, | ||
), | ||
titleMedium: TextStyle( | ||
color: Colors.black54 | ||
), | ||
), | ||
dividerTheme: const DividerThemeData( | ||
color: Colors.black54, | ||
), | ||
elevatedButtonTheme: ElevatedButtonThemeData( | ||
style: ElevatedButton.styleFrom( | ||
backgroundColor: theme.primaryColor, | ||
foregroundColor: theme.onPrimaryColor, | ||
padding: EdgeInsets.symmetric(vertical: UiSizes.height_10), | ||
textStyle: TextStyle( | ||
fontFamily: GoogleFonts.poppins().fontFamily, | ||
fontWeight: FontWeight.w500, | ||
fontSize: UiSizes.size_16, | ||
), | ||
), | ||
), | ||
inputDecorationTheme: InputDecorationTheme( | ||
border: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
borderSide: BorderSide.none, | ||
), | ||
focusedBorder: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
borderSide: BorderSide( | ||
color: theme.primaryColor, | ||
), | ||
), | ||
fillColor: theme.secondaryColor, | ||
filled: true, | ||
hintStyle: TextStyle( | ||
color: theme.onSecondaryColor, | ||
), | ||
contentPadding: EdgeInsets.symmetric( | ||
horizontal: UiSizes.width_20, | ||
vertical: UiSizes.height_20, | ||
), | ||
), | ||
); | ||
} | ||
|
||
static ThemeData setDarkTheme(ThemeModel theme) { | ||
return ThemeData( | ||
fontFamily: GoogleFonts.poppins().fontFamily, | ||
colorScheme: ColorScheme.dark( | ||
brightness: Brightness.dark, | ||
primary: theme.primaryColor, | ||
onPrimary: theme.onPrimaryColor, | ||
secondary: theme.secondaryColor, | ||
onSecondary: theme.onSecondaryColor, | ||
surface: theme.surfaceColor, | ||
onSurface: theme.onSurfaceColor, | ||
surfaceTint: Colors.transparent, | ||
background: theme.backgroundColor, | ||
), | ||
appBarTheme: AppBarTheme( | ||
surfaceTintColor: Colors.transparent, | ||
backgroundColor: theme.backgroundColor, | ||
), | ||
textTheme: const TextTheme( | ||
bodyLarge: TextStyle( | ||
// Flutter uses this TextStyle in InputFormField for styling user input text | ||
color: Colors.white, | ||
), | ||
titleMedium: TextStyle( | ||
color: Colors.white54 | ||
), | ||
), | ||
dividerTheme: const DividerThemeData( | ||
color: Colors.white54, | ||
), | ||
elevatedButtonTheme: ElevatedButtonThemeData( | ||
style: ElevatedButton.styleFrom( | ||
backgroundColor: theme.primaryColor, | ||
foregroundColor: theme.onPrimaryColor, | ||
padding: EdgeInsets.symmetric(vertical: UiSizes.height_10), | ||
textStyle: TextStyle( | ||
fontFamily: GoogleFonts.poppins().fontFamily, | ||
fontWeight: FontWeight.w500, | ||
fontSize: UiSizes.size_16, | ||
), | ||
), | ||
), | ||
inputDecorationTheme: InputDecorationTheme( | ||
border: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
borderSide: BorderSide.none, | ||
|
||
), | ||
focusedBorder: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
borderSide: BorderSide( | ||
color: theme.primaryColor, | ||
), | ||
), | ||
fillColor: theme.secondaryColor, | ||
filled: true, | ||
hintStyle: TextStyle( | ||
color: theme.onSecondaryColor, | ||
), | ||
contentPadding: EdgeInsets.symmetric( | ||
horizontal: UiSizes.width_20, | ||
vertical: UiSizes.height_20, | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.