mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -44,19 +44,26 @@ class _FollowChildPageState extends State<FollowChildPage>
|
||||
super.build(context);
|
||||
if (widget.onSelect != null ||
|
||||
(widget.controller?.isOwner == true && widget.tagid == null)) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: _child,
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () => _followController
|
||||
..orderType.value =
|
||||
_followController.orderType.value == FollowOrderType.def
|
||||
? FollowOrderType.attention
|
||||
: FollowOrderType.def
|
||||
..onReload(),
|
||||
icon: const Icon(Icons.format_list_bulleted, size: 20),
|
||||
label: Obx(() => Text(_followController.orderType.value.title)),
|
||||
),
|
||||
final padding = MediaQuery.paddingOf(context);
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
_child,
|
||||
Positioned(
|
||||
right: 16 + padding.right,
|
||||
bottom: 16 + padding.bottom,
|
||||
child: FloatingActionButton.extended(
|
||||
onPressed: () => _followController
|
||||
..orderType.value =
|
||||
_followController.orderType.value == FollowOrderType.def
|
||||
? FollowOrderType.attention
|
||||
: FollowOrderType.def
|
||||
..onReload(),
|
||||
icon: const Icon(Icons.format_list_bulleted, size: 20),
|
||||
label: Obx(() => Text(_followController.orderType.value.title)),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
return _child;
|
||||
|
||||
@@ -139,12 +139,9 @@ class _FollowPageState extends State<FollowPage> {
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: tabBarView(
|
||||
controller: _followController.tabController,
|
||||
children: _followController.tabs.map(_childPage).toList(),
|
||||
),
|
||||
child: tabBarView(
|
||||
controller: _followController.tabController,
|
||||
children: _followController.tabs.map(_childPage).toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:PiliPlus/models_new/follow/list.dart';
|
||||
import 'package:PiliPlus/pages/share/view.dart' show UserModel;
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/request_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -25,92 +24,91 @@ class FollowItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
String heroTag = Utils.makeHeroTag(item.mid);
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
if (onSelect != null) {
|
||||
onSelect!.call(
|
||||
UserModel(
|
||||
mid: item.mid!,
|
||||
name: item.uname!,
|
||||
avatar: item.face!,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
feedBack();
|
||||
Get.toNamed('/member?mid=${item.mid}',
|
||||
arguments: {'face': item.face, 'heroTag': heroTag});
|
||||
}
|
||||
},
|
||||
leading: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Hero(
|
||||
tag: heroTag,
|
||||
child: NetworkImgLayer(
|
||||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
child: ListTile(
|
||||
onTap: () {
|
||||
if (onSelect != null) {
|
||||
onSelect!.call(
|
||||
UserModel(
|
||||
mid: item.mid!,
|
||||
name: item.uname!,
|
||||
avatar: item.face!,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
feedBack();
|
||||
Get.toNamed('/member?mid=${item.mid}');
|
||||
}
|
||||
},
|
||||
leading: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
width: 45,
|
||||
height: 45,
|
||||
type: ImageType.avatar,
|
||||
src: item.face,
|
||||
),
|
||||
),
|
||||
if (item.officialVerify?.type == 0 || item.officialVerify?.type == 1)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: theme.colorScheme.surface,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.offline_bolt,
|
||||
color: item.officialVerify?.type == 0
|
||||
? const Color(0xFFFFCC00)
|
||||
: Colors.lightBlueAccent,
|
||||
size: 14,
|
||||
if (item.officialVerify?.type == 0 ||
|
||||
item.officialVerify?.type == 1)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: theme.colorScheme.surface,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.offline_bolt,
|
||||
color: item.officialVerify?.type == 0
|
||||
? const Color(0xFFFFCC00)
|
||||
: Colors.lightBlueAccent,
|
||||
size: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
title: Text(
|
||||
item.uname!,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
subtitle: Text(
|
||||
item.sign!,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
dense: true,
|
||||
trailing: isOwner == true
|
||||
? SizedBox(
|
||||
height: 34,
|
||||
child: FilledButton.tonal(
|
||||
onPressed: () => RequestUtils.actionRelationMod(
|
||||
context: context,
|
||||
mid: item.mid,
|
||||
isFollow: item.attribute != -1,
|
||||
callback: callback,
|
||||
],
|
||||
),
|
||||
title: Text(
|
||||
item.uname!,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
subtitle: Text(
|
||||
item.sign!,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
dense: true,
|
||||
trailing: isOwner == true
|
||||
? SizedBox(
|
||||
height: 34,
|
||||
child: FilledButton.tonal(
|
||||
onPressed: () => RequestUtils.actionRelationMod(
|
||||
context: context,
|
||||
mid: item.mid,
|
||||
isFollow: item.attribute != -1,
|
||||
callback: callback,
|
||||
),
|
||||
style: FilledButton.styleFrom(
|
||||
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
|
||||
foregroundColor:
|
||||
item.attribute == -1 ? null : theme.colorScheme.outline,
|
||||
backgroundColor: item.attribute == -1
|
||||
? null
|
||||
: theme.colorScheme.onInverseSurface,
|
||||
),
|
||||
child: Text(
|
||||
'${item.attribute == -1 ? '' : '已'}关注',
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
),
|
||||
style: FilledButton.styleFrom(
|
||||
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
|
||||
foregroundColor:
|
||||
item.attribute == -1 ? null : theme.colorScheme.outline,
|
||||
backgroundColor: item.attribute == -1
|
||||
? null
|
||||
: theme.colorScheme.onInverseSurface,
|
||||
),
|
||||
child: Text(
|
||||
'${item.attribute == -1 ? '' : '已'}关注',
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user