Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix CircularProgressIndicator() size in toolbar

I am trying to set fixed size CircularProgressIndicator in toolbar actions[] but it is giving me the inappropriate size, the code I am using,

Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text(Lang.postDetails),
        actions: <Widget>[
       Container(

                  width: 16,
                  height: 16,
                  child: CircularProgressIndicator(),
                )

and output I am getting,

enter image description here

like image 235
Ravinder Kumar Avatar asked Nov 25 '19 10:11

Ravinder Kumar


1 Answers

I have solved this myself, If anyone faces this issue just wrap your Container inside a Center widget,

Center(
       child: Container(
       width: 16,
       height: 16,
       child: CircularProgressIndicator()),
       )

Output

enter image description here

like image 140
Ravinder Kumar Avatar answered Nov 15 '22 09:11

Ravinder Kumar