Used to process network requests FutureBuilder
import 'dart:convert';
Widget build(BuildContext context) {
return FutureBuilder(
future: httpReq.get(sevicePath['homeArticle']+'${widget.id}'),
builder: (context,snapshot){
if (snapshot.hasData){
var data = jsonDecode(snapshot.data.toString());
datas = (data['data'] as List).cast();
return SingleChildScrollView(
child: _cellList(),
);
}else{
return Center(
child: Text('加载中...'),
);
}
},
);
}