New post on /r/flutterdev subreddit:
Need help : Managing complex structure/state in flutter app
Hi Friends,I am very new to flutter and just started a side project to improve my flutter knowledge and got problem in the beginning itself.I have complex and dynamic data to be displayed and manipulated on flutter app. Please advise me how to proceed this.I have a list view and three add buttons(+) which will dynamically add items into that list view.add button 1 --> it will add a list item widget which has one text fieldadd button 2 --> it will add a list item widget which has two text fieldsadd button 3 --> it will add a list item widget which will have one more list view like recursive.Below is the data structure
abstract class maintype {}
class type1 extends maintype{String s1;}
class type2 extends maintype {String s1;String s2;}
class type3 extends maintype {List<maintype> sublist; //this list can have type1, type2, type3}The screen will have list view which will be
List<maintype>, whenever a add button is press based on the button type the class will be created type1 or type2 or type3 and added into the main list.For type3, one more listview added with again three add buttons inside the current list view, then user can add items inside that listview also.What kind of state management I have to use? How to architect/structure my flutter app?I am open for any library and suggestions.Thanks in advance.
May 01, 2020 at 05:22PM by veerammalkumaran
https://ift.tt/35lFLEg