This commit is contained in:
bluesea 2024-05-11 11:19:08 +08:00
parent 97356ae70e
commit 60232041df
5 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,11 @@
import 'package:get/get.dart';
import 'mypage_controller.dart';
class MyPageBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(() => MyPageController());
}
}

View File

@ -0,0 +1,5 @@
import 'package:get/get.dart';
class MyPageController extends GetxController {
}

View File

@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class MyPageView extends GetView {
const MyPageView({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("我的"),
),
body: const Center(
child: Text("xxxxx"),
),
);
}
}

View File

@ -3,6 +3,9 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter/widgets.dart';
import 'package:wallpaper/pages/homePage/homePage_view.dart';
import 'package:wallpaper/pages/downloadpage/downloadpage_view.dart';
import 'package:wallpaper/pages/collectionpage/collectionpage_view.dart';
import 'package:wallpaper/pages/mypage/mypage_view.dart';
class TabbarPageView extends GetView {
const TabbarPageView({super.key});
@ -37,6 +40,6 @@ class TabbarPageView extends GetView {
//tabitem对应控制器视图,
List<Widget> getPages(){
return [HomePageView(),];
return [HomePageView(),CollectionPageView(),DownloadPageView(),MyPageView(),];
}
}

View File

@ -11,6 +11,9 @@ import 'package:wallpaper/pages/collectionpage/collectionpage_view.dart';
import 'package:wallpaper/pages/collectionpage/collectionpage_binding.dart';
import 'package:wallpaper/pages/mypage/mypage_view.dart';
import 'package:wallpaper/pages/mypage/mypage_binding.dart';
import 'package:get/get.dart';
class AppRoutes {
@ -42,6 +45,12 @@ class AppRoutes {
binding: CollectionPageBinding(),
participatesInRootNavigator: true,
),
GetPage(
name: '/my',
page: ()=> const MyPageView(),
binding: MyPageBinding(),
participatesInRootNavigator: true,
),
];
}