import 'package:flutter/material.dart';
import 'package:fooddeliveryapp/model/tableDetail.dart';
import 'package:fooddeliveryapp/pages/cart.dart';
import 'package:fooddeliveryapp/pages/check_out.dart';
import 'package:fooddeliveryapp/pages/login_page.dart';
import 'package:fooddeliveryapp/pages/table.dart';
import 'package:provider/provider.dart';

import 'model/table.dart';
import 'model/user.dart';
import 'pages/Staff.dart';
import 'pages/welcome_page.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    // var cart = OrderCart;
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(
          create: (context) => UserStatus(),
        ),
        ChangeNotifierProvider(
          create: (context) => TableStatusList(),
        ),
        ChangeNotifierProvider(
          create: (context) => TableDetail(),
        )
      ],
      child: MaterialApp(
        routes: {
          //登录页面
          LoginPage.routeName: (context) => LoginPage(),
          //登录后的首页
          WelcomePage.routeName: (context) => WelcomePage(),
          //订单页面
          // OrderPage.routeName: (context) => OrderPage(),
          //员工信息页面
          StaffInfoPage.routeName: (context) => StaffInfoPage(),
          //开台页面
          TablePage.routeName: (context) => TablePage(),
          //购物车页面
          OrderCart.routeName: (context) => OrderCart(),
          //结账页面
          CheckOut.routeName: (context) => CheckOut()
        },
        debugShowCheckedModeBanner: false,
        title: '点餐App',
        theme: ThemeData(
          primarySwatch: Colors.red,
        ),
      ),
    );
  }
}
