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(); 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, builder: EasyLoading.init( builder: (_, childSecond) => FTheme( data: themeData, child: childSecond!, ), ), ); }); }, ); } }