nabil6391 / graphview

Flutter GraphView is used to display data in graph structures. It can display Tree layout, Directed and Layered graph. Useful for Family Tree, Hierarchy View.
MIT License
424 stars 117 forks source link

Does this not work with mobile? #23

Closed serendipity1004 closed 3 years ago

serendipity1004 commented 3 years ago

I am running copy and paste of code at usage section and I am running into following error

Click to expand error ``` ════════ Exception caught by rendering library ═════════════════════════════════════════════════════ The following assertion was thrown during performLayout(): RenderCustomLayoutBox does not meet its constraints. Constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) Size: Size(865.0, 646.0) If you are not writing your own RenderBox subclass, then this is not your fault. Contact support: https://github.com/flutter/flutter/issues/new?template=BUG.md The relevant error-causing widget was: GraphView file:///Users/jihochoi/Documents/outsource/spinor%20media/projects/kinshealthcare_flutter/lib/components/graph_view/family_graph_view.dart:82:24 When the exception was thrown, this was the stack: #0 RenderBox.debugAssertDoesMeetConstraints. (package:flutter/src/rendering/box.dart:2069:9) #1 RenderBox.debugAssertDoesMeetConstraints (package:flutter/src/rendering/box.dart:2128:6) #2 RenderBox.size=. (package:flutter/src/rendering/box.dart:1846:7) #3 RenderBox.size= (package:flutter/src/rendering/box.dart:1848:6) #4 RenderCustomLayoutBox.performLayout (package:graphview/GraphView.dart:131:5) ... The following RenderObject was being processed when the exception was fired: RenderCustomLayoutBox#76b18 relayoutBoundary=up10 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(865.0, 646.0) ... graph: Instance of 'Graph' ... algorithm: Instance of 'BuchheimWalkerAlgorithm' ... paint: Paint(PaintingStyle.stroke 1.0 StrokeJoin.miter up to 0.0; Color(0xff4caf50)) RenderObject: RenderCustomLayoutBox#76b18 relayoutBoundary=up10 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE parentData: (can use size) constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) size: Size(865.0, 646.0) graph: Instance of 'Graph' algorithm: Instance of 'BuchheimWalkerAlgorithm' paint: Paint(PaintingStyle.stroke 1.0 StrokeJoin.miter up to 0.0; Color(0xff4caf50)) ... child 1: RenderSemanticsAnnotations#8e34a relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(78.0, 49.0) ... child: RenderMouseRegion#7c4d3 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(78.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#1272b relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(78.0, 49.0) ... gestures: tap ... child: RenderPointerListener#cf12a relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(78.0, 49.0) ... behavior: opaque ... listeners: down ... child 2: RenderSemanticsAnnotations#4744a relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... child: RenderMouseRegion#924bf relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#f6791 relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... gestures: tap ... child: RenderPointerListener#81a84 relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... behavior: opaque ... listeners: down ... child 3: RenderSemanticsAnnotations#67690 relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... child: RenderMouseRegion#7f2dd relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#6f7ed relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... gestures: tap ... child: RenderPointerListener#0abab relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... behavior: opaque ... listeners: down ... child 4: RenderSemanticsAnnotations#dfefa relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... child: RenderMouseRegion#8f253 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#2d73d relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... gestures: tap ... child: RenderPointerListener#2a252 relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... behavior: opaque ... listeners: down ... child 5: RenderSemanticsAnnotations#074c1 relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... child: RenderMouseRegion#5d144 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#d329f relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... gestures: tap ... child: RenderPointerListener#ee855 relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... behavior: opaque ... listeners: down ... child 6: RenderSemanticsAnnotations#ec174 relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... child: RenderMouseRegion#10b2e relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#c42e5 relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... gestures: tap ... child: RenderPointerListener#a2b48 relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... behavior: opaque ... listeners: down ... child 7: RenderSemanticsAnnotations#60ba8 relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... child: RenderMouseRegion#ff7a2 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#4bd87 relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... gestures: tap ... child: RenderPointerListener#d3f16 relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... behavior: opaque ... listeners: down ... child 8: RenderSemanticsAnnotations#1114b relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... child: RenderMouseRegion#dbb21 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#0f2c6 relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... gestures: tap ... child: RenderPointerListener#2341c relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(80.0, 49.0) ... behavior: opaque ... listeners: down ... child 9: RenderSemanticsAnnotations#4f4f2 relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... child: RenderMouseRegion#3abcb relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#5b7a5 relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... gestures: tap ... child: RenderPointerListener#4e610 relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(81.0, 49.0) ... behavior: opaque ... listeners: down ... child 10: RenderSemanticsAnnotations#599e0 relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(87.0, 49.0) ... child: RenderMouseRegion#a6f82 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(87.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#9ef20 relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(87.0, 49.0) ... gestures: tap ... child: RenderPointerListener#9ef0a relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(87.0, 49.0) ... behavior: opaque ... listeners: down ... child 11: RenderSemanticsAnnotations#d5ab0 relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(85.0, 49.0) ... child: RenderMouseRegion#441e9 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(85.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#0c16e relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(85.0, 49.0) ... gestures: tap ... child: RenderPointerListener#e7c7b relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(85.0, 49.0) ... behavior: opaque ... listeners: down ... child 12: RenderSemanticsAnnotations#aa3ca relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(87.0, 49.0) ... child: RenderMouseRegion#4f9c8 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(87.0, 49.0) ... listeners: enter, exit ... cursor: SystemMouseCursor(click) ... child: RenderSemanticsGestureHandler#6bf26 relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(87.0, 49.0) ... gestures: tap ... child: RenderPointerListener#b7e2d relayoutBoundary=up14 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=390.0, 0.0<=h<=Infinity) ... size: Size(87.0, 49.0) ... behavior: opaque ... listeners: down ════════════════════════════════════════════════════════════════════════════════════════════════════ ════════ Exception caught by rendering library ═════════════════════════════════════════════════════ RenderTransform does not meet its constraints. The relevant error-causing widget was: InteractiveViewer file:///Users/jihochoi/Documents/outsource/spinor%20media/projects/kinshealthcare_flutter/lib/components/graph_view/family_graph_view.dart:77:13 ════════════════════════════════════════════════════════════════════════════════════════════════════ ```

my flutter doctor is below and trying to run it on ios simulator

[✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.7 19H114 darwin-x64, locale en-KR)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[!] Android Studio (version 4.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] IntelliJ IDEA Ultimate Edition (version 2020.2.1)
[!] VS Code (version 1.49.0)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)
serendipity1004 commented 3 years ago

and below is what I get.

edges are present but boxes are gone

simulator_screenshot_67C40474-C223-42CF-BDCB-EEA9DDC9B9C4

serendipity1004 commented 3 years ago

unfortunately same problem on android emulator. No one has flagged this issue so I must be doing something wrong but I have no idea what. Please help thanks.

serendipity1004 commented 3 years ago

setting constrained option to false and having it expand in column worked.