Comments (9)
Yep, Flutter and Web tests are coming for v1.0! I'm also going to create a more generic FileStorageEngine!
from flutter_redux.
Hey, way cool! Thanks for adding to the community :)
I like the direction of the library... glad you've made the base classes abstract, making it easy to plug in different storage options. Happy to link to the lib.
There are a couple things I noticed when I checked it out:
- You could have stronger type safety. I think you even have a few type errors, actually... I'd recommend adding an analysis_options.yaml to your projects like the following and fix the errors: https://github.com/brianegan/flutter_redux/blob/5f3c6ac7153b385c03d5e0a4cb0295daf9075516/analysis_options.yaml
- How would you feel about adding tests? I'd really like to ensure the packages we write for the community to are well tested so folks can feel comfortable relying on it! Examples of testing file storage: https://github.com/brianegan/flutter_architecture_samples/blob/master/example/todos_repository/test/file_storage_test.dart
- I feel like the Middleware should load the state from storage in response to an action (InitAppAction or something), rather than through an extra Widget. That would more closely follow the normal redux conventions, and you could trigger the load again if need be.
- Is there some error case? What if the data fails to load? Could you dispatch a LoadFailed action?
from flutter_redux.
-
I agree that I need to add some more type safety, however I'm fairly certain there's no errors, and I do have
analysis_options.yaml
. -
Tests are up next for v1.0.0! It's really important, and it's coming for sure!
-
I see what you mean here. It's probably a good idea to change the current LoadAction to RehydrateAction, and make the LoadAction be what requests the load. I'll look in implementing it in the next version.
-
Good point, I'll also add error handling for saves/loads, and an action to come with it.
Thank you very much for the feedback, as a new Dart/Flutter dev it helps to get guided a bit.
from flutter_redux.
@Cretezy Ah, I must have pulled down an older copy before ya added the analysis options!
One thing I'd recommend: Putting on not only strong mode, but the additional options you see linked in the sample above. It shows a few type errors, which will cause ya problems for Dart 2 support (learning that the hard way haha, thought strong mode was strong enough!).
Great work overall :) Thanks again!
from flutter_redux.
Alright I got all the type errors fixed up! I understand the errors better now, thank you!
I did almost all the changes you've recommended in v0.5.0 (Cretezy/redux_persist@6b305b0).
Next thing to tackle is tests, and migrations!
from flutter_redux.
Heck yah, nice work! Thanks for taking in the feedback and responding in such top form :)
Once you get those tests in place, hit me up and I'll pop a link in the readme!
from flutter_redux.
Added some tests!
from flutter_redux.
@Cretezy Cool, thanks for taking all the feedback and making such good improvements! I'll pop a link into the README :)
One more piece of feedback: It looks like the Flutter side could still use some tests as well!
We've recently added some recipes to the Flutter Cookbook that demonstrates how to test shared_preferences and file io if you want to try your hand at it:
https://flutter.io/cookbook/persistence/key-value/
https://flutter.io/cookbook/persistence/reading-writing-files/
from flutter_redux.
Pushed up an addition to the README. Thanks again for your contributions :D :D :D
from flutter_redux.
Related Issues (20)
- How to not accept change notifications when the Router is not at the top level, and then take the initiative to obtain the changes when the Router returns to the top level HOT 1
- onDidChange called twice HOT 8
- Is this package still actively maintained?
- `onWillChange` and `onDidChange` errors are swallowed HOT 4
- Warning related to `?` operator on Linux/Dev channel. HOT 2
- Import Store data type
- Widgets binding error after upgrading flutter version to 2.13.0-0.1.pre HOT 1
- onDidChange not working as expected HOT 3
- Build warning with Flutter 3.0 HOT 5
- flutter_redux depends on flutter_redux, version solving failed HOT 3
- onWillChange and onDidChange called twice after state update HOT 2
- Passing Store as an argument to MethodChannel and Background Isolate
- Question on how to use the reducer right way HOT 2
- [Question]: Any thoughts on difference between ignoreChange and distinct?
- Socket and Flutter_redux HOT 18
- Dispatching an action that does not alter state rerenders the widget, causing an infinite loop HOT 5
- How to watch redux store change inside useEffect? HOT 5
- [Question] is it expected that the store doesn't run until frames render? HOT 1
- After push a new page, and Dispatching an action, there is an infinite loop
- Is flutter redux actively maintained HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_redux.