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