我尝试了这个,但是似乎不起作用:
new MaterialApp(
title: 'Mian',
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
const Locale('zh','HK')
],
我想将粘贴更改为粘贴,选择全部以选择全部
答案 0 :(得分:0)
flutter_localizations
添加到pubspec.yaml
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_localizations
导入main.dart
import 'package:flutter_localizations/flutter_localizations.dart';
supportedLocales
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter',
home: new HomePage(title: ''),
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
DefaultCupertinoLocalizations.delegate
],
supportedLocales: [
const Locale('zh','CH'),
],
);
}
}