flutter_redux_boilerplate
flutter_redux_boilerplate copied to clipboard
Issues with latest redux and flutter persist packages
Firstly I really like your folder structure.
I am trying to update this with the latest redux and redux persist and think there are some breaking changes including the line below where it does not recognise PersistLoadedAction:
https://github.com/FranPitri/flutter_redux_boilerplate/blob/master/lib/reducers/app_reducer.dart#L8
I also had to swap out decoder with serializer in the Persistor definition.
Do you have a branch of this project using the latest versions and if not do you know how to correct the above issue?
Thanks in advance Nathan
Hi @FranPitri @nathandaly , I'm having the same issue. Here is the error:
[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: StorageException: load: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.
If you're running an application and need to access the binary messenger before runApp() has been called (for example, during plugin initialization), then you need to explicitly call the WidgetsFlutterBinding.ensureInitialized() first.
If you're running a test, you can call the TestWidgetsFlutterBinding.ensureInitialized() as the first line in your test's main() method to initialize the binding.
#0 Persistor.load (package:redux_persist/redux_persist.dart:117:7)
Can you do something or guide us to the solution please?
Thanks
Pierre
Same problem since I updated flutter:
I/flutter ( 6035): Failed to load initial data: StorageException: On load: ServicesBinding.defaultBinaryMessenger was accessed before the binding was
initialized.
I/flutter ( 6035): If you're running an application and need to access the binary messenger before `runApp()` has been called (for example, during plugin initialization), then you need to explicitly call the `WidgetsFlutterBinding.ensureInitialized()` first.
I/flutter ( 6035): If you're running a test, you can call the `TestWidgetsFlutterBinding.ensureInitialized()` as the first line in your test's `main()` method to initialize the binding.
E/flutter ( 6035): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'dispatch' was called on null.
E/flutter ( 6035): Receiver: null
E/flutter ( 6035): Tried calling: dispatch(Instance of 'AddErrorAction')
E/flutter ( 6035): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
E/flutter ( 6035): #1 main (package:ng_sales_rep_app/main.dart:20:14)
E/flutter ( 6035): <asynchronous suspension>
E/flutter ( 6035): #2 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:239:25)
E/flutter ( 6035): #3 _rootRun (dart:async/zone.dart:1126:13)
E/flutter ( 6035): #4 _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter ( 6035): #5 _runZoned (dart:async/zone.dart:1518:10)
E/flutter ( 6035): #6 runZoned (dart:async/zone.dart:1502:12)
E/flutter ( 6035): #7 _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:231:5)
E/flutter ( 6035): #8 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307:19)
E/flutter ( 6035): #9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)