Modules
Defining a module
class CartModule extends Module {
@override
String get name => 'cart';
final Map<String, dynamic> state = {
'fetchingItems': false,
'items': [],
};
final List<Getter> getters = [
IsCartEmptyGetter(),
IsFetchingGetter(),
];
final List<Mutation> mutations = [
UpdateCartItemsMutation(),
UpdateFetchingStatusMutation(),
];
final List<Action> actions = [
FetchCartItemsAction(),
];
}Registering the module
Using features from the module
Last updated