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

View File

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