showIndicator function

Future<void> showIndicator(
  1. BuildContext context,
  2. List<FutureOr<void> Function()> processes, {
  3. Color? barrierColor = Colors.black54,
  4. Widget? indicator,
})

Executes multiple processes and displays an indicator during each one.

Used when multiple Future runs are to be executed in parallel and an indicator is to be displayed between them.

It is possible to change the color of the entire screen by specifying barrierColor.

The indicator can be changed by specifying indicator.

By default, CircularProgressIndicator is used.

複数のprocessesを実行しその間インジケーターを表示します。

複数のFutureを並列で実行しその間にインジケーターを表示する場合に利用します。

barrierColorを指定して画面全体の色を変更することが可能です。

indicatorを指定するとインジケーターを変更することが可能です。

デフォルトだとCircularProgressIndicatorが利用されます。

Implementation

Future<void> showIndicator(
  BuildContext context,
  List<FutureOr<void> Function()> processes, {
  Color? barrierColor = Colors.black54,
  Widget? indicator,
}) async {
  await wait(processes.map((e) => e.call())).showIndicator(
    context,
    barrierColor: barrierColor,
    indicator: indicator,
  );
}