Skip to content

Commit 3a3c811

Browse files
committed
nit
2 parents 7efe9ae + 7fc463b commit 3a3c811

File tree

7 files changed

+339
-194
lines changed

7 files changed

+339
-194
lines changed

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
97C146E61CF9000F007C117D /* Project object */ = {
168168
isa = PBXProject;
169169
attributes = {
170-
LastUpgradeCheck = 1430;
170+
LastUpgradeCheck = 1510;
171171
ORGANIZATIONNAME = "";
172172
TargetAttributes = {
173173
97C146ED1CF9000F007C117D = {

lib/injection/dependencies.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class DependencyManager {
77
injector.registerLazySingleton<AppFlavor>(() => flavor);
88
// ignore: unnecessary_lambdas
99
injector.registerLazySingleton<AppRouter>(() => AppRouter());
10-
1110
configureDependencies();
1211
}
1312
}

lib/presentation/resources/app_colors.dart

Lines changed: 22 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_template/presentation/resources/app_color_palette.dart';
3+
import 'package:theme_tailor_annotation/theme_tailor_annotation.dart';
34

4-
class AppColors extends ThemeExtension<AppColors> {
5+
part 'app_colors.tailor.dart';
6+
7+
@TailorMixin()
8+
class AppColors extends ThemeExtension<AppColors> with _$AppColorsTailorMixin {
59
static Color get black => AppColorPalette.black;
610
static Color get white => AppColorPalette.white;
711

@@ -26,24 +30,41 @@ class AppColors extends ThemeExtension<AppColors> {
2630
});
2731

2832
// Core colors
33+
@override
2934
final Color primary;
35+
@override
3036
final Color primaryVariant;
37+
@override
3138
final Color secondary;
39+
@override
3240
final Color secondaryVariant;
41+
@override
3342
final Color background;
43+
@override
3444
final Color appBarBackground;
45+
@override
3546
final Color danger;
47+
@override
3648
final Color foregroundOnBackground;
49+
@override
3750
final Color foregroundLightOnBackground;
51+
@override
3852
final Color foregroundOnPrimary;
53+
@override
3954
final Color foregroundOnSecondary;
55+
@override
4056
final Color foregroundOnAppBar;
57+
@override
4158
final Color foregroundOnDanger;
59+
@override
4260
final Color outline;
61+
@override
4362
final Color transparant;
4463

4564
// Other colors
65+
@override
4666
final Color splashColor;
67+
@override
4768
final Color disabledColor;
4869

4970
factory AppColors.fromBrightness(Brightness brightness) =>
@@ -95,148 +116,6 @@ class AppColors extends ThemeExtension<AppColors> {
95116
disabledColor: AppColorPalette.silverPolish,
96117
);
97118
}
98-
99-
@override
100-
ThemeExtension<AppColors> copyWith({
101-
Color? primary,
102-
Color? primaryVariant,
103-
Color? secondary,
104-
Color? secondaryVariant,
105-
Color? background,
106-
Color? appBarBackground,
107-
Color? danger,
108-
Color? foregroundOnBackground,
109-
Color? foregroundLightOnBackground,
110-
Color? foregroundOnPrimary,
111-
Color? foregroundOnSecondary,
112-
Color? foregroundOnAppBar,
113-
Color? foregroundOnDanger,
114-
Color? transparant,
115-
Color? outline,
116-
Color? splashColor,
117-
Color? disabledColor,
118-
}) {
119-
return AppColors(
120-
primary: primary ?? this.primary,
121-
primaryVariant: primaryVariant ?? this.primaryVariant,
122-
secondary: secondary ?? this.secondary,
123-
secondaryVariant: secondaryVariant ?? this.secondaryVariant,
124-
background: background ?? this.background,
125-
appBarBackground: appBarBackground ?? this.appBarBackground,
126-
danger: danger ?? this.danger,
127-
foregroundOnBackground:
128-
foregroundOnBackground ?? this.foregroundOnBackground,
129-
foregroundLightOnBackground:
130-
foregroundLightOnBackground ?? this.foregroundLightOnBackground,
131-
foregroundOnPrimary: foregroundOnPrimary ?? this.foregroundOnPrimary,
132-
foregroundOnSecondary:
133-
foregroundOnSecondary ?? this.foregroundOnSecondary,
134-
foregroundOnAppBar: foregroundOnAppBar ?? this.foregroundOnAppBar,
135-
foregroundOnDanger: foregroundOnDanger ?? this.foregroundOnDanger,
136-
outline: outline ?? this.outline,
137-
transparant: transparant ?? this.transparant,
138-
splashColor: splashColor ?? this.splashColor,
139-
disabledColor: disabledColor ?? this.disabledColor,
140-
);
141-
}
142-
143-
@override
144-
ThemeExtension<AppColors> lerp(
145-
covariant ThemeExtension<AppColors>? other,
146-
double t,
147-
) {
148-
if (other is! AppColors) {
149-
return this;
150-
}
151-
152-
return AppColors(
153-
primary: Color.lerp(
154-
primary,
155-
other.primary,
156-
t,
157-
)!,
158-
primaryVariant: Color.lerp(
159-
primaryVariant,
160-
other.primaryVariant,
161-
t,
162-
)!,
163-
secondary: Color.lerp(
164-
secondary,
165-
other.secondary,
166-
t,
167-
)!,
168-
secondaryVariant: Color.lerp(
169-
secondaryVariant,
170-
other.secondaryVariant,
171-
t,
172-
)!,
173-
background: Color.lerp(
174-
background,
175-
other.background,
176-
t,
177-
)!,
178-
appBarBackground: Color.lerp(
179-
appBarBackground,
180-
other.appBarBackground,
181-
t,
182-
)!,
183-
danger: Color.lerp(
184-
danger,
185-
other.danger,
186-
t,
187-
)!,
188-
foregroundOnBackground: Color.lerp(
189-
foregroundOnBackground,
190-
other.foregroundOnBackground,
191-
t,
192-
)!,
193-
foregroundLightOnBackground: Color.lerp(
194-
foregroundLightOnBackground,
195-
other.foregroundLightOnBackground,
196-
t,
197-
)!,
198-
foregroundOnPrimary: Color.lerp(
199-
foregroundOnPrimary,
200-
other.foregroundOnPrimary,
201-
t,
202-
)!,
203-
foregroundOnSecondary: Color.lerp(
204-
foregroundOnSecondary,
205-
other.foregroundOnSecondary,
206-
t,
207-
)!,
208-
foregroundOnAppBar: Color.lerp(
209-
foregroundOnAppBar,
210-
other.foregroundOnAppBar,
211-
t,
212-
)!,
213-
foregroundOnDanger: Color.lerp(
214-
foregroundOnDanger,
215-
other.foregroundOnDanger,
216-
t,
217-
)!,
218-
outline: Color.lerp(
219-
outline,
220-
other.outline,
221-
t,
222-
)!,
223-
transparant: Color.lerp(
224-
transparant,
225-
other.transparant,
226-
t,
227-
)!,
228-
splashColor: Color.lerp(
229-
splashColor,
230-
other.splashColor,
231-
t,
232-
)!,
233-
disabledColor: Color.lerp(
234-
disabledColor,
235-
other.disabledColor,
236-
t,
237-
)!,
238-
);
239-
}
240119
}
241120

242121
extension AppColorsExtension on BuildContext {

0 commit comments

Comments
 (0)