Bundle class
Wrapper for storing generic values based on keys. The contained values are all serializable using platform channels
Constructors
- Bundle()
- Creates an empty bundle
- Bundle.from(Object data)
-
Creates a bundle from the provided map. The map is assumed to be of type:
Map<Object?, Object?>
. See: asFlatStructure
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
asFlatStructure(
) → Map< Object?, Object?> - Serializes the bundle to a flat structure that is used by the restoration framework. See RestorationMixin
-
getBoolean(
String key) → bool - Force-gets the value for the given key, throws if null or wrong type
-
getBundle(
String key) → Bundle - Force-gets the value for the given key, throws if null or wrong type
-
getDouble(
String key) → double - Force-gets the value for the given key, throws if null or wrong type
-
getInt(
String key) → int - Force-gets the value for the given key, throws if null or wrong type
-
getString(
String key) → String - Force-gets the value for the given key, throws if null or wrong type
-
getStringList(
String key) → List< String> - Force-gets the value for the given key, throws if null or wrong type
-
hasKey(
String key) → bool - Checks if the bundle contains a value with the given key
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
optBoolean(
String key) → bool? - Gets the value for the given key, returns null if null or wrong type
-
optBundle(
String key) → Bundle? - Gets the value for the given key, returns null if null or wrong type
-
optDouble(
String key) → double? - Gets the value for the given key, returns null if null or wrong type
-
optInt(
String key) → int? - Gets the value for the given key, returns null if null or wrong type
-
optString(
String key) → String? - Gets the value for the given key, returns null if null or wrong type
-
optStringList(
String key) → List< String> ? - Gets the value for the given key, returns null if null or wrong type
-
putBoolean(
String key, bool? value) → void - Saves the given value to the map for the given key. If the value is null, the previous mapping is removed (if any)
-
putBundle(
String key, Bundle? bundle) → void - Saves the given value to the map for the given key. If the value is null, the previous mapping is removed (if any)
-
putDouble(
String key, double? value) → void - Saves the given value to the map for the given key. If the value is null, the previous mapping is removed (if any)
-
putInt(
String key, int? value) → void - Saves the given value to the map for the given key. If the value is null, the previous mapping is removed (if any)
-
putString(
String key, String? value) → void - Saves the given value to the map for the given key. If the value is null, the previous mapping is removed (if any)
-
putStringList(
String key, List< String> ? values) → void - Saves the given value to the map for the given key. If the value is null, the previous mapping is removed (if any)
-
remove(
String key) → void - Removes the mapping for the given key (if any)
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited