我想在“行”窗口小部件上显示完成的进度。 像这样:
(忽略箭头)。
当前,我在“行”下方添加了线性进度。像这样:
有什么办法可以实现? 这是我当前的代码:
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],
),
),
答案 0 :(得分:3)
您可以使用Stack完成此操作...
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),)
],
)
],
),
]
);