Refactor member page (#3)

* refactor: member page

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip
This commit is contained in:
bggRGjQaUbCoE
2024-10-17 11:18:59 +08:00
committed by GitHub
parent 270bf0a4b6
commit f77088b870
205 changed files with 70072 additions and 119 deletions

View File

@@ -7,15 +7,18 @@ import 'package:PiliPalaX/http/video.dart';
import 'package:PiliPalaX/models/user/fav_folder.dart';
class FavDetailController extends CommonController {
FavFolderItemData? item;
// FavFolderItemData? item;
int? mediaId;
late String heroTag;
RxString loadingText = '加载中...'.obs;
int mediaCount = 0;
RxString title = ''.obs;
RxString cover = ''.obs;
RxString name = ''.obs;
@override
void onInit() {
item = Get.arguments;
// item = Get.arguments;
if (Get.parameters.keys.isNotEmpty) {
mediaId = int.parse(Get.parameters['mediaId']!);
heroTag = Get.parameters['heroTag']!;
@@ -42,6 +45,9 @@ class FavDetailController extends CommonController {
@override
bool customHandleResponse(Success response) {
if (currentPage == 1) {
title.value = response.response.info['title'];
cover.value = response.response.info['cover'];
name.value = response.response.info['upper']['name'];
mediaCount = response.response.info['media_count'];
}
List currentList = loadingState.value is Success

View File

@@ -79,19 +79,21 @@ class _FavDetailPageState extends State<FavDetailPage> {
duration: const Duration(milliseconds: 500),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_favDetailController.item!.title!,
style: Theme.of(context).textTheme.titleMedium,
),
Text(
'${_favDetailController.item!.mediaCount!}条视频',
style: Theme.of(context).textTheme.labelMedium,
)
],
)
Obx(
() => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_favDetailController.title.value,
style: Theme.of(context).textTheme.titleMedium,
),
Text(
'${_favDetailController.mediaCount}条视频',
style: Theme.of(context).textTheme.labelMedium,
)
],
),
),
],
),
);
@@ -134,52 +136,58 @@ class _FavDetailPageState extends State<FavDetailPage> {
// mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Hero(
tag: _favDetailController.heroTag,
child: NetworkImgLayer(
width: 180,
height: 110,
src: _favDetailController.item!.cover,
Obx(
() => Hero(
tag: _favDetailController.heroTag,
child: NetworkImgLayer(
width: 180,
height: 110,
src: _favDetailController.cover.value,
),
),
),
const SizedBox(width: 14),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 4),
Text(
_favDetailController.item!.title!,
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.titleMedium!
.fontSize,
fontWeight: FontWeight.bold),
),
const SizedBox(height: 4),
Text(
_favDetailController.item!.upper!.name!,
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.labelSmall!
.fontSize,
color: Theme.of(context).colorScheme.outline),
),
const Spacer(),
Text(
'${_favDetailController.item!.mediaCount!}条视频',
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.labelSmall!
.fontSize,
color: Theme.of(context).colorScheme.outline),
),
const SizedBox(height: 20),
],
Obx(
() => Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 4),
Text(
_favDetailController.title.value,
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.titleMedium!
.fontSize,
fontWeight: FontWeight.bold),
),
const SizedBox(height: 4),
Text(
_favDetailController.name.value,
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.labelSmall!
.fontSize,
color:
Theme.of(context).colorScheme.outline),
),
const Spacer(),
Text(
'${_favDetailController.mediaCount}条视频',
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.labelSmall!
.fontSize,
color:
Theme.of(context).colorScheme.outline),
),
const SizedBox(height: 20),
],
),
),
),
],