Refactor CommunityStructureCanvas to improve widget structure by rearranging the InteractiveViewer and GestureDetector hierarchy. This change enhances readability and maintainability while ensuring proper interaction handling.

This commit is contained in:
Faris Armoush
2025-07-15 13:04:37 +03:00
parent 903c5dd29b
commit c60078c96a

View File

@ -453,7 +453,9 @@ class _CommunityStructureCanvasState extends State<CommunityStructureCanvas>
@override
Widget build(BuildContext context) {
final treeWidgets = _buildTreeWidgets();
return InteractiveViewer(
return GestureDetector(
onTap: _resetSelectionAndZoom,
child: InteractiveViewer(
transformationController: _transformationController,
boundaryMargin: EdgeInsets.symmetric(
horizontal: context.screenWidth * 0.3,
@ -462,8 +464,6 @@ class _CommunityStructureCanvasState extends State<CommunityStructureCanvas>
minScale: 0.5,
maxScale: 3.0,
constrained: false,
child: GestureDetector(
onTap: _resetSelectionAndZoom,
child: SizedBox(
width: context.screenWidth * 5,
height: context.screenHeight * 5,