2025-08-28 11:27:32 +08:00
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
import 'package:starwork_flutter/i18n/app_i18n.dart';
|
|
|
|
|
import 'package:starwork_flutter/routes/app_routes.dart';
|
|
|
|
|
import 'package:starwork_flutter/routes/app_pages.dart';
|
|
|
|
|
|
|
|
|
|
import 'flavors.dart';
|
2025-08-28 14:07:49 +08:00
|
|
|
|
2025-08-28 11:27:32 +08:00
|
|
|
|
|
|
|
|
class App extends StatelessWidget {
|
|
|
|
|
const App({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return ScreenUtilInit(
|
|
|
|
|
designSize: const Size(360, 690),
|
|
|
|
|
minTextAdapt: true,
|
|
|
|
|
splitScreenMode: true,
|
|
|
|
|
builder: (_, child) {
|
|
|
|
|
return GetMaterialApp(
|
|
|
|
|
enableLog: true,
|
|
|
|
|
title: F.title,
|
|
|
|
|
translations: AppI18n(),
|
|
|
|
|
locale: const Locale('zh', 'CN'),
|
|
|
|
|
// 默认语言
|
|
|
|
|
fallbackLocale: const Locale('zh', 'CN'),
|
|
|
|
|
// 必须设置 fallback 没有该语言时使用
|
|
|
|
|
getPages: AppPages.pages,
|
|
|
|
|
initialRoute: AppRoutes.login,
|
|
|
|
|
// 默认首页
|
|
|
|
|
debugShowCheckedModeBanner: false,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|