EasyStreamBuilder<T> constructor

const EasyStreamBuilder<T>({
  1. Key? key,
  2. required Stream<T> stream,
  3. required Widget dataBuilder(
    1. BuildContext context,
    2. T data
    ),
  4. String errorText = 'Oops, something went wrong.',
  5. IconData errorIcon = Icons.error_rounded,
  6. String isEmptyText = 'There is nothing to display.',
  7. IconData isEmptyIcon = Icons.close_rounded,
  8. TextStyle? textStyle,
  9. IconThemeData? iconStyle,
  10. Widget loadingIndicator = const CircularProgressIndicator(),
})

Creates an EasyStreamBuilder which is a wrapper around StreamBuilder that makes it easy to display the various states of streaming data.

See the documentation page for more details.

Implementation

const EasyStreamBuilder({
  super.key,
  required this.stream,
  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(),
});