useLinearProgress method

void useLinearProgress({
  1. Key? key,
  2. Color? backgroundColor,
  3. Color? color,
  4. Animation<Color?>? valueColor,
  5. double minHeight = 1,
  6. String? semanticsLabel,
  7. String? semanticsValue,
})

Implementation

void useLinearProgress({
  Key? key,
  Color? backgroundColor,
  Color? color,
  Animation<Color?>? valueColor,
  double minHeight = 1,
  String? semanticsLabel,
  String? semanticsValue,
}) =>
    loadingBuilder = (
      BuildContext context,
      Widget child,
      ImageChunkEvent? loadingProgress,
    ) {
      if (loadingProgress == null) return child;

      return LinearProgressIndicator(
        key: key,
        backgroundColor: backgroundColor,
        color: color,
        valueColor: valueColor,
        minHeight: minHeight,
        semanticsLabel: semanticsLabel,
        semanticsValue: semanticsValue,
        value: loadingProgress.expectedTotalBytes != null
            ? loadingProgress.cumulativeBytesLoaded /
                loadingProgress.expectedTotalBytes!
            : null,
      );
    };