1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import 'package:farmer_client/theme.dart';
  2. import 'package:farmer_client/utils/location.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:get/get.dart';
  5. import 'package:get_storage/get_storage.dart';
  6. import 'package:flutter_screenutil/flutter_screenutil.dart';
  7. import 'package:flutter_localizations/flutter_localizations.dart';
  8. import 'models/index.dart';
  9. import 'routes/index.dart';
  10. void main() async {
  11. await GetStorage.init();
  12. // // 高德地图隐私生命
  13. // showPrivacy();
  14. runApp(const MyApp());
  15. }
  16. class MyApp extends StatelessWidget {
  17. const MyApp({Key? key}) : super(key: key);
  18. // This widget is the root of your application.
  19. @override
  20. Widget build(BuildContext context) {
  21. return ScreenUtilInit(
  22. designSize: const Size(375, 812),
  23. minTextAdapt: true,
  24. splitScreenMode: true,
  25. builder: (_) {
  26. return GetMaterialApp(
  27. localizationsDelegates: const [
  28. GlobalMaterialLocalizations.delegate,
  29. GlobalWidgetsLocalizations.delegate,
  30. GlobalCupertinoLocalizations.delegate,
  31. ],
  32. supportedLocales: [
  33. Locale('zh', ''),
  34. Locale('en', ''),
  35. ],
  36. theme: getTheme(),
  37. initialRoute: '/',
  38. defaultTransition: Transition.native,
  39. routingCallback: routingCallback,
  40. initialBinding: AppBindings(),
  41. getPages: pages,
  42. );
  43. },
  44. );
  45. }
  46. }