| 123456789101112131415161718192021222324252627282930313233 |
- import 'package:electronic_assistant/resource/string_source.dart';
- import 'package:electronic_assistant/router/app_pages.dart';
- import 'package:electronic_assistant/router/route_path.dart';
- import 'package:flutter/material.dart';
- import 'package:get/get_navigation/src/root/get_material_app.dart';
- void main() {
- runApp(const MyApp());
- }
- class MyApp extends StatelessWidget {
- const MyApp({super.key});
- // This widget is the root of your application.
- @override
- Widget build(BuildContext context) {
- return GetMaterialApp(
- title: 'Flutter Demo',
- getPages: AppPage.pages,
- initialBinding: AppPage.binding,
- initialRoute: RoutePath.splash,
- theme: ThemeData(
- colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
- useMaterial3: true,
- ),
- translations: StringResource(),
- // 你的翻译
- locale: const Locale('zh', 'CN'),
- // 将会按照此处指定的语言翻译
- fallbackLocale: const Locale('zh', 'CN'), // 添加一个回调语言选项,以备上面指定的语言翻译不存在
- );
- }
- }
|