颤振滑块按钮0.4.0崩溃

时间:2020-01-05 05:18:16

标签: flutter

今天,我决定浏览Flutter pubspec.yaml并更新软件包。我当前的slider_button版本是0.0.32,可以正常运行,并且代码取自this tutorial

我注意到该软件包的版本现在为0.4.0 here,因此我将pubspec.yaml版本更新为0.4.0。现在,无论何时使用它,action:都可以正常运行,然后我的应用程序崩溃,调试控制台中没有任何错误。如果我改回0.0.32版本,则可以正常工作。

我正在这样使用它:

Center(        
  child: SliderButton(
  action: () {_startHappyHour(context, _user);},
  label: Text(_user.turnOnString, style: TextStyle(color: Color(0xff4a4a4a), fontWeight: FontWeight.w500, fontSize: 17),),      
  icon: Center(child: Icon(FontAwesomeIcons.beer, color: Colors.white, size: 40.0,)),         
  buttonColor: Colors.blue,
  backgroundColor: Colors.green,
  baseColor: Colors.amber,         
 ),
),

0 个答案:

没有答案