timeconsuming_page_builder 1.1.0 copy "timeconsuming_page_builder: ^1.1.0" to clipboard
timeconsuming_page_builder: ^1.1.0 copied to clipboard

A time-consuming flutter page builder.

timeconsuming_page_builder #

A time-consuming flutter page builder.

Sample #

Use dartrofit to request remote markdown resources, then display markdown on the page using Flutter Markdown.

import 'package:timeconsuming_page_builder/timeconsuming_page_builder.dart';

TimeConsumingPageBuilder<ResponseBody>(
    futureBuilder: () => Api(dartrofit).getContent(path),
    waitingWidgetBuilder: (BuildContext context) =>
        BuiltInWaitingWidget(progressIndicatorValueColor: (BuildContext context) => AlwaysStoppedAnimation(Colors.teal)),
    errorWidgetBuilder: (BuildContext context, RetryCaller caller) =>
        BuiltInErrorWidget(onRetryClick: caller),
    dataWidgetBuilder: (BuildContext context, ResponseBody body) {
      if (body.string.orEmpty().isEmpty) {
        return BuiltInEmptyWidget();
      }
      return SafeArea(
          child: Markdown(selectable: true, data: body.string));
    })

Parameters #

  • futureBuilder: A builder used to build Future.
  • waitingWidgetBuilder: A builder used to build waiting widget, e.g BuiltInWaitingWidget.
  • errorWidgetBuilder: A builder used to build error widget when error occurred, e.g BuiltInErrorWidget.
  • dataWidgetBuilder: A builder used to build data widget if has data, or build empty widget if no data (e.g BuiltInEmptyWidget).
0
likes
20
points
19
downloads

Publisher

verified publishernikeo.cn

Weekly Downloads

A time-consuming flutter page builder.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on timeconsuming_page_builder