feat: 我的&媒体页面合并
This commit is contained in:
@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/pages/mine/index.dart';
|
||||
import 'package:pilipala/pages/main/index.dart';
|
||||
import 'package:pilipala/utils/feed_back.dart';
|
||||
import './controller.dart';
|
||||
|
||||
@ -19,6 +19,8 @@ class HomePage extends StatefulWidget {
|
||||
class _HomePageState extends State<HomePage>
|
||||
with AutomaticKeepAliveClientMixin, TickerProviderStateMixin {
|
||||
final HomeController _homeController = Get.put(HomeController());
|
||||
final MainController mainController = Get.put(MainController());
|
||||
|
||||
List videoList = [];
|
||||
late Stream<bool> stream;
|
||||
|
||||
@ -33,15 +35,14 @@ class _HomePageState extends State<HomePage>
|
||||
|
||||
showUserBottomSheet() {
|
||||
feedBack();
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (_) => const SizedBox(
|
||||
height: 450,
|
||||
child: MinePage(),
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
isScrollControlled: true,
|
||||
);
|
||||
final MainController mainController = Get.put(MainController());
|
||||
if (mainController.navigationBars
|
||||
.where((item) => item['label'] == "我的")
|
||||
.isNotEmpty) {
|
||||
mainController.pageController.jumpToPage(2);
|
||||
} else {
|
||||
Get.toNamed('/mine');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/pages/mine/view.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
@ -54,19 +53,9 @@ class HomeAppBar extends StatelessWidget {
|
||||
// icon: const Icon(CupertinoIcons.bell, size: 22),
|
||||
// ),
|
||||
const SizedBox(width: 6),
|
||||
|
||||
/// TODO
|
||||
if (userInfo != null) ...[
|
||||
GestureDetector(
|
||||
onTap: () => showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (_) => const SizedBox(
|
||||
height: 450,
|
||||
child: MinePage(),
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
isScrollControlled: true,
|
||||
),
|
||||
onTap: () => Get.toNamed('/mine'),
|
||||
child: NetworkImgLayer(
|
||||
type: 'avatar',
|
||||
width: 32,
|
||||
@ -77,15 +66,7 @@ class HomeAppBar extends StatelessWidget {
|
||||
const SizedBox(width: 10),
|
||||
] else ...[
|
||||
IconButton(
|
||||
onPressed: () => showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (_) => const SizedBox(
|
||||
height: 450,
|
||||
child: MinePage(),
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
isScrollControlled: true,
|
||||
),
|
||||
onPressed: () => Get.toNamed('/mine'),
|
||||
icon: const Icon(CupertinoIcons.person, size: 22),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user