You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
2.6 KiB
101 lines
2.6 KiB
import 'package:flutter/material.dart'; |
|
import 'package:flutter_example_packages/theme/colors.dart'; |
|
import 'package:flutter_example_packages/theme/radius.dart'; |
|
import 'package:google_fonts/google_fonts.dart'; |
|
|
|
final appTheme = ThemeData( |
|
colorScheme: ThemeData().colorScheme.copyWith( |
|
primary: AppColors.primary, |
|
secondary: AppColors.secondary, |
|
), |
|
|
|
/// [Card] |
|
cardTheme: CardTheme( |
|
clipBehavior: Clip.antiAlias, |
|
margin: const EdgeInsets.all(0), |
|
color: AppColors.primary.withOpacity(0.4), |
|
elevation: 0, |
|
shape: RoundedRectangleBorder( |
|
borderRadius: AppRadius.small, |
|
), |
|
), |
|
|
|
/// [TextField] |
|
inputDecorationTheme: const InputDecorationTheme( |
|
contentPadding: EdgeInsets.symmetric( |
|
vertical: 14, |
|
horizontal: 16, |
|
), |
|
border: OutlineInputBorder(), |
|
), |
|
|
|
/// [ElevatedButton] |
|
elevatedButtonTheme: ElevatedButtonThemeData( |
|
style: ElevatedButton.styleFrom( |
|
backgroundColor: AppColors.secondary, |
|
minimumSize: const Size.fromHeight(45), |
|
), |
|
), |
|
|
|
/// [OutlinedButton] |
|
outlinedButtonTheme: OutlinedButtonThemeData( |
|
style: ButtonStyle( |
|
foregroundColor: |
|
MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) { |
|
if (states.contains(MaterialState.disabled)) { |
|
return AppColors.secondary.withOpacity(0.4); |
|
} else { |
|
return AppColors.secondary; |
|
} |
|
}), |
|
side: MaterialStateProperty.resolveWith<BorderSide>( |
|
(Set<MaterialState> states) { |
|
if (states.contains(MaterialState.disabled)) { |
|
return BorderSide(color: AppColors.secondary.withOpacity(0.4)); |
|
} else { |
|
return const BorderSide(color: AppColors.secondary); |
|
} |
|
}), |
|
), |
|
), |
|
|
|
/// [Text] |
|
textTheme: TextTheme( |
|
headlineLarge: GoogleFonts.roboto( |
|
fontSize: 44, |
|
fontWeight: FontWeight.bold, |
|
), |
|
headlineMedium: GoogleFonts.roboto( |
|
fontSize: 30, |
|
fontWeight: FontWeight.bold, |
|
), |
|
headlineSmall: GoogleFonts.roboto( |
|
fontSize: 24, |
|
fontWeight: FontWeight.bold, |
|
), |
|
titleLarge: GoogleFonts.roboto( |
|
fontSize: 20, |
|
height: 1.3, |
|
), |
|
titleMedium: GoogleFonts.roboto( |
|
fontSize: 18, |
|
height: 1.3, |
|
), |
|
titleSmall: GoogleFonts.roboto( |
|
fontSize: 14, |
|
height: 1.3, |
|
), |
|
bodyLarge: GoogleFonts.openSans( |
|
fontSize: 18, |
|
height: 1.3, |
|
), |
|
bodyMedium: GoogleFonts.openSans( |
|
fontSize: 16, |
|
height: 1.3, |
|
), |
|
bodySmall: GoogleFonts.openSans( |
|
fontSize: 12, |
|
height: 1.3, |
|
), |
|
), |
|
);
|
|
|