Reputation: 256
I want to display the progress done on top of my Row widget. like this:
(ignore the arrow).
Currently, I have added linear progress below my Row. like this:
is there any way I can achieve this? This is my current code:
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Column(
children: <Widget>[
Text("Raised",style: TextStyle(fontSize: 18),),
SizedBox(height: 10,),
Text(raisedAmount.toString()+"₹",style: TextStyle(fontSize: 26,fontWeight: FontWeight.bold),)
],
),
Column(
children: <Widget>[
Text("Target",style: TextStyle(fontSize: 18),),
SizedBox(height: 10,),
Text(targetAmount.toString()+"₹",style: TextStyle(fontSize: 26,fontWeight: FontWeight.bold),)
],
)
],
),
LinearProgressIndicator(
value: progress,
backgroundColor: Colors.grey[200],
valueColor: AlwaysStoppedAnimation<Color>(
Colors.deepOrange[200],
),
),
Upvotes: 0
Views: 199
Reputation: 986
You can use Stack to accomplish this...
Stack(
children:[
LinearProgressIndicator(minHeight: 60,
value: progress,
backgroundColor: Colors.grey[200],
valueColor: AlwaysStoppedAnimation<Color>(
Colors.deepOrange[200],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Column(
children: <Widget>[
Text("Raised",style: TextStyle(fontSize: 18),),
SizedBox(height: 10,),
Text(raisedAmount.toString()+"₹",style: TextStyle(fontSize: 26,fontWeight: FontWeight.bold),)
],
),
Column(
children: <Widget>[
Text("Target",style: TextStyle(fontSize: 18),),
SizedBox(height: 10,),
Text(targetAmount.toString()+"₹",style: TextStyle(fontSize: 26,fontWeight: FontWeight.bold),)
],
)
],
),
]
);
Upvotes: 2