【flutter】flutter 切换语言报错

class MyHomePage extends StatefulWidget {
_MyHomePageState createState() => new _MyHomePageState();
}
bool sign=true;
class _MyHomePageState extends State<MyHomePage>{
@override
Widget build(BuildContext context){

return new Scaffold(

appBar: new AppBar(

title: new Text(Translations.of(context).text('app_title')), // 试着使用下翻译库

),

body: new GestureDetector(

child:new Container(

child: new Text(Translations.of(context).text('main_title'),style: new TextStyle(fontSize: 17,color: Colors.black),)

),

onTap: (){

sign=!sign;

setState(() {

applic.onLocaleChanged(new Locale(sign?'fr':'en'));

});

},

),

);

}
【flutter】flutter 切换语言报错
【flutter】flutter 切换语言报错
【flutter】flutter 切换语言报错
【flutter】flutter 切换语言报错
【flutter】flutter 切换语言报错

这是什么问题啊,刚学flutter,求教,谢谢

回答

以上是 【flutter】flutter 切换语言报错 的全部内容, 来源链接: utcz.com/a/85487.html

回到顶部