Pratik Butani
Pratik Butani

Reputation: 62439

Flutter : CircularProgressIndicator keep in center inside Column

I am a newbie for Flutter Development, I have created a sample demo to get JSON from Server and Bind in ListView, I have done it successfully.

Now I want to show CircularProgressIndicator() in the center of the screen while loading the list.

I have tried many ways like Expanded, Flexible, Stack but didn't get succeed.

You can check the full code here: main.dart

Here is the screenshot.

enter image description here

Can anyone help me to keep CircularProgressIndicator in the center?

Upvotes: 1

Views: 164

Answers (2)

SLendeR
SLendeR

Reputation: 947

This is an alternative approach:

        Column(
          children: [
            TextField(), // Your text field.
            Spacer(),
            CircularProgressIndicator(),
            Spacer(),
          ],
        ),

Upvotes: 0

CopsOnRoad
CopsOnRoad

Reputation: 268244

Use this approach:

Column(
  children: [
    TextField(),  // Your text field. 
    Expanded(
      child: Center(
        child: CircularProgressIndicator(),
      ),
    ),
  ],
)

Upvotes: 2

Related Questions