circularProgressIndicator static method

OctoProgressIndicatorBuilder circularProgressIndicator()

Default CircularProgressIndicator with progress if available.

Implementation

static OctoProgressIndicatorBuilder circularProgressIndicator() {
  return (context, progress) {
    double? value;
    if (progress != null && progress.expectedTotalBytes != null) {
      value = progress.cumulativeBytesLoaded / progress.expectedTotalBytes!;
    }
    return Center(child: CircularProgressIndicator(value: value));
  };
}