build method
Implementation
@override
Widget build(BuildContext context) {
return FutureBuilder<T>(
future: loadData(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return loading();
} else if (snapshot.hasError) {
return error(snapshot.error.toString());
} else if (!snapshot.hasData) {
return empty();
}
return buildData(context, snapshot.data as T);
},
);
}