fish-redux
fish-redux copied to clipboard
Action dispatch from subpage
trafficstars
My greetings.
I have an actions in my main app page:
import 'package:fish_redux/fish_redux.dart';
enum Actions{ changeIndex, changeAppBarState, toggleDrawerPermission }
class ActionsCreate{
static Action changeIndex(int value) => Action(Actions.changeIndex, payload: value);
static Action changeAppBarState() => Action(Actions.changeAppBarState);
static Action toggleDrawerPermission() => Action(Actions.toggleDrawerPermission);
}
In my subpage i need to dispatch toggleDrawerPermission of my main page, but can't do it because my subpage has its own actions:
import 'package:fish_redux/fish_redux.dart';
enum Actions{ getCategories, loadCategories }
class ActionsCreate{
static Action getCategories() => Action(Actions.getCategories);
static Action loadCategories(List<CategoryResultResponse> results) => Action(Actions.loadCategories, payload: results);
}
How can i dispatch action of my main page from my subpage? Thank you.