【发布时间】:2019-08-11 21:34:23
【问题描述】:
同时多次点击按钮,多次打开页面。如何解决这个问题?我还在我的应用程序上上传了 gif 文件(双击图片)。
Container(
padding: EdgeInsets.all(10.0),
child: ButtonTheme(
minWidth: 10.0,
height: 40.0,
child: RaisedButton(
child: Text(
AppTranslations.of(context)
.text("loginpage_button"),
style: TextStyle(
color: Colors.white, fontSize: 15.0),
),
onPressed: () async{
(isOffline)
? _showSnackBar()
: checking2(usernameController, context, _url);
},
color: Colors.blue,
padding: EdgeInsets.all(20.0),
),
),
margin: EdgeInsets.only(top: 0.0),
)
我使用了这个代码,它可以工作,但是用户输入的用户名不正确,用户不能点击第二个类型的按钮。这是我的代码。
onPressed: () async {
if (_firstClick) {
_firstClick = false;
(isOffline)
? _showSnackBar()
: checking2(usernameController, context, _url);
}
【问题讨论】: