ObjectExtension extension

on

Properties

isEmptyValue bool

Available on Object?, provided by the ObjectExtension extension

Returns true if value is empty (null, empty string, empty map or list)
no setter
isNotEmptyValue bool

Available on Object?, provided by the ObjectExtension extension

Returns true if value is not empty
no setter

Methods

toBool({bool def = false}) bool

Available on Object?, provided by the ObjectExtension extension

Try to parse to bool, fallback to def
toDateTime({DateTime? fallback}) DateTime?

Available on Object?, provided by the ObjectExtension extension

Try to parse to DateTime, fallback to null or fallback
toDouble({double def = 0}) double

Available on Object?, provided by the ObjectExtension extension

Try to parse to double, fallback to def
toInt({int def = 0}) int

Available on Object?, provided by the ObjectExtension extension

Try to parse to int, fallback to def
toList() List?

Available on Object?, provided by the ObjectExtension extension

Cast to List if possible
toMap() Map<String, dynamic>?

Available on Object?, provided by the ObjectExtension extension

Cast to Map<String, dynamic> if possible
toNum({num def = 0}) num

Available on Object?, provided by the ObjectExtension extension

Try to parse to num, fallback to def
toStr({String def = ''}) String

Available on Object?, provided by the ObjectExtension extension