buildPage static method
Implementation
static Widget buildPage(BuildContext context, Future<PageData> data) {
return FutureBuilder(
builder: (context, snapshot) {
if (snapshot.hasData) {
PageData page = snapshot.data as PageData;
return ListView.builder(
itemBuilder: (context, index) {
return _buildCardView(context, page, index);
},
itemCount: page.cardList!.length,
);
} else if (snapshot.hasError) {
return Center(
child: Text("Some error occurs!"),
);
}
return CircularProgressIndicator();
},
future: data,
);
}