Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', localizationsDelegates: const [ GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, S.delegate, ], supportedLocales: S.delegate.supportedLocales, localeListResolutionCallback: (locales, supportedLocales) { print('当前系统语言环境$locales'); return; }, onGenerateTitle: (context){ return S.of(context).title; }, theme: ThemeData( primarySwatch: Colors.blue, ), //home: MyHomePage(title: S.of(context).title), home: MyHomePage(title: S.current.title) ); }