getFutureBuilder function

dynamic getFutureBuilder(
  1. dynamic uiProps,
  2. dynamic getItems,
  3. dynamic isDailog
)

Implementation

getFutureBuilder(uiProps, getItems, isDailog) {
  return FutureBuilder(
    future: getItems(),
    builder: (c, snapshot) {
      if (snapshot.hasData) {
        try {
          List items = snapshot.data as List;
          return ItemsListView(
              data: items, maxRows: 10, isDialog: isDailog, uiProps: uiProps);
        } catch (e) {
          return Center(
              child: Text(
            "error",
            style: TextStyle(color: Colors.red),
          ));
        }
      } else {
        return Column(
          children: [
            getContainer(),
            getContainer(),
            getContainer(),
          ],
        );
      }
    },
  );
}