flutter-redux

How to pass parameters to action in Flutter

久未见 提交于 2021-01-28 09:50:39
问题 I have this action Future<void> signUpAction(Store<AppState> store) async { try { // ... } catch (e) { // .. } } And I dispatch it like this store.dispatch(signUpAction); Now, if I want to pass two paramters, how would I do that? Since there is already one parameter there. I tried this Future<void> signUpAction(Store<AppState> store, email, password) async { try { // ... } catch (e) { // .. } } but then on dispatching, if I do store.dispatch(signUpAction("some@email.com", "somEPa55word!"));

Making Private Route in Flutter

人盡茶涼 提交于 2021-01-03 07:09:53
问题 How can I make a wrapper over my private routes, which navigate to screen only when user is authorized, otherwise redirect to login and get back to the original screen after login. How can make this in a generalized way, so that I just reuse it on my other Private future screens? 回答1: If you are using routes parameter in your MaterialApp , you can replace it with following implementation import 'dart:collection'; import 'package:flutter/widgets.dart'; class ConditionalRouter extends MapMixin

Making Private Route in Flutter

隐身守侯 提交于 2021-01-03 07:06:50
问题 How can I make a wrapper over my private routes, which navigate to screen only when user is authorized, otherwise redirect to login and get back to the original screen after login. How can make this in a generalized way, so that I just reuse it on my other Private future screens? 回答1: If you are using routes parameter in your MaterialApp , you can replace it with following implementation import 'dart:collection'; import 'package:flutter/widgets.dart'; class ConditionalRouter extends MapMixin

Making Private Route in Flutter

匆匆过客 提交于 2021-01-03 07:05:28
问题 How can I make a wrapper over my private routes, which navigate to screen only when user is authorized, otherwise redirect to login and get back to the original screen after login. How can make this in a generalized way, so that I just reuse it on my other Private future screens? 回答1: If you are using routes parameter in your MaterialApp , you can replace it with following implementation import 'dart:collection'; import 'package:flutter/widgets.dart'; class ConditionalRouter extends MapMixin