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