flutter TextField 弹出复制是英文的问题

1.在 pubspec.yaml 中集成 flutter_localizations;
dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
2.在 MaterialApp 中设置本地化代理和支持的语言类型;
return MaterialApp(
  localizationsDelegates: [
    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate,
  ],
  supportedLocales: [
    const Locale(‘zh‘, ‘CN‘),
    const Locale(‘en‘, ‘US‘),
  ]
}

  

猜你喜欢

转载自www.cnblogs.com/wupeng88/p/12722778.html
今日推荐