loadingBuilder static method

Widget loadingBuilder(
  1. BuildContext context,
  2. Widget child,
  3. ImageChunkEvent? loadingProgress,
  4. double size,
)

Implementation

static Widget loadingBuilder(
  BuildContext context,
  Widget child,
  ImageChunkEvent? loadingProgress,
  double size,
) {
  if (loadingProgress == null) {
    return child;
  }
  if (loadingProgress.expectedTotalBytes ==
      loadingProgress.cumulativeBytesLoaded) {
    return child;
  } else {
    return SizedBox(
      width: size,
      height: size,
      child: const CircularProgressIndicator(),
    );
  }
}