Files
pj_supermarket_cloud/lib/app.dart
T
dzc 096b247fdd feat:超市默认使用键盘输入
feat:appbar组件
feat:修改设置mq消息
2025-04-02 16:09:10 +08:00

67 lines
2.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:forui/forui.dart';
import 'package:get/get.dart';
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
import 'package:pj_supermarket_cloud/common/index.dart';
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return ScreenUtilInit(
designSize: const Size(1920, 1080),
minTextAdapt: true,
splitScreenMode: true,
builder: (_, child) {
return Obx(() {
final appTheme = Get.find<AppThemeControl>();
final fTheme = appTheme.theme.value;
final sizeScalar = appTheme.sizeScalar.value;
final themeData = FThemeData.inherit(
colorScheme: fTheme.colorScheme,
typography: fTheme.typography.scale(sizeScalar: sizeScalar),
style: fTheme.style.copyWith(
borderRadius: BorderRadius.all(
Radius.circular(12.w),
),
borderWidth: 1,
iconStyle: fTheme.style.iconStyle.copyWith(
size: fTheme.typography.xl2.fontSize,
),
pagePadding: EdgeInsets.symmetric(vertical: 5.h, horizontal: 1.w),
),
);
return GetMaterialApp(
title: '收银机',
theme: ThemeData(
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: Colors.transparent,
),
),
defaultTransition: Transition.noTransition,
initialRoute: RouteNames.load,
getPages: RoutePages.list,
enableLog: true,
debugShowCheckedModeBanner: false,
locale: const Locale('zh', 'CN'),
localizationsDelegates: FLocalizations.localizationsDelegates,
supportedLocales: FLocalizations.supportedLocales,
navigatorObservers: [
GlobalRouteObserver(),
],
builder: EasyLoading.init(
builder: (_, childSecond) => FTheme(
data: themeData,
child: childSecond!,
),
),
);
});
},
);
}
}