|
|
@@ -1,4 +1,3 @@
|
|
|
-import 'dart:io';
|
|
|
|
|
|
import 'package:atmob_channel_reader/atmob_channel_reader.dart';
|
|
|
import 'package:electronic_assistant/data/consts/build_config.dart';
|
|
|
@@ -15,6 +14,7 @@ import 'package:electronic_assistant/utils/mmkv_util.dart';
|
|
|
import 'package:electronic_assistant/utils/toast_util.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
|
|
+import 'package:flutter_localizations/flutter_localizations.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
@@ -141,10 +141,21 @@ class MyApp extends StatelessWidget {
|
|
|
navigatorObservers: [FlutterSmartDialog.observer],
|
|
|
builder: FlutterSmartDialog.init(),
|
|
|
translations: StringResource(),
|
|
|
+ localizationsDelegates: const [
|
|
|
+ GlobalMaterialLocalizations.delegate,
|
|
|
+ //是Flutter的一个本地化委托,用于提供Material组件库的本地化支持
|
|
|
+ GlobalWidgetsLocalizations.delegate,
|
|
|
+ //用于提供通用部件(Widgets)的本地化支持
|
|
|
+ GlobalCupertinoLocalizations.delegate,
|
|
|
+ //用于提供Cupertino风格的组件的本地化支持
|
|
|
+ ],
|
|
|
+ supportedLocales: const [
|
|
|
+ Locale('zh', 'CN'), // 支持的语言和地区
|
|
|
+ ],
|
|
|
// 你的翻译
|
|
|
locale: const Locale('zh', 'CN'),
|
|
|
- // 将会按照此处指定的语言翻译
|
|
|
- fallbackLocale: const Locale('zh', 'CN'), // 添加一个回调语言选项,以备上面指定的语言翻译不存在
|
|
|
+ // 将会按照此处指定的语言翻译 添加一个回调语言选项,以备上面指定的语言翻译不存在
|
|
|
+ fallbackLocale: const Locale('zh', 'CN'),
|
|
|
),
|
|
|
);
|
|
|
}
|