master #81

Closed
malo wants to merge 322 commits from master into feat/bloc_layout/new-package
Showing only changes of commit f6c16c5dc4 - Show all commits

View File

@ -23,24 +23,20 @@ class MultiColor {
final List<Color>? _colors; final List<Color>? _colors;
final Color? _color; final Color? _color;
Color get color { Color get color => _color != null
if (_color != null) { ? _color!
return _color!; : _colors?.isNotEmpty ?? false
} ? _colors!.first
if (_colors?.isNotEmpty ?? false) { : throw IndexError.withLength(
return _colors!.first;
}
throw IndexError.withLength(
0, 0,
_colors?.length ?? 0, _colors?.length ?? 0,
message: '_color is not defined or _colors is empty.', message: '_color is not defined or _colors is empty.',
); );
}
List<Color> get colors => _colors ?? []; List<Color> get colors => _colors ?? [];
bool get isGradient => bool get isGradient => (_colors?.length ?? 0) > 1;
(_colors?.isNotEmpty ?? false) && (_colors?.length ?? 0) > 1; bool get isColor => _color != null || isGradient;
static MultiColor? lerp(MultiColor? a, MultiColor? b, double t) { static MultiColor? lerp(MultiColor? a, MultiColor? b, double t) {
if (a == null && b == null) { if (a == null && b == null) {