import 'package:fengshui_compass/bottom_navigation_widget.dart';
import 'package:fengshui_compass/states/region.dart';
import 'package:fengshui_compass/states/token.dart';
import 'package:fengshui_compass/utils/color.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
// import '';

void main() {
  ///屏幕刷新率和显示率不一致时的优化
  // GestureBinding.instance.resamplingEnabled = true;
  runApp(
    MultiProvider(
      providers: [
        ChangeNotifierProvider(
          create: (context) => RegionProvider(),
        ),
        ChangeNotifierProvider(create: (context) => TokenProvider()),
      ],
      child: 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 MaterialApp(
      title: '风水罗盘',
      theme: ThemeData(
        primarySwatch: createMaterialColor(const Color(0xCFA77300)),
      ),
      debugShowCheckedModeBanner: false,
      home: const BottomNavigationWidget(),
      localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      supportedLocales: const [
        //此处
        Locale('zh'),
        Locale('en'),
      ],
    );
  }
}
