import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:worker_client/routes/pages.dart';
import 'package:worker_client/theme.dart';

import 'models/index.dart';
import 'routes/middleWares.dart';

void main() async{
  await GetStorage.init();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
      designSize: const Size(375, 812),
      minTextAdapt: true,
      splitScreenMode: true,
      builder: (_) {
        return GetMaterialApp(
          initialRoute: '/',
          theme: getTheme(),
          defaultTransition: Transition.native,
          routingCallback: routingCallback,
          initialBinding: AppBindings(),
          getPages: pages,
        );
      },
    );
  }
}
