v as a bool, or null.
v
bool? readBool(Object? v) => switch (v) { final bool b => b, 'true' => true, 'false' => false, _ => null, };