1.按钮禁止重复点击
给响应函数加个判断,点击无效时为null。
onPressed: () {
if (_isTesting == 0) {
_testStatus = 0;
_isTesting = 1;
getHttp();
} else {
null;
}
2.特殊图标
引入库
font_awesome_flutter: ">=8.10.0"
导入使用
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
IconButton(
// Use the FaIcon Widget + FontAwesomeIcons class for the IconData
icon: FaIcon(FontAwesomeIcons.mailBulk),
onPressed: () { print("Pressed"); }
)
网友评论