gpt4 book ai didi

flutter - 有什么方法可以在现有小部件上显示LinearProgress?

转载 作者:行者123 更新时间:2023-12-03 04:13:26 26 4
gpt4 key购买 nike

我想在“行”窗口小部件上显示完成的进度。
像这样:
enter image description here
(忽略箭头)。
目前,我在“行”下方添加了线性进度。像这样:
enter image description here
有什么办法可以做到这一点?
这是我当前的代码:

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],
),
),

最佳答案

您可以使用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),)
],
)
],
),
]
);

关于flutter - 有什么方法可以在现有小部件上显示LinearProgress?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63066825/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com