You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MTMusic/lib/main.dart

40 lines
1.2 KiB

11 months ago
import 'package:flutter/material.dart';
import 'package:music_player_miao/common_widget/app_data.dart';
import 'package:music_player_miao/view/begin/begin_view.dart';
import 'package:music_player_miao/view/begin/login_v.dart';
import 'package:music_player_miao/view/home_view.dart';
11 months ago
import 'package:music_player_miao/view/splash_view.dart';
import 'package:get/get.dart';
import 'dart:io';
import 'package:flutter/services.dart';
import 'package:music_player_miao/view/user/user_view.dart';
11 months ago
void main(){
WidgetsFlutterBinding.ensureInitialized();
Get.put(AppData());
runApp( const MyApp());
if (Platform.isAndroid) {
SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
}
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return GetMaterialApp(
title: 'Flutter Demo',
initialRoute: '/login', // 初始路由
routes: {
'/': (context) => HomeView(), // 定义首页路由
'/user': (context) => UserView(),
'/login' : (context) => BeginView()// 定义UserView的路由
},
11 months ago
);
}
}