Nuvigator.of => Should be used when its certain that the Nuvigator is available
Nuvigator.maybeOf => The existence of the Nuvigator is not required, and null return type is accepted.
Change from Map<String, Object>? initialArguments to Map<String, dynamic>? initialArguments as internally there is a cast to Map<String, dynamic>, it makes more sense.
Splits the
nullOk
logic in two:Nuvigator.of
=> Should be used when its certain that the Nuvigator is availableNuvigator.maybeOf
=> The existence of the Nuvigator is not required, andnull
return type is accepted.Change from
Map<String, Object>? initialArguments
toMap<String, dynamic>? initialArguments
as internally there is a cast toMap<String, dynamic>
, it makes more sense.