有什么方法可以在现有小部件之上显示 LinearProgress?
Is there any way i can display LinearProgress on top of existing widgets?
我想在我的“行”小部件上显示完成的进度。
像这样:
(忽略箭头)。
目前,我在我的行下方添加了线性进度。像这样:
有什么办法可以做到这一点吗?
这是我当前的代码:
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),)
],
)
],
),
]
);
我想在我的“行”小部件上显示完成的进度。 像这样:
(忽略箭头)。
目前,我在我的行下方添加了线性进度。像这样:
有什么办法可以做到这一点吗? 这是我当前的代码:
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),)
],
)
],
),
]
);