base_project

This commit is contained in:
2026-01-24 05:16:13 +00:00
commit 73ee588e7b
1349 changed files with 89007 additions and 0 deletions

View File

@@ -0,0 +1,662 @@
import 'package:base_project/core/app_export.dart';
import 'package:flutter/material.dart';
import '../utils/color_constants.dart';
import '../utils/size_utils.dart';
class AppDecoration {
// Gradient decorations
static BoxDecoration get gradientOnErrorContainerToOnErrorContainer =>
BoxDecoration(
gradient: LinearGradient(
begin: const Alignment(0.32, 0.2),
end: const Alignment(0.75, 0.83),
colors: [
theme.colorScheme.onErrorContainer.withOpacity(0.7),
theme.colorScheme.onErrorContainer.withOpacity(0.7),
theme.colorScheme.onErrorContainer.withOpacity(0.7)
],
),
);
static BoxDecoration get fillBlueGray => BoxDecoration(
color: appTheme.blueGray100,
);
static BoxDecoration get fillBlue5001 => BoxDecoration(
color: ColorConstant.blue5001,
);
static BoxDecoration get outlineGray5002 => BoxDecoration(
color: ColorConstant.gray5002,
border: Border.all(
color: ColorConstant.gray5002,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get outlineBlueA70001 => BoxDecoration(
border: Border.all(
color: ColorConstant.blueA70001,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get outlineGray60026 => BoxDecoration(
color: ColorConstant.whiteA700,
boxShadow: [
BoxShadow(
color: ColorConstant.gray60026,
spreadRadius: getHorizontalSize(
2,
),
blurRadius: getHorizontalSize(
2,
),
offset: const Offset(
0,
2.41,
),
),
],
);
static BoxDecoration get txtFillBluegray100 => BoxDecoration(
color: ColorConstant.blueGray100,
);
static BoxDecoration get fillBlueA700 => BoxDecoration(
color: ColorConstant.blueA700,
);
static BoxDecoration get fillBluegray50 => BoxDecoration(
color: ColorConstant.blueGray50,
);
static BoxDecoration get fillBlack => BoxDecoration(
color: appTheme.black900,
);
static BoxDecoration get fillGray => BoxDecoration(
color: appTheme.gray10001,
);
static BoxDecoration get fillGray700 => BoxDecoration(
color: appTheme.gray700,
);
static BoxDecoration get fillLightGreenA => BoxDecoration(
color: appTheme.lightGreenA200,
);
static BoxDecoration get fillOnErrorContainer => BoxDecoration(
color: theme.colorScheme.onErrorContainer.withOpacity(1),
);
static BoxDecoration get fillPrimary => BoxDecoration(
color: theme.colorScheme.primary,
);
static BoxDecoration get outlineBlueA7002 => BoxDecoration(
color: ColorConstant.whiteA700,
border: Border.all(
color: ColorConstant.blueA700,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get outlineBlueA7001 => BoxDecoration(
color: ColorConstant.whiteA700,
border: Border.all(
color: ColorConstant.blueA700,
width: getHorizontalSize(
1,
),
),
boxShadow: [
BoxShadow(
color: ColorConstant.gray60019,
spreadRadius: getHorizontalSize(
2,
),
blurRadius: getHorizontalSize(
2,
),
offset: const Offset(
0,
12,
),
),
],
);
static BoxDecoration get outlineGray70011 => BoxDecoration(
color: ColorConstant.whiteA700,
boxShadow: [
BoxShadow(
color: ColorConstant.gray70011,
spreadRadius: getHorizontalSize(
2,
),
blurRadius: getHorizontalSize(
2,
),
offset: const Offset(
0,
0,
),
),
],
);
static BoxDecoration get outlineGray600191 => const BoxDecoration();
static BoxDecoration get txtOutlineBlueA700 => BoxDecoration(
border: Border.all(
color: ColorConstant.blueA700,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get outlineBlue50 => BoxDecoration(
color: ColorConstant.whiteA700,
border: Border.all(
color: ColorConstant.blue50,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get txtFillBlueA700 => BoxDecoration(
color: ColorConstant.blueA700,
);
static BoxDecoration get outlineBlack90019 => BoxDecoration(
color: ColorConstant.blueA700,
boxShadow: [
BoxShadow(
color: ColorConstant.black90019,
spreadRadius: getHorizontalSize(
2,
),
blurRadius: getHorizontalSize(
2,
),
offset: const Offset(
0,
2,
),
),
],
);
static BoxDecoration get outlineBluegray100 => BoxDecoration(
color: ColorConstant.gray50,
border: Border(
bottom: BorderSide(
color: ColorConstant.blueGray100,
width: getHorizontalSize(
1,
),
),
),
);
static BoxDecoration get fillGray50 => BoxDecoration(
color: ColorConstant.gray50,
);
static BoxDecoration get outlineBluegray10001 => BoxDecoration(
color: ColorConstant.whiteA700,
border: Border.all(
color: ColorConstant.blueGray10001,
width: getHorizontalSize(
1,
),
),
boxShadow: [
BoxShadow(
color: ColorConstant.black90033,
spreadRadius: getHorizontalSize(
2,
),
blurRadius: getHorizontalSize(
2,
),
offset: const Offset(
0,
1,
),
),
],
);
static BoxDecoration get fillBlack900b2 => BoxDecoration(
color: ColorConstant.black900B2,
);
static BoxDecoration get outlineBlack90033 => BoxDecoration(
border: Border.all(
color: ColorConstant.black90033,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get outlineBlack90011 => BoxDecoration(
color: ColorConstant.whiteA700,
boxShadow: [
BoxShadow(
color: ColorConstant.black90011,
spreadRadius: getHorizontalSize(
2,
),
blurRadius: getHorizontalSize(
2,
),
offset: const Offset(
0,
0,
),
),
],
);
static BoxDecoration get outlineGray30001 => BoxDecoration(
border: Border.all(
color: ColorConstant.gray30001,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get outlineBlue200 => BoxDecoration(
border: Border.all(
color: ColorConstant.blue200,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get outlineGray60019 => BoxDecoration(
color: ColorConstant.whiteA700,
boxShadow: [
BoxShadow(
color: ColorConstant.gray60019,
spreadRadius: getHorizontalSize(
2,
),
blurRadius: getHorizontalSize(
2,
),
offset: const Offset(
0,
12,
),
),
],
);
static BoxDecoration get outlineGray700261 => BoxDecoration(
color: ColorConstant.whiteA700,
boxShadow: [
BoxShadow(
color: ColorConstant.gray70026,
spreadRadius: getHorizontalSize(
2,
),
blurRadius: getHorizontalSize(
2,
),
offset: const Offset(
0,
0,
),
),
],
);
static BoxDecoration get fillWhiteA700 => BoxDecoration(
color: ColorConstant.whiteA700,
);
static BoxDecoration get outlineBlueA700 => BoxDecoration(
color: ColorConstant.gray50,
border: Border.all(
color: ColorConstant.blueA700,
width: getHorizontalSize(
2,
),
strokeAlign: strokeAlignOutside,
),
);
static BoxDecoration get fillBlue900 => BoxDecoration(
color: ColorConstant.blue900,
);
static BoxDecoration get outlineBluegray1002 => BoxDecoration(
color: ColorConstant.whiteA700,
border: Border(
top: BorderSide(
color: ColorConstant.blueGray100,
width: getHorizontalSize(
1,
),
),
bottom: BorderSide(
color: ColorConstant.blueGray100,
width: getHorizontalSize(
1,
),
),
),
);
static BoxDecoration get fillRed100 => BoxDecoration(
color: ColorConstant.red100,
);
static BoxDecoration get outlineBluegray1001 => BoxDecoration(
color: ColorConstant.whiteA700,
border: Border.all(
color: ColorConstant.blueGray100,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get outlineYellow9003f => BoxDecoration(
color: ColorConstant.whiteA700,
border: Border.all(
color: ColorConstant.yellow9003f,
width: getHorizontalSize(
1,
),
strokeAlign: strokeAlignOutside,
),
);
static BoxDecoration get fillBlue50 => BoxDecoration(
color: ColorConstant.blue50,
);
static BoxDecoration get outlineGray70026 => BoxDecoration(
color: ColorConstant.whiteA70099,
boxShadow: [
BoxShadow(
color: ColorConstant.gray70026,
spreadRadius: getHorizontalSize(
2,
),
blurRadius: getHorizontalSize(
2,
),
offset: const Offset(
0,
0,
),
),
],
);
static BoxDecoration get txtOutlineBlack9000c => BoxDecoration(
color: ColorConstant.gray100,
border: Border.all(
color: ColorConstant.black9000c,
width: getHorizontalSize(
1,
),
),
);
static BoxDecoration get fillRed700 => BoxDecoration(
color: ColorConstant.red700,
);
static BoxDecoration get fillGray5003 => BoxDecoration(
color: ColorConstant.gray5003,
);
static BoxDecoration get fillGray200 => BoxDecoration(
color: ColorConstant.gray200,
);
static BoxDecoration get outlineBluegray50 => BoxDecoration(
color: ColorConstant.whiteA700,
border: Border.all(
color: ColorConstant.blueGray50,
width: getHorizontalSize(
1,
),
),
);
// Outline decorations
static BoxDecoration get outlineOnPrimaryContainer => BoxDecoration(
color: appTheme.whiteA700,
border: Border.all(
color: theme.colorScheme.onPrimaryContainer,
width: 1.h,
),
);
// Outline decorations
static BoxDecoration get outlineBlack => const BoxDecoration();
// Fill decorations
static BoxDecoration get fillBlueA => BoxDecoration(
color: appTheme.blueA200,
);
static BoxDecoration get fillGray800 => BoxDecoration(
color: appTheme.gray800,
);
static BoxDecoration get fillOnError => BoxDecoration(
color: theme.colorScheme.onError,
);
static BoxDecoration get fillPink => BoxDecoration(
color: appTheme.pink400,
);
static BoxDecoration get fillPrimary1 => BoxDecoration(
color: theme.colorScheme.primary.withOpacity(0.05),
);
static BoxDecoration get fillPrimary2 => BoxDecoration(
color: theme.colorScheme.primary.withOpacity(0.1),
);
static BoxDecoration get fillWhiteA => BoxDecoration(
color: appTheme.whiteA700,
);
static BoxDecoration get fillYellow => BoxDecoration(
color: appTheme.yellow600,
);
// Outline decorations
static BoxDecoration get outlineGray => BoxDecoration(
color: appTheme.whiteA700.withOpacity(0.6),
border: Border.all(
color: appTheme.gray300,
width: 1.h,
),
);
static BoxDecoration get outlineGray300 => BoxDecoration(
color: appTheme.whiteA700.withOpacity(0.6),
border: Border(
bottom: BorderSide(
color: appTheme.gray300,
width: 1.h,
),
),
);
static BoxDecoration get outlineGray3001 => BoxDecoration(
color: appTheme.whiteA700,
border: Border(
bottom: BorderSide(
color: appTheme.gray300,
width: 1.h,
),
),
);
static BoxDecoration get outlineGray3002 => BoxDecoration(
border: Border(
bottom: BorderSide(
color: appTheme.gray300,
width: 1.h,
),
),
);
static BoxDecoration get outlineGray3003 => BoxDecoration(
border: Border.all(
color: appTheme.gray300,
width: 1.h,
),
);
static BoxDecoration get outlineGray3004 => BoxDecoration(
border: Border(
left: BorderSide(
color: appTheme.gray300,
width: 1.h,
),
right: BorderSide(
color: appTheme.gray300,
width: 1.h,
),
),
);
static BoxDecoration get outlineGray3005 => BoxDecoration(
color: appTheme.whiteA700.withOpacity(0.05),
border: Border.all(
color: appTheme.gray300,
width: 1.h,
),
);
static BoxDecoration get outlineGray3006 => BoxDecoration(
border: Border(
bottom: BorderSide(
color: appTheme.gray300,
width: 1.h,
),
),
);
}
class BorderRadiusStyle {
static BorderRadius customBorderTL50 = BorderRadius.only(
topLeft: Radius.circular(
getHorizontalSize(
50,
),
),
bottomLeft: Radius.circular(
getHorizontalSize(
50,
),
),
);
static BorderRadius customBorderTL10 = BorderRadius.only(
topLeft: Radius.circular(
getHorizontalSize(
10,
),
),
topRight: Radius.circular(
getHorizontalSize(
10,
),
),
);
static BorderRadius circleBorder9 = BorderRadius.circular(
getHorizontalSize(
9,
),
);
static BorderRadius circleBorder22 = BorderRadius.circular(
getHorizontalSize(
22,
),
);
static BorderRadius roundedBorder16 = BorderRadius.circular(
getHorizontalSize(
16,
),
);
static BorderRadius circleBorder12 = BorderRadius.circular(
getHorizontalSize(
12,
),
);
static BorderRadius roundedBorder6 = BorderRadius.circular(
getHorizontalSize(
6,
),
);
static BorderRadius circleBorder25 = BorderRadius.circular(
getHorizontalSize(
25,
),
);
static BorderRadius roundedBorder3 = BorderRadius.circular(
getHorizontalSize(
3,
),
);
static BorderRadius circleBorder30 = BorderRadius.circular(
getHorizontalSize(
30,
),
);
static BorderRadius circleBorder76 = BorderRadius.circular(
getHorizontalSize(
76,
),
);
static BorderRadius txtRoundedBorder6 = BorderRadius.circular(
getHorizontalSize(
6,
),
);
static BorderRadius circleBorder61 = BorderRadius.circular(
getHorizontalSize(
61,
),
);
static BorderRadius get roundedBorder8 => BorderRadius.circular(
8.h,
);
// Circle borders
static BorderRadius get circleBorder24 => BorderRadius.circular(
24.h,
);
static BorderRadius get circleBorder50 => BorderRadius.circular(
50.h,
);
// Rounded borders
static BorderRadius get roundedBorder10 => BorderRadius.circular(
10.h,
);
static BorderRadius get roundedBorder15 => BorderRadius.circular(
15.h,
);
static BorderRadius get roundedBorder19 => BorderRadius.circular(
19.h,
);
static BorderRadius get roundedBorder5 => BorderRadius.circular(
5.h,
);
static BorderRadius get circleBorder20 => BorderRadius.circular(
20.h,
);
// Custom borders
static BorderRadius get customBorderBL12 => BorderRadius.vertical(
bottom: Radius.circular(12.h),
);
static BorderRadius get customBorderTL12 => BorderRadius.vertical(
top: Radius.circular(12.h),
);
static BorderRadius get roundedBorder24 => BorderRadius.circular(
24.h,
);
}
// Comment/Uncomment the below code based on your Flutter SDK version.
// For Flutter SDK Version 3.7.2 or greater.
double get strokeAlignInside => BorderSide.strokeAlignInside;
double get strokeAlignCenter => BorderSide.strokeAlignCenter;
double get strokeAlignOutside => BorderSide.strokeAlignOutside;
// For Flutter SDK Version 3.7.1 or less.
// StrokeAlign get strokeAlignInside => StrokeAlign.inside;
//
// StrokeAlign get strokeAlignCenter => StrokeAlign.center;
//
// StrokeAlign get strokeAlignOutside => StrokeAlign.outside;

View File

@@ -0,0 +1,143 @@
import 'package:flutter/material.dart';
import '../core/app_export.dart';
/// A class that offers pre-defined button styles for customizing button appearance.
class CustomButtonStyles {
static BoxDecoration get fullyBlack => BoxDecoration(
borderRadius: BorderRadius.circular(24.h),
color: Colors.black,
);
static BoxDecoration
get gradientOnErrorContainerToOnErrorContainerDecoration => BoxDecoration(
borderRadius: BorderRadius.circular(24.h),
boxShadow: [
BoxShadow(
color: appTheme.black900.withOpacity(0.5),
spreadRadius: 2.h,
blurRadius: 2.h,
offset: const Offset(
4,
38,
),
)
],
gradient: LinearGradient(
begin: const Alignment(0.32, 0),
end: const Alignment(0.75, 0),
colors: [
theme.colorScheme.onErrorContainer.withOpacity(0.7),
theme.colorScheme.onErrorContainer.withOpacity(0.7)
],
),
);
static BoxDecoration get gradientGrayBToOnErrorContainerDecoration =>
BoxDecoration(
borderRadius: BorderRadius.circular(24.h),
boxShadow: [
BoxShadow(
color: appTheme.black900.withOpacity(0.5),
spreadRadius: 2.h,
blurRadius: 2.h,
offset: const Offset(
4,
38,
),
)
],
color: Colors.black,
gradient: LinearGradient(
begin: const Alignment(0.32, 0),
end: const Alignment(0.75, 0),
colors: [
appTheme.black900,
theme.colorScheme.onErrorContainer.withOpacity(1)
],
),
);
static BoxDecoration get gradientWhiteAToWhiteADecoration => BoxDecoration(
borderRadius: BorderRadius.circular(17.h),
gradient: LinearGradient(
begin: const Alignment(0.32, 0),
end: const Alignment(0.75, 0),
colors: [
appTheme.whiteA700.withOpacity(0.7),
appTheme.whiteA700.withOpacity(0.7)
],
),
);
// Outline button style
static ButtonStyle get outlineBlack => ElevatedButton.styleFrom(
backgroundColor: appTheme.blueA100,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.h),
),
shadowColor: appTheme.black900.withOpacity(0.4),
elevation: 2,
);
// text button style
static ButtonStyle get none => ButtonStyle(
backgroundColor: WidgetStateProperty.all<Color>(Colors.transparent),
elevation: WidgetStateProperty.all<double>(0),
);
// Filled button style
static ButtonStyle get fillBlueA => ElevatedButton.styleFrom(
backgroundColor: appTheme.blueA20001,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(21.h),
),
);
static ButtonStyle get fillPrimary => ElevatedButton.styleFrom(
backgroundColor: theme.colorScheme.primary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.h),
),
);
static ButtonStyle get fillPrimaryTL16 => ElevatedButton.styleFrom(
backgroundColor: theme.colorScheme.primary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.h),
),
);
static ButtonStyle get fillWhiteA => ElevatedButton.styleFrom(
backgroundColor: appTheme.whiteA700,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.h),
),
);
// Gradient button style
static BoxDecoration get gradientGrayBToWhiteADecoration => BoxDecoration(
borderRadius: BorderRadius.circular(24.h),
boxShadow: [
BoxShadow(
color: theme.colorScheme.primary.withOpacity(0.5),
spreadRadius: 2.h,
blurRadius: 2.h,
offset: const Offset(
4,
38,
),
)
],
gradient: LinearGradient(
begin: const Alignment(0.32, 0),
end: const Alignment(0.75, 0),
colors: [appTheme.gray100B2, appTheme.whiteA700.withOpacity(0.7)],
),
);
static BoxDecoration get gradientWhiteAToWhiteATL25Decoration =>
BoxDecoration(
borderRadius: BorderRadius.circular(25.h),
gradient: LinearGradient(
begin: const Alignment(0.32, 0),
end: const Alignment(0.75, 0),
colors: [
appTheme.whiteA700.withOpacity(0.7),
appTheme.whiteA700.withOpacity(0.7)
],
),
);
}

View File

@@ -0,0 +1,492 @@
import 'package:flutter/material.dart';
import '../core/app_export.dart';
extension on TextStyle {
TextStyle get poppins {
return copyWith(
fontFamily: 'Poppins',
);
}
TextStyle get openSans {
return copyWith(
fontFamily: 'Open Sans',
);
}
TextStyle get roboto {
return copyWith(
fontFamily: 'Roboto',
);
}
TextStyle get montserrat {
return copyWith(
fontFamily: 'Montserrat',
);
}
TextStyle get dMSans {
return copyWith(
fontFamily: 'DM Sans',
);
}
TextStyle get sourceSansPro {
return copyWith(
fontFamily: 'Source Sans Pro',
);
}
TextStyle get dMMono {
return copyWith(
fontFamily: 'DM Mono',
);
}
TextStyle get sFProText {
return copyWith(
fontFamily: 'SF Pro Text',
);
}
TextStyle get hammersmithOne {
return copyWith(
fontFamily: 'Hammersmith One',
);
}
TextStyle get urbanist {
return copyWith(
fontFamily: 'Urbanist',
);
}
TextStyle get sFPro {
return copyWith(
fontFamily: 'SF Pro',
);
}
}
/// A collection of pre-defined text styles for customizing text appearance,
/// categorized by different font families and weights.
/// Additionally, this class includes extensions on [TextStyle] to easily apply specific font families to text.
class CustomTextStyles {
static get titleLargePoppinsBlack40 =>
theme.textTheme.titleMedium!.poppins.copyWith(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 40.fSize,
);
static get titleSmallPoppinsWhite =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 22.fSize,
);
static get titleSmallRed700 => theme.textTheme.titleSmall!.copyWith(
color: appTheme.red700,
fontWeight: FontWeight.w700,
);
static get titleLargePoppinsBlack =>
theme.textTheme.titleMedium!.poppins.copyWith(
color: Colors.black,
fontSize: 30.fSize,
);
static get titleMediumMediumWhit => theme.textTheme.titleMedium!.copyWith(
fontSize: 16.fSize, fontWeight: FontWeight.w500, color: Colors.white);
// Headline text style
static get headlineLargePoppinsBlack900 =>
theme.textTheme.headlineLarge!.poppins.copyWith(
color: appTheme.black900,
fontWeight: FontWeight.w700,
);
// Label text style
static get labelLargeCyan900 => theme.textTheme.labelLarge!.copyWith(
color: appTheme.cyan900,
);
static get labelLargeGray500 => theme.textTheme.labelLarge!.copyWith(
color: appTheme.gray500,
fontWeight: FontWeight.w500,
);
// Title text style
static get titleSmallMontserratBlack900 =>
theme.textTheme.titleSmall!.montserrat.copyWith(
color: appTheme.black900,
fontSize: 14.fSize,
fontWeight: FontWeight.w700,
);
static get titleSmallPoppinsWhiteA700 =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: appTheme.whiteA700,
fontSize: 14.fSize,
fontWeight: FontWeight.w700,
);
static get headlineSmallBlack900 => theme.textTheme.headlineSmall!.copyWith(
color: appTheme.black900,
fontWeight: FontWeight.w500,
);
static get headlineSmallBlack900_1 => theme.textTheme.headlineSmall!.copyWith(
color: appTheme.black900,
);
// Headline text style
static get headlineLargeGray900 => theme.textTheme.headlineLarge!.copyWith(
color: appTheme.gray900,
);
// Title text style
static get titleMedium18 => theme.textTheme.titleMedium!.copyWith(
fontSize: 18.fSize,
);
static get titleMediumErrorContainer => theme.textTheme.titleMedium!.copyWith(
color: theme.colorScheme.errorContainer,
fontWeight: FontWeight.w500,
);
static get titleMediumPrimary => theme.textTheme.titleMedium!.copyWith(
color: theme.colorScheme.primary,
fontSize: 18.fSize,
);
static get titleSmallDeeppurpleA400 => theme.textTheme.titleSmall!.copyWith(
color: appTheme.deepPurpleA400,
fontWeight: FontWeight.w700,
);
static get titleSmallErrorContainer => theme.textTheme.titleSmall!.copyWith(
color: theme.colorScheme.errorContainer,
);
static get titleSmallGray600 => theme.textTheme.titleSmall!.copyWith(
color: appTheme.gray600,
fontSize: 14.fSize,
fontWeight: FontWeight.w600,
);
static get titleSmallPoppinsBlack900 =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: appTheme.black900,
);
static get titleSmallPoppinsDeeppurpleA400 =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: appTheme.deepPurpleA400,
fontWeight: FontWeight.w700,
);
static get titleSmallPoppinsGray90001 =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: appTheme.gray90001,
);
static get titleSmallPoppinsPrimaryContainer =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: theme.colorScheme.primaryContainer,
fontWeight: FontWeight.w600,
);
static get titleSmallPoppinsPrimaryContainer_1 =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: theme.colorScheme.primaryContainer,
);
static get titleSmallPrimaryContainer => theme.textTheme.titleSmall!.copyWith(
color: theme.colorScheme.primaryContainer,
);
// Body text style
static get bodyMediumPoppinsBluegray50 =>
theme.textTheme.bodyMedium!.poppins.copyWith(
color: appTheme.blueGray50,
);
static get bodySmallMontserratBluegray400 =>
theme.textTheme.bodySmall!.montserrat.copyWith(
color: appTheme.blueGray400,
fontSize: 10.fSize,
fontWeight: FontWeight.w400,
);
static get bodySmallOpenSansOnPrimaryContainer =>
theme.textTheme.bodySmall!.openSans.copyWith(
color: theme.colorScheme.onPrimaryContainer.withOpacity(1),
fontWeight: FontWeight.w400,
);
static get bodySmallRegular => theme.textTheme.bodySmall!.copyWith(
fontSize: 10.fSize,
fontWeight: FontWeight.w400,
);
static get bodySmallYellow900 => theme.textTheme.bodySmall!.copyWith(
color: appTheme.yellow900,
fontSize: 12.fSize,
fontWeight: FontWeight.w400,
);
// Headline text style
static get headlineLargeBold => theme.textTheme.headlineLarge!.copyWith(
fontSize: 32.fSize,
fontWeight: FontWeight.w700,
);
static get headlineLargeExtraBold => theme.textTheme.headlineLarge!.copyWith(
fontSize: 32.fSize,
fontWeight: FontWeight.w800,
);
static get headlineSmallOnPrimaryContainer =>
theme.textTheme.headlineSmall!.copyWith(
color: theme.colorScheme.onPrimaryContainer.withOpacity(1),
fontSize: 24.fSize,
);
static get headlineSmallSemiBold => theme.textTheme.headlineSmall!.copyWith(
fontSize: 24.fSize,
fontWeight: FontWeight.w600,
);
// Label text style
static get labelLargeBluegray700 => theme.textTheme.labelLarge!.copyWith(
color: appTheme.blueGray700,
);
static get labelLargeMontserratCyan900 =>
theme.textTheme.labelLarge!.montserrat.copyWith(
color: appTheme.cyan900,
fontWeight: FontWeight.w700,
);
static get labelLargeMontserratGray500 =>
theme.textTheme.labelLarge!.montserrat.copyWith(
color: appTheme.gray500,
);
static get labelLargeMontserratTeal100 =>
theme.textTheme.labelLarge!.montserrat.copyWith(
color: appTheme.teal100,
fontWeight: FontWeight.w700,
);
static get labelMediumGray500 => theme.textTheme.labelMedium!.copyWith(
color: appTheme.gray500,
);
static get labelMediumGreen80001 => theme.textTheme.labelMedium!.copyWith(
color: appTheme.green80001,
);
static get labelMediumMontserratCyan900 =>
theme.textTheme.labelMedium!.montserrat.copyWith(
color: appTheme.cyan900,
fontWeight: FontWeight.w700,
);
static get labelMediumOpenSans =>
theme.textTheme.labelMedium!.openSans.copyWith(
fontWeight: FontWeight.w700,
);
static get labelMediumRed700 => theme.textTheme.labelMedium!.copyWith(
color: appTheme.red700,
);
static get labelSmallBold => theme.textTheme.labelSmall!.copyWith(
fontWeight: FontWeight.w700,
);
// Open text style
static get openSansOnPrimaryContainer => TextStyle(
color: theme.colorScheme.onPrimaryContainer,
fontSize: 6.fSize,
fontWeight: FontWeight.w400,
).openSans;
// Title text style
static get titleMediumMedium => theme.textTheme.titleMedium!.copyWith(
fontSize: 16.fSize,
fontWeight: FontWeight.w500,
);
static get titleSmallPoppinsOnPrimaryContainer =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: theme.colorScheme.onPrimaryContainer.withOpacity(1),
fontWeight: FontWeight.w500,
);
static get titleSmallPoppinsOnPrimaryContainerMedium =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: theme.colorScheme.onPrimaryContainer.withOpacity(1),
fontWeight: FontWeight.w500,
);
static get titleSmallPoppinsOnPrimaryContainer_1 =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: theme.colorScheme.onPrimaryContainer.withOpacity(1),
);
static get bodySmallOpenSansOnErrorContainer =>
theme.textTheme.bodySmall!.openSans.copyWith(
color: theme.colorScheme.onErrorContainer.withOpacity(1),
fontSize: 8.fSize,
);
// Headline text style
static get headlineLargeSemiBold => theme.textTheme.headlineLarge!.copyWith(
fontSize: 30.fSize,
fontWeight: FontWeight.w600,
);
static get headlineSmallOnErrorContainer =>
theme.textTheme.headlineSmall!.copyWith(
color: theme.colorScheme.onErrorContainer.withOpacity(1),
fontSize: 24.fSize,
);
// Label text style
static get labelLargeDMSansOnPrimaryContainer =>
theme.textTheme.labelLarge!.dMSans.copyWith(
color: theme.colorScheme.onPrimaryContainer,
fontSize: 13.fSize,
);
static get labelLargeDMSansOnPrimaryContainer_1 =>
theme.textTheme.labelLarge!.dMSans.copyWith(
color: theme.colorScheme.onPrimaryContainer,
);
static get labelLargeErrorContainer => theme.textTheme.labelLarge!.copyWith(
color: theme.colorScheme.errorContainer,
);
static get labelLarge_1 => theme.textTheme.labelLarge!;
// Open text style
static get openSansOnErrorContainer => TextStyle(
color: theme.colorScheme.onErrorContainer,
fontSize: 6.fSize,
fontWeight: FontWeight.w400,
).openSans;
// Title text style
static get titleMediumBlack900 => theme.textTheme.titleMedium!.copyWith(
color: appTheme.black900,
);
static get titleMediumBlack900Medium => theme.textTheme.titleMedium!.copyWith(
color: appTheme.black900,
fontSize: 16.fSize,
fontWeight: FontWeight.w500,
);
static get titleMediumGray300 => theme.textTheme.titleMedium!.copyWith(
color: appTheme.gray300,
);
static get titleMediumGray50 => theme.textTheme.titleMedium!.copyWith(
color: appTheme.gray50,
fontWeight: FontWeight.w700,
);
static get titleMediumSourceSansPro =>
theme.textTheme.titleMedium!.sourceSansPro.copyWith(
fontSize: 16.fSize,
);
static get titleSmallPoppinsOnErrorContainer =>
theme.textTheme.titleSmall!.poppins.copyWith(
color: theme.colorScheme.onErrorContainer.withOpacity(1),
);
static get titleMediumWhiteA700 => theme.textTheme.titleMedium!.copyWith(
color: appTheme.whiteA700,
);
// Body text style
static get bodyLargeGray50 => theme.textTheme.bodyLarge!.copyWith(
color: appTheme.gray50,
);
// Label text style
static get labelLargeAmber300 => theme.textTheme.labelLarge!.copyWith(
color: appTheme.amber300,
);
static get labelLargePoppinsGray50 =>
theme.textTheme.labelLarge!.poppins.copyWith(
color: appTheme.gray50,
fontWeight: FontWeight.w700,
);
static get labelLargePrimary => theme.textTheme.labelLarge!.copyWith(
color: theme.colorScheme.primary,
);
static get labelLargePrimaryBold => theme.textTheme.labelLarge!.copyWith(
color: theme.colorScheme.primary,
fontWeight: FontWeight.w700,
);
static get labelLargePrimaryExtraBold => theme.textTheme.labelLarge!.copyWith(
color: theme.colorScheme.primary,
fontWeight: FontWeight.w800,
);
static get labelLargeSFProTextErrorContainer =>
theme.textTheme.labelLarge!.sFProText.copyWith(
color: theme.colorScheme.errorContainer,
fontWeight: FontWeight.w700,
);
static get labelLargeSFProTextErrorContainer_1 =>
theme.textTheme.labelLarge!.sFProText.copyWith(
color: theme.colorScheme.errorContainer,
);
static get labelLargeSFProTextPrimary =>
theme.textTheme.labelLarge!.sFProText.copyWith(
color: theme.colorScheme.primary,
fontWeight: FontWeight.w500,
);
static get labelLargeSFProTextPrimaryMedium =>
theme.textTheme.labelLarge!.sFProText.copyWith(
color: theme.colorScheme.primary.withOpacity(0.53),
fontWeight: FontWeight.w500,
);
static get labelLargeSFProTextPrimaryMedium_1 =>
theme.textTheme.labelLarge!.sFProText.copyWith(
color: theme.colorScheme.primary.withOpacity(0.56),
fontWeight: FontWeight.w500,
);
static get labelLargeSFProTextPrimary_1 =>
theme.textTheme.labelLarge!.sFProText.copyWith(
color: theme.colorScheme.primary.withOpacity(0.7),
);
static get labelLargeSFProTextPrimary_2 =>
theme.textTheme.labelLarge!.sFProText.copyWith(
color: theme.colorScheme.primary,
);
static get labelLargeSFProTextRed600 =>
theme.textTheme.labelLarge!.sFProText.copyWith(
color: appTheme.red600,
);
static get labelLargeSFProTextWhiteA700 =>
theme.textTheme.labelLarge!.sFProText.copyWith(
color: appTheme.whiteA700,
fontWeight: FontWeight.w500,
);
static get labelLargeWhiteA700 => theme.textTheme.labelLarge!.copyWith(
color: appTheme.whiteA700,
);
static get labelLargeWhiteA700ExtraBold =>
theme.textTheme.labelLarge!.copyWith(
color: appTheme.whiteA700,
fontWeight: FontWeight.w800,
);
static get labelLargeWhiteA700_1 => theme.textTheme.labelLarge!.copyWith(
color: appTheme.whiteA700.withOpacity(0.9),
);
static get labelLargeWhiteA700_2 => theme.textTheme.labelLarge!.copyWith(
color: appTheme.whiteA700.withOpacity(0.9),
);
static get labelMediumPrimary => theme.textTheme.labelMedium!.copyWith(
color: theme.colorScheme.primary,
fontWeight: FontWeight.w800,
);
static get labelMediumSFProTextRed600 =>
theme.textTheme.labelMedium!.sFProText.copyWith(
color: appTheme.red600,
);
static get labelMediumWhiteA700 => theme.textTheme.labelMedium!.copyWith(
color: appTheme.whiteA700,
fontWeight: FontWeight.w600,
);
static get labelMediumWhiteA700ExtraBold =>
theme.textTheme.labelMedium!.copyWith(
color: appTheme.whiteA700.withOpacity(0.7),
fontWeight: FontWeight.w800,
);
static get labelMediumWhiteA700ExtraBold_1 =>
theme.textTheme.labelMedium!.copyWith(
color: appTheme.whiteA700,
fontWeight: FontWeight.w800,
);
// Title text style
static get titleLargeWhiteA700 => theme.textTheme.titleLarge!.copyWith(
color: appTheme.whiteA700,
);
static get titleLargeWhiteA700_1 => theme.textTheme.titleLarge!.copyWith(
color: appTheme.whiteA700,
);
static get titleMediumDeeporange300 => theme.textTheme.titleMedium!.copyWith(
color: appTheme.deepOrange300,
fontSize: 18.fSize,
fontWeight: FontWeight.w800,
);
static get titleMediumPoppins =>
theme.textTheme.titleMedium!.poppins.copyWith(
fontSize: 18.fSize,
fontWeight: FontWeight.w600,
);
static get titleMediumPoppinsGray50 =>
theme.textTheme.titleMedium!.poppins.copyWith(
color: appTheme.gray50,
fontSize: 18.fSize,
);
static get titleMediumRed600 => theme.textTheme.titleMedium!.copyWith(
color: appTheme.red600,
);
static get titleMediumSFProText => theme.textTheme.titleMedium!.sFProText;
}

View File

@@ -0,0 +1,263 @@
import 'package:flutter/material.dart';
import '../core/app_export.dart';
String _appTheme = "lightCode";
LightCodeColors get appTheme => ThemeHelper().themeColor();
ThemeData get theme => ThemeHelper().themeData();
/// Helper class for managing themes and colors.
// ignore_for_file: must_be_immutable
// ignore_for_file: must_be_immutable
class ThemeHelper {
// A map of custom color themes supported by the app
final Map<String, LightCodeColors> _supportedCustomColor = {
'lightCode': LightCodeColors()
};
// A map of color schemes supported by the app
final Map<String, ColorScheme> _supportedColorScheme = {
'lightCode': ColorSchemes.lightCodeColorScheme
};
/// Changes the app theme to [newTheme].
void changeTheme(String newTheme) {
_appTheme = newTheme;
}
/// Returns the lightCode colors for the current theme.
LightCodeColors _getThemeColors() {
return _supportedCustomColor[_appTheme] ?? LightCodeColors();
}
/// Returns the current theme data.
ThemeData _getThemeData() {
var colorScheme =
_supportedColorScheme[_appTheme] ?? ColorSchemes.lightCodeColorScheme;
return ThemeData(
visualDensity: VisualDensity.standard,
colorScheme: colorScheme,
textTheme: TextThemes.textTheme(colorScheme),
scaffoldBackgroundColor: appTheme.gray100,
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: colorScheme.primary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
shadowColor: appTheme.black900.withOpacity(0.4),
elevation: 2,
visualDensity: const VisualDensity(
vertical: -4,
horizontal: -4,
),
padding: EdgeInsets.zero,
),
),
dividerTheme: DividerThemeData(
thickness: 1,
space: 1,
color: colorScheme.onPrimaryContainer.withOpacity(0.2),
),
);
}
/// Returns the lightCode colors for the current theme.
LightCodeColors themeColor() => _getThemeColors();
/// Returns the current theme data.
ThemeData themeData() => _getThemeData();
}
/// Class containing the supported text theme styles.
class TextThemes {
static TextTheme textTheme(ColorScheme colorScheme) => TextTheme(
bodyMedium: TextStyle(
color: colorScheme.onPrimaryContainer.withOpacity(1),
fontSize: 13.fSize,
fontFamily: 'Roboto',
fontWeight: FontWeight.w400,
),
bodySmall: TextStyle(
color: appTheme.gray500,
fontSize: 8.fSize,
fontFamily: 'Poppins',
fontWeight: FontWeight.w300,
),
headlineLarge: TextStyle(
color: appTheme.black900,
fontSize: 30.fSize,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
headlineSmall: TextStyle(
color: appTheme.black900,
fontSize: 25.fSize,
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
),
labelLarge: TextStyle(
color: colorScheme.onPrimaryContainer.withOpacity(1),
fontSize: 12.fSize,
fontFamily: 'Poppins',
fontWeight: FontWeight.w500,
),
labelMedium: TextStyle(
color: colorScheme.onPrimaryContainer.withOpacity(1),
fontSize: 10.fSize,
fontFamily: 'Poppins',
fontWeight: FontWeight.w500,
),
labelSmall: TextStyle(
color: colorScheme.onPrimaryContainer.withOpacity(1),
fontSize: 8.fSize,
fontFamily: 'Open Sans',
fontWeight: FontWeight.w600,
),
titleLarge: TextStyle(
color: appTheme.black900,
fontSize: 20.fSize,
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
),
titleMedium: TextStyle(
color: appTheme.black900,
fontSize: 18.fSize,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
titleSmall: TextStyle(
color: appTheme.black900,
fontSize: 14.fSize,
fontFamily: 'Montserrat',
fontWeight: FontWeight.w700,
),
);
}
/// Class containing the supported color schemes.
class ColorSchemes {
static const lightCodeColorScheme = ColorScheme.light(
primary: Color(0XFF8DB1F7),
primaryContainer: Color(0XFF2E353E),
errorContainer: Color(0XFF777777),
onPrimary: Color(0XFF1C2026),
onPrimaryContainer: Color(0X75FFFFFF),
);
}
/// Class containing custom colors for a lightCode theme.
class LightCodeColors {
// Black
Color get black900 => const Color(0XFF000000);
// Blue
Color get blueA200 => const Color(0XFF5285E8);
// BlueGray
Color get blueGray400 => const Color(0XFF888888);
Color get blueGray50 => const Color(0XFFF1F1F1);
Color get blueGray700 => const Color(0XFF535D67);
Color get blueGray800 => const Color(0XFF454B55);
// Cyan
Color get cyan600 => const Color(0XFF1DA1BE);
Color get cyan900 => const Color(0XFF105955);
// Gray
Color get gray100 => const Color(0XFFF0F5F4);
Color get gray500 => const Color(0XFFAAAAAA);
Color get gray700 => const Color(0XFF636363);
Color get gray900 => const Color(0XFF1E232C);
// Green
Color get green50 => const Color(0XFFD9F9DA);
Color get green800 => const Color(0XFF159021);
Color get green80001 => const Color(0XFF0CAC13);
Color get gray50 => const Color(0XFFF7F8F9);
// Blue
Color get blue400 => const Color(0XFF34AADF);
Color get blueA100 => const Color(0XFF8DB1F7);
Color get blueA400 => const Color(0XFF337FFF);
// BlueGray
Color get blueGray200 => const Color(0XFFB8BCCA);
Color get blueGray40001 => const Color(0XFF888888);
// DeepOrange
Color get deepOrangeA400 => const Color(0XFFFF4500);
// Indigo
Color get indigo50 => const Color(0XFFE8ECF4);
// LightGreen
Color get lightGreenA200 => const Color(0XFFC7FC6C);
Color get lightGreenA20001 => const Color(0XFFC0FE53);
// Red
Color get red100 => const Color(0XFFF8C6CC);
Color get red600 => const Color(0XFFE73E3E);
Color get red700 => const Color(0XFFDA2037);
// Teal
Color get teal100 => const Color(0XFFA5E0DD);
// Yellow
Color get yellow900 => const Color(0XFFEE7429);
Color get gray600 => const Color(0XFF6A707C);
// DeepPurple
Color get deepPurpleA400 => const Color(0XFF5030E5);
// Gray
Color get gray10001 => const Color(0XFFF0F5F4);
Color get gray90001 => const Color(0XFF1B1919);
// Red
Color get red500 => const Color(0XFFF14336);
// White
Color get whiteA700 => const Color(0XFFFFFFFF);
// GrayB
Color get gray100B2 => const Color(0XB2F7F7F7);
Color get gray300 => const Color(0XFFE4E4E6);
// Amber
Color get amberA700 => const Color(0XFFFFAE00);
// LightBlue
Color get lightBlue900 => const Color(0XFF006699);
Color get lightBlueA200 => const Color(0XFF33CCFF);
Color get lightBlueA20001 => const Color(0XFF36C5F0);
// BlueGray
Color get blueGray100 => const Color(0XFFD9D9D9);
// LightGreen
Color get lightGreen100 => const Color(0XFFDDF8BB);
Color get lightGreenA20000 => const Color(0X00BBFB4C);
// Lime
Color get limeA200 => const Color(0XFFF8FF4A);
// Yellow
Color get yellow400 => const Color(0XFFE8FF61);
// Amber
Color get amber300 => const Color(0XFFFFDB61);
Color get blueA20001 => const Color(0XFF4C7FE4);
Color get blueA20002 => const Color(0XFF5285E8);
// DeepOrange
Color get deepOrange300 => const Color(0XFFFF9969);
Color get deepOrangeA200 => const Color(0XFFFF6C2C);
Color get gray200 => const Color(0XFFEFEFEF);
Color get gray800 => const Color(0XFF383838);
// Green
Color get green600 => const Color(0XFF239F57);
Color get green900 => const Color(0XFF096A2F);
Color get greenA700 => const Color(0XFF13A445);
// Orange
Color get orange900 => const Color(0XFFD15C0B);
// Pink
Color get pink400 => const Color(0XFFD44164);
Color get red900 => const Color(0XFFAF000D);
// Yellow
Color get yellow600 => const Color(0XFFFFDA2B);
}