Last updated:
0 purchases
reload widget
A Flutter component that supports tapping Reload when fetching data fails.
Usage #
@override
Widget build(BuildContext context) {
return ReloadWidget(
(BuildContext builderContext) {
return Center(
child: Text(
'Data: $_data',
style: const TextStyle(
fontSize: 28,
fontWeight: FontWeight.w700,
color: Colors.green
)
)
);
},
onReload: () async {
// To simulate API calls
final Result result = await Api.call();
if (result.success) {
_data = result.data;
}
return result.success ? ReloadStatus.succeeded : ReloadStatus.timeout;
}
);
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.