// GlowWheels Login and Orders Screen UI

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:glowwheels/models/shop_model.dart';
import 'package:glowwheels/provider/order_provider.dart';
import 'package:glowwheels/provider/serviceboy_provider.dart';
import 'package:glowwheels/provider/shop_profile_provider.dart';
import 'package:glowwheels/provider/shop_provider.dart';
import 'package:glowwheels/screens/splash_screen.dart';

import 'package:google_fonts/google_fonts.dart';
import 'package:hive_flutter/adapters.dart';
import 'package:provider/provider.dart';
void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Hive.initFlutter();
  Hive.registerAdapter(ShopModelAdapter());
  Hive.registerAdapter(ShopDetailsAdapter());

  if (!Hive.isBoxOpen('shopbox')) {
    await Hive.openBox<ShopModel>('shopbox');
  }


  runApp(
    MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (_) => OrdersProvider()),
        ChangeNotifierProvider(create: (_) => ServiceBoyProvider()),
        ChangeNotifierProvider(create: (_) => ShopProvider()),
        ChangeNotifierProvider(create: (_) => ShopProfileProvider()),
      ],
      child: GlowWheelsApp(),
    ),
  );
}

class GlowWheelsApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: SplashDecider(),
    );
  }
}






