Flutter 如何在按下提升按钮时调用多个反应/操作
按下登录按钮时,我尝试运行两个功能,但不起作用 我正在使用MobX,下面是我的代码:Flutter 如何在按下提升按钮时调用多个反应/操作,flutter,dart,mobx,Flutter,Dart,Mobx,按下登录按钮时,我尝试运行两个功能,但不起作用 我正在使用MobX,下面是我的代码: Observer(builder: (_) { return ElevatedButton( onPressed: dadosLogin.apertouLogin as void Function()?,
Observer(builder: (_) {
return ElevatedButton(
onPressed:
dadosLogin.apertouLogin as void Function()?,
child: dadosLogin.carregando
? SizedBox(
height: altura / 40,
width: largura / 20,
child: CircularProgressIndicator(
strokeWidth: largura / 200,
valueColor: AlwaysStoppedAnimation(
Color(0xFFFFFFFF),
),
),
)
: Text(
"LOGIN",
style: TextStyle(),
),
);
使用此代码,我只运行以下命令:
@computed
Function? get apertouLogin =>
(loginOK && !carregando && senhaOK) ? logando : null;
但是,我需要这个
@computed
Function? get puxandoLogin => (!carregando) ? puxando : null;
这:
不起作用对不起,我忘了告诉你这个方法不起作用
onPressed: () {
functionOne as void Function();
functionTwo as void Function();
}
onPressed: () {
functionOne as void Function();
functionTwo as void Function();
}