123456789101112131415161718192021222324252627282930313233343536 |
- import 'dart:io';
- import 'package:canteen/pages/home_page.dart';
- import 'package:flutter/material.dart';
- import 'package:canteen/model/themes.dart';
- import 'package:flutter/services.dart';
- void main() {
- WidgetsFlutterBinding.ensureInitialized();
- // 竖屏
- SystemChrome.setPreferredOrientations([
- DeviceOrientation.portraitUp,
- DeviceOrientation.portraitDown,
- ]);
- //设置Android头部的导航栏透明
- if (Platform.isAndroid) {
- SystemChrome.setSystemUIOverlayStyle(
- const SystemUiOverlayStyle(statusBarColor: Colors.transparent));
- }
- 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 MaterialApp(
- title: '食堂App',
- debugShowCheckedModeBanner: false,
- theme: Themes.defaultTheme,
- home: HomePage(),
- );
- }
- }
|