我目前正在學習 Flutter,我對它很陌生。我想在點擊此文本時轉到另一個頁面,但是我的錯誤給了我這個錯誤。
return Expanded(
flex: 1,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
GestureDetector(
oneTap: () { // i got error here
Navigator.push(context, MaterialPageRoute(builder: (context) => SingUpPage()));
},
child: Text(
'Sing up',
style: GoogleFonts.openSans(
fontSize: 18,
fontWeight: FontWeight.w700,
decoration: TextDecoration.underline),
),
),
Text(
'Forgot Password',
style: GoogleFonts.openSans(
fontSize: 18,
fontWeight: FontWeight.w700,
decoration: TextDecoration.underline),
)
],
),
);
}
uj5u.com熱心網友回復:
您在 上打錯字/錯誤oneTap,請將其更改為onTap。
uj5u.com熱心網友回復:
你的意思是“onTap”而不是“oneTap”
onTap: () { // <--- this one
Navigator.push(context, MaterialPageRoute(builder: (context) => SingUpPage()));
}
uj5u.com熱心網友回復:
重命名onTap而不是oneTap
onTap: () { // here change needed
Navigator.push(context, MaterialPageRoute(builder: (context) => SingUpPage()));
},
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/375657.html
上一篇:如何將文本居中放置在容器中間?撲
下一篇:不執行顫振權限處理程式
