dyn topic fold

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-06 12:22:27 +08:00
parent 5e1c73abc1
commit aa03eed92d
13 changed files with 184 additions and 97 deletions

View File

@@ -0,0 +1,9 @@
import 'package:flutter/foundation.dart' show ValueGetter;
bool? safeToBool(dynamic value, [ValueGetter<String>? orString]) =>
switch (value) {
bool _ => value,
int _ => value == 1,
String _ => orString != null && value == orString(),
_ => null,
};