mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-24 20:22:27 +00:00
Update CommunityStructureCanvas
to improve widget update logic by animating to the selected space based on community UUID changes. This enhances the responsiveness of the UI when the community context changes.
This commit is contained in:
@ -56,8 +56,9 @@ class _CommunityStructureCanvasState extends State<CommunityStructureCanvas>
|
||||
@override
|
||||
void didUpdateWidget(covariant CommunityStructureCanvas oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.selectedSpace == null) return;
|
||||
if (widget.selectedSpace?.uuid != oldWidget.selectedSpace?.uuid) {
|
||||
if (oldWidget.community.uuid != widget.community.uuid) {
|
||||
_animateToSpace(null);
|
||||
} else if (widget.selectedSpace?.uuid != oldWidget.selectedSpace?.uuid) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
_animateToSpace(widget.selectedSpace);
|
||||
|
Reference in New Issue
Block a user