Merge branch 'design' into alpha

This commit is contained in:
guozhigq
2023-10-22 11:26:57 +08:00
3 changed files with 35 additions and 26 deletions

View File

@ -3,17 +3,19 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart';
import 'package:pilipala/models/follow/result.dart'; import 'package:pilipala/models/follow/result.dart';
import 'package:pilipala/pages/follow/index.dart';
import 'package:pilipala/pages/video/detail/introduction/widgets/group_panel.dart'; import 'package:pilipala/pages/video/detail/introduction/widgets/group_panel.dart';
import 'package:pilipala/utils/feed_back.dart'; import 'package:pilipala/utils/feed_back.dart';
import 'package:pilipala/utils/utils.dart'; import 'package:pilipala/utils/utils.dart';
class FollowItem extends StatelessWidget { class FollowItem extends StatelessWidget {
final FollowItemModel item; final FollowItemModel item;
const FollowItem({super.key, required this.item}); final FollowController? ctr;
const FollowItem({super.key, required this.item, this.ctr});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String heroTag = Utils.makeHeroTag(item!.mid); String heroTag = Utils.makeHeroTag(item.mid);
return ListTile( return ListTile(
onTap: () { onTap: () {
feedBack(); feedBack();
@ -41,28 +43,29 @@ class FollowItem extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
dense: true, dense: true,
trailing: SizedBox( trailing: ctr!.isOwner.value
height: 34, ? SizedBox(
child: TextButton( height: 34,
onPressed: () async { child: TextButton(
await Get.bottomSheet( onPressed: () async {
GroupPanel(mid: item.mid!), await Get.bottomSheet(
isScrollControlled: true, GroupPanel(mid: item.mid!),
); isScrollControlled: true,
SmartDialog.showToast('重进页面查看效果'); );
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
foregroundColor: Theme.of(context).colorScheme.outline, foregroundColor: Theme.of(context).colorScheme.outline,
backgroundColor: backgroundColor:
Theme.of(context).colorScheme.onInverseSurface, // 设置按钮背景色 Theme.of(context).colorScheme.onInverseSurface, // 设置按钮背景色
), ),
child: const Text( child: const Text(
'已关注', '已关注',
style: TextStyle(fontSize: 12), style: TextStyle(fontSize: 12),
), ),
), ),
), )
: const SizedBox(),
); );
} }
} }

View File

@ -84,7 +84,10 @@ class _FollowListState extends State<FollowList> {
), ),
); );
} else { } else {
return FollowItem(item: list[index]); return FollowItem(
item: list[index],
ctr: widget.ctr,
);
} }
}, },
) )

View File

@ -101,7 +101,10 @@ class _OwnerFollowListState extends State<OwnerFollowList>
MediaQuery.of(context).padding.bottom), MediaQuery.of(context).padding.bottom),
); );
} else { } else {
return FollowItem(item: followList[index]); return FollowItem(
item: followList[index],
ctr: widget.ctr,
);
} }
}, },
) )