fish-redux icon indicating copy to clipboard operation
fish-redux copied to clipboard

Action dispatch from subpage

Open Time2HackJS opened this issue 5 years ago • 0 comments
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.

Time2HackJS avatar Jun 17 '20 15:06 Time2HackJS