Skip to content

Commit

Permalink
theme 調整
Browse files Browse the repository at this point in the history
  • Loading branch information
lllttt06 committed Mar 11, 2024
1 parent eca0d3f commit 649e1da
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 33 deletions.
65 changes: 34 additions & 31 deletions packages/app/lib/foundation/build_context_exe.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ extension BuildContextExt on BuildContext {

FlutterView get view => View.of(this);

ColorScheme get color => Theme.of(this).colorScheme;
ColorScheme get color => ColorScheme.fromSeed(
seedColor: Colors.green,
brightness: Theme.of(this).brightness,
);

TextTheme get text => Theme.of(this).textTheme;
}
Expand All @@ -46,153 +49,153 @@ extension TextStyleExt on TextStyle {

TextStyle get lightPrimary => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).primary,
);

TextStyle get lightOnPrimary => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).onPrimary,
color: ColorScheme.fromSeed(seedColor: Colors.green).onPrimary,
);

TextStyle get lightPrimaryContainer => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).primaryContainer,
color: ColorScheme.fromSeed(seedColor: Colors.green).primaryContainer,
);

TextStyle get lightOnPrimaryContainer => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).onPrimaryContainer,
);

TextStyle get lightSecondary => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).secondary,
);

TextStyle get lightOnSecondary => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).onSecondary,
color: ColorScheme.fromSeed(seedColor: Colors.green).onSecondary,
);

TextStyle get lightSecondaryContainer => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).secondaryContainer,
color: ColorScheme.fromSeed(seedColor: Colors.green).secondaryContainer,
);

TextStyle get lightOnSecondaryContainer => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).onSecondaryContainer,
);

TextStyle get lightTertiary => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).tertiary,
);

TextStyle get lightOnTertiary => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).onTertiary,
color: ColorScheme.fromSeed(seedColor: Colors.green).onTertiary,
);

TextStyle get lightTertiaryContainer => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).tertiaryContainer,
color: ColorScheme.fromSeed(seedColor: Colors.green).tertiaryContainer,
);

TextStyle get lightOnTertiaryContainer => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).onTertiaryContainer,
);

TextStyle get lightError => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).error,
);

TextStyle get lightOnError => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).onError,
color: ColorScheme.fromSeed(seedColor: Colors.green).onError,
);

TextStyle get lightErrorContainer => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).errorContainer,
color: ColorScheme.fromSeed(seedColor: Colors.green).errorContainer,
);

TextStyle get lightOnErrorContainer => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).onErrorContainer,
);

TextStyle get lightOutline => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).outline,
);

TextStyle get lightOutlineVariant => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).outlineVariant,
color: ColorScheme.fromSeed(seedColor: Colors.green).outlineVariant,
);

TextStyle get lightBackgroundContainer => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).background,
color: ColorScheme.fromSeed(seedColor: Colors.green).background,
);

TextStyle get lightOnBackground => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).onBackground,
);

TextStyle get lightSurface => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).surface,
);

TextStyle get lightOnSurface => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).onSurface,
color: ColorScheme.fromSeed(seedColor: Colors.green).onSurface,
);

TextStyle get lightSurfaceVariant => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).surfaceVariant,
color: ColorScheme.fromSeed(seedColor: Colors.green).surfaceVariant,
);

TextStyle get lightOnSurfaceVariant => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).onSurfaceVariant,
);

TextStyle get lightInverseSurface => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).inverseSurface,
);

TextStyle get lightOnInverseSurface => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).onInverseSurface,
color: ColorScheme.fromSeed(seedColor: Colors.green).onInverseSurface,
);

TextStyle get lightInversePrimary => copyWith(
color: ColorScheme.fromSeed(seedColor: Colors.blue).inversePrimary,
color: ColorScheme.fromSeed(seedColor: Colors.green).inversePrimary,
);

TextStyle get lightShadow => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).shadow,
);

TextStyle get lightScrim => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).scrim,
);

TextStyle get lightSurfaceTint => copyWith(
color: ColorScheme.fromSeed(
seedColor: Colors.blue,
seedColor: Colors.green,
).surfaceTint,
);
}
6 changes: 5 additions & 1 deletion packages/app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class MyApp extends HookConsumerWidget {

return MaterialApp.router(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
useMaterial3: true,
),
darkTheme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
useMaterial3: true,
),
supportedLocales: L10n.supportedLocales,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Widget Function(BuildContext) customSlideBuilder({
width: context.slideSize.width,
child: AutoSizeText(
title,
style: context.text.displayLarge?.bold,
style: context.text.displayLarge?.semiBold.copyWith(
color: context.color.primary,
),
),
),
),
Expand Down

0 comments on commit 649e1da

Please sign in to comment.