QParams class
The params for the route
Constructors
-
QParams({Map<
String, ParamValue> ? params})
Properties
-
asMap
→ Map<
String, ParamValue> -
get the params as map
no setter
-
asValueMap
→ Map<
String, dynamic> -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether there is no params.
no setter
- isNotEmpty → bool
-
Whether there is at least one param.
no setter
-
keys
→ List<
String> -
get the params keys
no setter
- length → int
-
params count
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addAll(
Map< String, dynamic> other) → void - Add params
-
addAsHidden(
String key, Object value, {int cleanUpAfter = 1}) → void -
Add a param without showing it in the path, as default this param will
be automatically deleted after one page navigation, to change this,
change the
cleanUpAfter
value to keep it from more navigation times -
asStringMap(
) → Map< String, String> - Get the params as Map<String,String>
-
clear(
) → void - remove all params
-
copyWith(
) → QParams -
ensureExist(
String name, {Object? initValue, int? cleanupAfter, bool keepAlive = false, ParamChanged? onChange, dynamic onDelete()?}) → void -
See if a parameter is Exist, if not create it with this
initValue
. if you setkeepAlive
to true then the package will not remove this param or you can setcleanupAfter
so the package will clean up this param after X callas, where x is the number you set incleanupAfter
. to set a function to be called when this param is changed setonChange
function it gives the current value and the new value and to set a function to be called when this param is deleted useonDelete
-
isSame(
QParams other) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateParam(
String name, Object value, {int? cleanupAfter, bool keepAlive = false, ParamChanged? onChange, dynamic onDelete()?}) → void -
updateParams(
QParams newParams) → void - add new params when path updates
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String key) → ParamValue? - Get param from key
-
operator []=(
String key, Object value) → void - set new param