main.dart 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import 'package:farmer_client/theme.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:get/get.dart';
  4. import 'package:get_storage/get_storage.dart';
  5. import 'package:flutter_screenutil/flutter_screenutil.dart';
  6. import 'models/index.dart';
  7. import 'routes/index.dart';
  8. void main() async {
  9. await GetStorage.init();
  10. runApp(const MyApp());
  11. }
  12. class MyApp extends StatelessWidget {
  13. const MyApp({Key? key}) : super(key: key);
  14. // This widget is the root of your application.
  15. @override
  16. Widget build(BuildContext context) {
  17. GetStorage box = GetStorage();
  18. return ScreenUtilInit(
  19. designSize: const Size(375, 812),
  20. minTextAdapt: true,
  21. splitScreenMode: true,
  22. builder: (_) {
  23. return GetMaterialApp(
  24. theme: getTheme(),
  25. initialRoute: '/splash',
  26. defaultTransition: Transition.native,
  27. routingCallback: routingCallback,
  28. initialBinding: AppBindings(),
  29. getPages: pages,
  30. );
  31. },
  32. );
  33. }
  34. }