components/u_async library

Classes

UAsyncBuilder<T>
Loads data once and shows loading / error+retry / empty / data by itself. UAsyncBuilder<List<User>>(load: api.users, builder: (context, users) => UserList(users))
UAsyncBuilderState<T>
State of UAsyncBuilder; reach it with a GlobalKey to call reload(). key.currentState?.reload()
UOfflineBanner
Shows a slim "No internet" bar above child while offline. UOfflineBanner(child: HomePage())
UOnlineBuilder
Rebuilds with the online/offline state. UOnlineBuilder(builder: (context, online) => online ? Feed() : OfflinePage())
UPaginatedList<T>
Infinite-scroll list: loads page 1, then the next page near the end, with pull-to-refresh. UPaginatedList<Post>(fetch: (page) => api.posts(page), itemBuilder: (c, p, i) => PostTile(p))
UPaginatedListState<T>
State of UPaginatedList; reach it with a GlobalKey to call refresh(). key.currentState?.refresh()
UStreamView<T>
Listens to a stream and shows loading / error / data. UStreamView<int>(stream: counter, builder: (context, v) => Text("$v"))