|
@@ -1,5 +1,7 @@
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
+import 'package:get/get_navigation/src/root/get_material_app.dart';
|
|
import 'package:get_demo/pages/home_page.dart';
|
|
import 'package:get_demo/pages/home_page.dart';
|
|
|
|
+import 'package:get_demo/routes.dart';
|
|
|
|
|
|
void main() {
|
|
void main() {
|
|
runApp(const MyApp());
|
|
runApp(const MyApp());
|
|
@@ -11,13 +13,14 @@ class MyApp extends StatelessWidget {
|
|
// This widget is the root of your application.
|
|
// This widget is the root of your application.
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
- return MaterialApp(
|
|
|
|
|
|
+ return GetMaterialApp(
|
|
title: 'Flutter get 状态管理demo',
|
|
title: 'Flutter get 状态管理demo',
|
|
theme: ThemeData(
|
|
theme: ThemeData(
|
|
primarySwatch: Colors.blue,
|
|
primarySwatch: Colors.blue,
|
|
),
|
|
),
|
|
home: const HomePage(),
|
|
home: const HomePage(),
|
|
|
|
+ initialRoute: Routes.home,
|
|
|
|
+ getPages: Routes.routes,
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|