reload method

Future<void> reload({
  1. bool listen = false,
})

Call this to reload the data.

For example used when doing pull to refresh

Implementation

Future<void> reload({
  bool listen = false,
}) {
  return ApptiveGrid.getClient(context, listen: listen)
      .loadGrid(
        uri: widget.uri,
        sorting: widget.sorting,
        filter: widget.filter,
      )
      .then(
        (value) => setState(() {
          _snapshot = AsyncSnapshot.withData(ConnectionState.done, value);
        }),
      )
      .catchError(
        (error) => setState(() {
          _snapshot = AsyncSnapshot.withError(ConnectionState.none, error);
        }),
      );
}