buildLoadingStyle method

Widget? buildLoadingStyle(
  1. LoadingStyle? style
)

Implementation

Widget? buildLoadingStyle(LoadingStyle? style) {
  final List<Widget> children = [];
  switch (style) {
    case LoadingStyle.circular:
      children.add(CircularProgressIndicator(
          value: value,
          backgroundColor: backgroundColor,
          valueColor: valueColor,
          strokeWidth: strokeWidth,
          semanticsLabel: semanticsLabel,
          semanticsValue: semanticsValue));
      break;
    case LoadingStyle.linear:
      children.add(LinearProgressIndicator(
          value: value,
          backgroundColor: backgroundColor,
          valueColor: valueColor,
          semanticsLabel: semanticsLabel,
          semanticsValue: semanticsValue));
      break;
    case LoadingStyle.refresh:
      children.add(RefreshProgressIndicator(
          value: value,
          backgroundColor: backgroundColor,
          valueColor: valueColor,
          strokeWidth: strokeWidth,
          semanticsLabel: semanticsLabel,
          semanticsValue: semanticsValue));
      break;
    default:
      return null;
  }
  if (extra != null) children.add(extra!);

  return Universal(
      padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
      decoration: BoxDecoration(
          color: backgroundColor, borderRadius: BorderRadius.circular(8.0)),
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      crossAxisAlignment: CrossAxisAlignment.center,
      mainAxisSize: MainAxisSize.min,
      children: children);
}