AmDataProvider<T> class Null safety

A data provider accessed in the whole program if it's created with id. You can access its data by AmDataProvider<T>.of("providerId").data

Constructors

AmDataProvider({T? initialData, String? providerId})
Creates a provider. You may initialize its data or leave it null. If you want to access this provider in other pages you should create it with Id.
factory
AmDataProvider.of(String providerId)
Returns a provider by it's id. The provider must be initialized first otherwise it returns a new provider with no id.
factory

Properties

activeFunction ← void Function()
Receives a function that instantinously called then (RefreshWidget)s related to this provider are refreshed.
write-only
data ↔ T?
Changes the provider data then (RefreshWidget)s related to this provider are refreshed.
read / write
initialize → void
you need to use this getter if you want to access the provider with its id at first time.
read-only
providerId String?
To get the provider id.
final
silentDataSet ← T?
Changes the provider data only (No RefreshWidget is refreshed).
write-only

Methods

refresh() → void
Refreshes all (RefreshWidget)s related to this provider.