当前位置:网站首页>Five ways to deal with the state of the flutter

Five ways to deal with the state of the flutter

2020-11-30 00:26:55 InfoQ

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":" This article was originally published in poetryincode.dev Website , Authorized by the original author InfoQ Translate and share ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Click on "},{"type":"link","attrs":{"href":"https:\/\/github.com\/chimon2000\/flutter_state_five_ways","title":"xxx","type":null},"content":[{"type":"text","text":" here "}]},{"type":"text","text":" Check out the code for the example in this article ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Whether you're just beginning to understand Flutter, Or have you contacted Flutter For a while , You may already know that there are many ways to handle application state . I'm sure , Every month, new ways come out . Because there are not many examples that can be directly compared , So it can be difficult to understand the differences and trade-offs between these approaches ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" In my submission , The best way to learn how to use a library is to use it to build projects . The best way to compare two libraries is to use them to perform the same task : Build the same function , In order to better understand the trade-offs between each other ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" In this paper , I'm going to use the same application as the foundation , Made by some of my favorite authors 5 Databases , Use the same pattern to implement shared state . Some of these libraries are very popular , Some are rare , Some are very new , Some are relatively old ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"numberedlist","attrs":{"start":1,"normalizeStart":1},"content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":1,"align":null,"origin":null},"content":[{"type":"text","text":"Riverpod( with StateNotifier)"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":2,"align":null,"origin":null},"content":[{"type":"text","text":"Bloc"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":3,"align":null,"origin":null},"content":[{"type":"text","text":"flutter_command"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":4,"align":null,"origin":null},"content":[{"type":"text","text":"MobX"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":5,"align":null,"origin":null},"content":[{"type":"text","text":"binder"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" I'll try to find out the differences between the Libraries , And make a summary of each method . In order to demonstrate the API, We're going to implement a note taking app , It will display an input field to create a new note , It also displays a list of created notes . You can "},{"type":"link","attrs":{"href":"https:\/\/flutter-state.codemagic.app\/","title":"xxx","type":null},"content":[{"type":"text","text":" here "}]},{"type":"text","text":" Watch the demo ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://chowdera.com/2020/11/20201130002450073w.html