getCircularProgressBar static method

Widget getCircularProgressBar({
  1. required BuildContext context,
  2. required double iosSize,
  3. required double androidSize,
  4. double strokeWidth = 4,
  5. AlwaysStoppedAnimation<Color>? color,
})

Implementation

static Widget getCircularProgressBar({required BuildContext context,
  required double iosSize,
  required double androidSize,
  double strokeWidth = 4,
  AlwaysStoppedAnimation<Color>? color}) {
  Widget progressBar;

  if (Platform.isIOS || Platform.isMacOS) {
    progressBar = SizedBox(
      width: iosSize,
      height: iosSize,
      child: CupertinoActivityIndicator(
        color: Theme
            .of(context)
            .progressIndicatorTheme
            .color,
      ),
    );
  } else {
    progressBar = SizedBox(
      width: androidSize,
      height: androidSize,
      child: CircularProgressIndicator(strokeWidth: strokeWidth, valueColor: color),
    );
  }

  return progressBar;
}