Open sumitrvi opened 4 years ago
Inside the futurebuilder it's not working.when i'trying with futurebuilder after getting response inside the connectionState.done again call future method again and again. Code:- return FutureBuilder( future: Connection.getinterestApi(), builder: (context, snapshot) { switch (snapshot.connectionState) { case ConnectionState.none: // TODO: Handle this case. break; case ConnectionState.waiting: return Center( child: new CircularProgressIndicator( strokeWidth: 2.0, ), ); break; case ConnectionState.active: // TODO: Handle this case. break; case ConnectionState.done:/ /if (snapshot.hasError) { return Center(child: new Text('Server error !')); } else if (snapshot.data.data.length == 0) { return Center( child: new Text( 'No record found', style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), )); } else {/ return Container( height: constraints.maxHeight 0.85, padding: EdgeInsets.only(bottom: 20.0), child: /ListView(shrinkWrap: true, children: [/ Tags( key: _tagStateKey, itemCount: interestList.length, alignment: WrapAlignment.start, columns: 3, spacing: 12.0, runSpacing: 12.0, itemBuilder: (int index) { return ItemTags( active: false, elevation: 1.0, borderRadius: BorderRadius.circular(5.0), border: Border.all(color: Colors.transparent), index: index, textStyle: TextStyle(fontSize: 16.0), // req activeColor: CustomColors.primaryColor, color: CustomColors.tagdefault_Color, key: Key(DateTime.now().toIso8601String()), title: 'hello'); }, ) ]) ); } break; } } );
Inside the futurebuilder it's not working.when i'trying with futurebuilder after getting response inside the connectionState.done again call future method again and again. Code:- return FutureBuilder( future: Connection.getinterestApi(), builder: (context, snapshot) { switch (snapshot.connectionState) { case ConnectionState.none: // TODO: Handle this case. break; case ConnectionState.waiting: return Center( child: new CircularProgressIndicator( strokeWidth: 2.0, ), ); break; case ConnectionState.active: // TODO: Handle this case. break; case ConnectionState.done:/ /if (snapshot.hasError) { return Center(child: new Text('Server error !')); } else if (snapshot.data.data.length == 0) { return Center( child: new Text( 'No record found', style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), )); } else {/ return Container( height: constraints.maxHeight 0.85, padding: EdgeInsets.only(bottom: 20.0), child: /ListView(shrinkWrap: true, children:[ /
Tags(
key: _tagStateKey,
itemCount: interestList.length,
alignment: WrapAlignment.start,
columns: 3,
spacing: 12.0,
runSpacing: 12.0,
itemBuilder: (int index) {
return ItemTags(
active: false,
elevation: 1.0,
borderRadius: BorderRadius.circular(5.0),
border: Border.all(color: Colors.transparent),
index: index,
textStyle: TextStyle(fontSize: 16.0),
// req
activeColor: CustomColors.primaryColor,
color: CustomColors.tagdefault_Color,
key: Key(DateTime.now().toIso8601String()),
title: 'hello');
},
)
])
);
}
break;
}
}
);