Skip to content

Commit 7ff5287

Browse files
committed
Fix lints
1 parent 51ee5b8 commit 7ff5287

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/src/api/typed_value.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ extension ObjectExt on Object? {
1414
if (value is R) return value;
1515

1616
return switch (R) {
17-
String =>
17+
const (String) =>
1818
(value is List || value is Map ? jsonEncode(value) : value.toString())
1919
.tryCast<R>() ??
2020
defaultValue,
21-
int => value.toInt().tryCast<R>() ?? defaultValue,
22-
double => value.toDouble().tryCast<R>() ?? defaultValue,
23-
num => value.toNum().tryCast<R>() ?? defaultValue,
24-
bool => value.toBool().tryCast<R>() ?? defaultValue,
25-
ColorRGBA => value.toColorRGBA().tryCast<R>() ?? defaultValue,
26-
ColorRGB => ColorRGB.fromColorRGBA(value.toColorRGBA()).tryCast<R>() ??
21+
const (int) => value.toInt().tryCast<R>() ?? defaultValue,
22+
const (double) => value.toDouble().tryCast<R>() ?? defaultValue,
23+
const (num) => value.toNum().tryCast<R>() ?? defaultValue,
24+
const (bool) => value.toBool().tryCast<R>() ?? defaultValue,
25+
const (ColorRGBA) => value.toColorRGBA().tryCast<R>() ?? defaultValue,
26+
const (ColorRGB) => ColorRGB.fromColorRGBA(value.toColorRGBA()).tryCast<R>() ??
2727
defaultValue,
28-
PaintModel => value.toColorRGBA()?.toPaint().tryCast<R>() ?? defaultValue,
28+
const (PaintModel) => value.toColorRGBA()?.toPaint().tryCast<R>() ?? defaultValue,
2929
_ when R.isMap => value.toMap().tryCast<R>(),
3030
_ when R.isList || R.isIterable => value.toList<R>(),
3131
_ when R.isSet => value.toSet<R>(),

0 commit comments

Comments
 (0)