问题描述
我使用 MobX,这是我的代码:
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();
}