|
@@ -1,7 +1,7 @@
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
@immutable
|
|
@immutable
|
|
-class CustomColors extends ThemeExtension<CustomColors> {
|
|
|
|
|
|
+class AFThemeExtension extends ThemeExtension<AFThemeExtension> {
|
|
final Color? warning;
|
|
final Color? warning;
|
|
final Color? success;
|
|
final Color? success;
|
|
|
|
|
|
@@ -20,51 +20,67 @@ class CustomColors extends ThemeExtension<CustomColors> {
|
|
final Color lightGreyHover;
|
|
final Color lightGreyHover;
|
|
final Color toggleOffFill;
|
|
final Color toggleOffFill;
|
|
|
|
|
|
- const CustomColors({
|
|
|
|
|
|
+ final TextStyle code;
|
|
|
|
+ final TextStyle callout;
|
|
|
|
+ final TextStyle caption;
|
|
|
|
+
|
|
|
|
+ const AFThemeExtension({
|
|
required this.warning,
|
|
required this.warning,
|
|
required this.success,
|
|
required this.success,
|
|
required this.greyHover,
|
|
required this.greyHover,
|
|
required this.greySelect,
|
|
required this.greySelect,
|
|
required this.lightGreyHover,
|
|
required this.lightGreyHover,
|
|
required this.toggleOffFill,
|
|
required this.toggleOffFill,
|
|
|
|
+ required this.code,
|
|
|
|
+ required this.callout,
|
|
|
|
+ required this.caption,
|
|
});
|
|
});
|
|
|
|
|
|
- static CustomColors of(BuildContext context) {
|
|
|
|
- return Theme.of(context).extension<CustomColors>()!;
|
|
|
|
|
|
+ static AFThemeExtension of(BuildContext context) {
|
|
|
|
+ return Theme.of(context).extension<AFThemeExtension>()!;
|
|
}
|
|
}
|
|
|
|
|
|
@override
|
|
@override
|
|
- CustomColors copyWith({
|
|
|
|
|
|
+ AFThemeExtension copyWith({
|
|
Color? warning,
|
|
Color? warning,
|
|
Color? success,
|
|
Color? success,
|
|
Color? greyHover,
|
|
Color? greyHover,
|
|
Color? greySelect,
|
|
Color? greySelect,
|
|
Color? lightGreyHover,
|
|
Color? lightGreyHover,
|
|
Color? toggleOffFill,
|
|
Color? toggleOffFill,
|
|
|
|
+ TextStyle? code,
|
|
|
|
+ TextStyle? callout,
|
|
|
|
+ TextStyle? caption,
|
|
}) {
|
|
}) {
|
|
- return CustomColors(
|
|
|
|
|
|
+ return AFThemeExtension(
|
|
warning: warning ?? this.warning,
|
|
warning: warning ?? this.warning,
|
|
success: success ?? this.success,
|
|
success: success ?? this.success,
|
|
greyHover: greyHover ?? this.greyHover,
|
|
greyHover: greyHover ?? this.greyHover,
|
|
greySelect: greySelect ?? this.greySelect,
|
|
greySelect: greySelect ?? this.greySelect,
|
|
lightGreyHover: lightGreyHover ?? this.lightGreyHover,
|
|
lightGreyHover: lightGreyHover ?? this.lightGreyHover,
|
|
toggleOffFill: toggleOffFill ?? this.toggleOffFill,
|
|
toggleOffFill: toggleOffFill ?? this.toggleOffFill,
|
|
|
|
+ code: code ?? this.code,
|
|
|
|
+ callout: callout ?? this.callout,
|
|
|
|
+ caption: caption ?? this.caption,
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
@override
|
|
@override
|
|
- ThemeExtension<CustomColors> lerp(
|
|
|
|
- ThemeExtension<CustomColors>? other, double t) {
|
|
|
|
- if (other is! CustomColors) {
|
|
|
|
|
|
+ ThemeExtension<AFThemeExtension> lerp(
|
|
|
|
+ ThemeExtension<AFThemeExtension>? other, double t) {
|
|
|
|
+ if (other is! AFThemeExtension) {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
- return CustomColors(
|
|
|
|
|
|
+ return AFThemeExtension(
|
|
warning: Color.lerp(warning, other.warning, t),
|
|
warning: Color.lerp(warning, other.warning, t),
|
|
success: Color.lerp(success, other.success, t),
|
|
success: Color.lerp(success, other.success, t),
|
|
greyHover: Color.lerp(greyHover, other.greyHover, t)!,
|
|
greyHover: Color.lerp(greyHover, other.greyHover, t)!,
|
|
greySelect: Color.lerp(greySelect, other.greySelect, t)!,
|
|
greySelect: Color.lerp(greySelect, other.greySelect, t)!,
|
|
lightGreyHover: Color.lerp(lightGreyHover, other.lightGreyHover, t)!,
|
|
lightGreyHover: Color.lerp(lightGreyHover, other.lightGreyHover, t)!,
|
|
toggleOffFill: Color.lerp(toggleOffFill, other.toggleOffFill, t)!,
|
|
toggleOffFill: Color.lerp(toggleOffFill, other.toggleOffFill, t)!,
|
|
|
|
+ code: other.code,
|
|
|
|
+ callout: other.callout,
|
|
|
|
+ caption: other.caption,
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|