EasyFutureBuilder<T> constructor
const
EasyFutureBuilder<T> ({
- Key? key,
- required Future<
T> future, - required Widget dataBuilder(
- BuildContext context,
- T data
- String errorText = 'Oops, something went wrong.',
- IconData errorIcon = Icons.error_rounded,
- String isEmptyText = 'There is nothing to display.',
- IconData isEmptyIcon = Icons.close_rounded,
- TextStyle? textStyle,
- IconThemeData? iconStyle,
- Widget loadingIndicator = const CircularProgressIndicator(),
Creates an EasyFutureBuilder which is a wrapper around FutureBuilder that makes it easy to display the various states of fetching data asynchronous.
See the documentation page for more details.
Implementation
const EasyFutureBuilder({
super.key,
required this.future,
required this.dataBuilder,
this.errorText = 'Oops, something went wrong.',
this.errorIcon = Icons.error_rounded,
this.isEmptyText = 'There is nothing to display.',
this.isEmptyIcon = Icons.close_rounded,
this.textStyle,
this.iconStyle,
this.loadingIndicator = const CircularProgressIndicator(),
});