sort follow tag

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-27 20:53:55 +08:00
parent 89fdc28150
commit 80ecd35784
8 changed files with 214 additions and 21 deletions

View File

@@ -38,17 +38,40 @@ class FollowChildPage extends StatefulWidget {
class _FollowChildPageState extends State<FollowChildPage>
with AutomaticKeepAliveClientMixin {
late final FollowChildController _followController;
late String _tag;
late FollowChildController _followController;
String get _newTag =>
'${widget.tag ?? Utils.generateRandomString(8)}${widget.tagid}';
@override
void initState() {
super.initState();
_initController();
}
void _initController() {
_tag = _newTag;
_followController = Get.put(
FollowChildController(widget.controller, widget.mid, widget.tagid),
tag: '${widget.tag ?? Utils.generateRandomString(8)}${widget.tagid}',
tag: _tag,
);
}
@override
void didUpdateWidget(FollowChildPage oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.tagid != widget.tagid) {
final newTag = _newTag;
if (Get.isRegistered<FollowChildController>(tag: newTag)) {
_followController = Get.find<FollowChildController>(tag: newTag);
} else {
Get.delete<FollowChildController>(tag: _tag);
_initController();
}
}
}
@override
Widget build(BuildContext context) {
super.build(context);