@@ -38,14 +38,15 @@ class _RootCategoryViewPageState extends State<RootCategoryViewPage> with Single
3838 super .initState ();
3939 _rootCategory = "0" ;
4040 _searchController.addListener (() {
41- _getData ();
4241 setState (() {
4342 _isSearching = _searchController.text.length > 0 ;
43+ _getData ();
4444 });
4545 });
4646 WidgetsBinding .instance.addPostFrameCallback ((_) {
4747 API .uploader = Uploader (context);
4848 });
49+ _getData ();
4950 }
5051 @override
5152 void dispose () {
@@ -89,9 +90,11 @@ class _RootCategoryViewPageState extends State<RootCategoryViewPage> with Single
8990 body: Builder (builder: (context) {
9091 if (_isSearching) {
9192 return FutureBuilder <Map <String ,dynamic >>(
92- future: _imagesFuture, // Albums of the list
93+ key: UniqueKey (),
94+ future: _imagesFuture,
9395 builder: (BuildContext context, AsyncSnapshot imagesSnapshot) {
9496 if (imagesSnapshot.hasData){
97+ print ("Images: ${imagesSnapshot .data }" );
9598 if (imagesSnapshot.data['stat' ] == 'fail' ) {
9699 return Center (
97100 child: Text (appStrings (context).categoryImageList_noDataError),
@@ -134,9 +137,11 @@ class _RootCategoryViewPageState extends State<RootCategoryViewPage> with Single
134137 );
135138 }
136139 return FutureBuilder <Map <String ,dynamic >>(
140+ key: UniqueKey (),
137141 future: _albumsFuture, // Albums of the list
138142 builder: (BuildContext context, AsyncSnapshot albumSnapshot) {
139143 if (albumSnapshot.hasData){
144+ //print(albumSnapshot.data);
140145 if (albumSnapshot.data['stat' ] == 'fail' ) {
141146 return Container (
142147 padding: EdgeInsets .all (10 ),
@@ -147,7 +152,7 @@ class _RootCategoryViewPageState extends State<RootCategoryViewPage> with Single
147152 int nbPhotos = 0 ;
148153 albums.forEach ((cat) => nbPhotos+= cat["total_nb_images" ]);
149154 albums.removeWhere ((category) => (
150- category["id" ].toString () == _rootCategory
155+ category["id" ].toString () == _rootCategory
151156 ));
152157 return RefreshIndicator (
153158 displacement: 20 ,
@@ -279,5 +284,4 @@ class _RootCategoryViewPageState extends State<RootCategoryViewPage> with Single
279284 },
280285 );
281286 }
282-
283287}
0 commit comments