Ankit Kumar Saini
Ankit Kumar Saini

Reputation: 43

I wants to show the custom progress dialog (similar to iOS default dialog) in flutter

Currently I'm using the default flutter dialog

Scaffold(
        appBar: AppBar(
          backgroundColor: Color(0xFFB50208),
          title: const Text('Progressbar'),
        ),
        body: Center(
          child: CircularProgressIndicator(),
        )
    )

But below is the image what I need to implement

enter image description here

Upvotes: 1

Views: 3198

Answers (1)

Augustin R
Augustin R

Reputation: 7819

You should use CupertinoActivityIndicator.

First import Cupertino Widgets :

import 'package:flutter/cupertino.dart';

Then you can use this :

showDialog(
    context: context,
    builder: (context) => Center(
      child: Container(
        width: 60.0,
        height: 60.0,
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(4.0),
        ),
        child: Padding(
          padding: const EdgeInsets.all(12.0),
          child: CupertinoActivityIndicator(),
        ),
      ),
    ),
  );
);

To dismiss, use Navigator.pop(context);.

Upvotes: 5

Related Questions