![](/img/trans.png)
[英]How can I upgrade a "RaisedButton" to "ElevatedButton" in Flutter?
[英]How can I remove press animation of RaisedButton in Flutter?
嗨,我想刪除在 Flutter 中按下“RaisedButton”時出現的 Animation。
我該怎么做?
RaisedButton(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: EdgeInsets.all(0),
color: Colors.white,
elevation: 0,
onPressed: (){
Navigator.push(
context, // 기본 파라미터, SecondRoute로 전달
MaterialPageRoute(builder: (context)=>TotalNotification()) // SecondRoute를 생성하여 적재
);
},
child: SvgPicture.asset(
'assets/images/BellButton.svg',
width: screenWidth * 0.0777777777777778,
height: screenWidth * 0.0777777777777778,
),
),
我可以給你一個想法。
只需用Container
而不是RaisedButton
包裝它,並尋求GesureDetector
的幫助
GestureDetector(
onTap: () {
Navigator.push( context, MaterialPageRoute(builder: (context)=>TotalNotification()));
},
child: Container(
height: 50.0,
width: 50.0,
color: Colors.white,
child: SvgPicture.asset(
'assets/images/BellButton.svg',
width: screenWidth * 0.0777777777777778,
height: screenWidth * 0.0777777777777778,
),
),
),
希望這適合你的情況!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.