mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-17 13:40:20 -04:00
checkpoint
This commit is contained in:
parent
c516323e7d
commit
31f562119a
70 changed files with 1174 additions and 817 deletions
53
lib/theme/models/scale_scheme.dart
Normal file
53
lib/theme/models/scale_scheme.dart
Normal file
|
@ -0,0 +1,53 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'scale_color.dart';
|
||||
|
||||
class ScaleScheme extends ThemeExtension<ScaleScheme> {
|
||||
ScaleScheme(
|
||||
{required this.primaryScale,
|
||||
required this.primaryAlphaScale,
|
||||
required this.secondaryScale,
|
||||
required this.tertiaryScale,
|
||||
required this.grayScale,
|
||||
required this.errorScale});
|
||||
|
||||
final ScaleColor primaryScale;
|
||||
final ScaleColor primaryAlphaScale;
|
||||
final ScaleColor secondaryScale;
|
||||
final ScaleColor tertiaryScale;
|
||||
final ScaleColor grayScale;
|
||||
final ScaleColor errorScale;
|
||||
|
||||
@override
|
||||
ScaleScheme copyWith(
|
||||
{ScaleColor? primaryScale,
|
||||
ScaleColor? primaryAlphaScale,
|
||||
ScaleColor? secondaryScale,
|
||||
ScaleColor? tertiaryScale,
|
||||
ScaleColor? grayScale,
|
||||
ScaleColor? errorScale}) =>
|
||||
ScaleScheme(
|
||||
primaryScale: primaryScale ?? this.primaryScale,
|
||||
primaryAlphaScale: primaryAlphaScale ?? this.primaryAlphaScale,
|
||||
secondaryScale: secondaryScale ?? this.secondaryScale,
|
||||
tertiaryScale: tertiaryScale ?? this.tertiaryScale,
|
||||
grayScale: grayScale ?? this.grayScale,
|
||||
errorScale: errorScale ?? this.errorScale,
|
||||
);
|
||||
|
||||
@override
|
||||
ScaleScheme lerp(ScaleScheme? other, double t) {
|
||||
if (other is! ScaleScheme) {
|
||||
return this;
|
||||
}
|
||||
return ScaleScheme(
|
||||
primaryScale: ScaleColor.lerp(primaryScale, other.primaryScale, t),
|
||||
primaryAlphaScale:
|
||||
ScaleColor.lerp(primaryAlphaScale, other.primaryAlphaScale, t),
|
||||
secondaryScale: ScaleColor.lerp(secondaryScale, other.secondaryScale, t),
|
||||
tertiaryScale: ScaleColor.lerp(tertiaryScale, other.tertiaryScale, t),
|
||||
grayScale: ScaleColor.lerp(grayScale, other.grayScale, t),
|
||||
errorScale: ScaleColor.lerp(errorScale, other.errorScale, t),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue