boolean function
Normalizes a SQLite boolean value.
- When
isIntis true,intOrBoolis expected to be0/1and a correspondingboolis returned. - When
isIntis false,intOrBoolis returned as is. nullis passed through.
Implementation
dynamic boolean(dynamic intOrBool, {bool isInt = true}) {
if (intOrBool == null) return null;
if (isInt) return (intOrBool as num) > 0;
return intOrBool as bool;
}