Open Trung15010802 opened 1 month ago
What do you suggest ?
Hey @salim-lachdhaf There is probably a nice pattern to follow, check the gif on main page of https://pub.dev/packages/infinite_scroll_pagination
When there is an error during fetching the data the list is being replaced by the error message widget.
There is also a retry
callback being passed to error widget so user could build the error widget with refresh button.
You can spot one of those examples on gif (at the very bottom)
In addition to error refresh - the pull to refresh mechanism for the list view would be a nice addition
What do you suggest ?
I want a way to trigger items
function again in errorBuilder
This is my temporary solution: errorBuilder: (context, searchEntry, exception) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
textAlign: TextAlign.center,
LocKeys.someErrorOccur.tr(context: context),
style: TextStyle(color: appColors.webTextColor),
),
if (widget.onRefreshError != null)
Padding(
padding: const EdgeInsets.all(8.0),
child: CommonButtonWidget(
callBack: () async {
_searchController.text = '###';
widget.onRefreshError!().whenComplete(
() => _searchController.text = originalText,
);
},
label: LocKeys.refresh.tr(context: context),
icon: const Icon(
Icons.refresh,
),
),
),
],
);
}
Is your feature request related to a problem? Please describe. Add a feature to refresh data when error.
Describe the solution you'd like Using search box isn't a good way