Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mouse_tracker.dart error and complete freeze #45

Closed
DirtyNative opened this issue Jul 17, 2021 · 4 comments
Closed

mouse_tracker.dart error and complete freeze #45

DirtyNative opened this issue Jul 17, 2021 · 4 comments

Comments

@DirtyNative
Copy link

I am using the graph view inside one of my views and struggle getting it to work without freezing.
I get a massive load of errors while the mouse is over the graph:

════════ Exception caught by scheduler library ═════════════════════════════════
'package:flutter/src/rendering/mouse_tracker.dart': Failed assertion: line 201 pos 12: '!_debugDuringDeviceUpdate': is not true.
════════════════════════════════════════════════════════════════════════════════
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: 'package:flutter/src/rendering/mouse_tracker.dart': Failed assertion: line 201 pos 12: '!_debugDuringDeviceUpdate': is not true.
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
#2      MouseTracker._deviceUpdatePhase
package:flutter/…/rendering/mouse_tracker.dart:201
#3      MouseTracker.updateWithEvent.<anonymous closure>
package:flutter/…/rendering/mouse_tracker.dart:309
#4      MouseTracker._monitorMouseConnection
package:flutter/…/rendering/mouse_tracker.dart:190

My code for the view:

@override
  Widget build(BuildContext context) {
    return ViewModelBuilder<TechTreeViewModel>.reactive(
      builder: (context, model, snapshot) => ScaffoldBase(
        body: 

// I just tried to see if this is caused by unbound sizes... its not
SizedBox(
          height: 400,
          width: 400,
          child: InteractiveViewer(
            constrained: false,
            scaleEnabled: false,
            maxScale: 1,
            minScale: 1,
            boundaryMargin: EdgeInsets.all(100),
            child: GraphView(
              algorithm: BuchheimWalkerAlgorithm(
                model.builder,
                TreeEdgeRenderer(model.builder),
              ),
              graph: model.graph,
              paint: Paint()
                ..color = Colors.green
                ..strokeWidth = 1
                ..style = PaintingStyle.stroke,
              builder: (Node node) {
                if (node.key.value is TechTreeConditionNode) {
                  return conditionNode(node.key.value);
                } else if (node.key.value is TechTreeTechnologyNode) {
                  return rootNode(node.key.value);
                }

                return Container(
                  width: 100,
                  height: 100,
                );
              },
            ),
          ),
        ),
      ),
    );
  }

  

  Widget rootNode(TechTreeTechnologyNode nodeModel) {
    return InkWell(
      child: Container(
        height: 100,
        width: 200,
        padding: EdgeInsets.all(16),
        child: Column(
          children: [
            Text(nodeModel.technology.name),
          ],
        ),
      ),
    );
  }

And inside my ViewModel:

  Graph graph;
  BuchheimWalkerConfiguration builder;

  TechTreeViewModel( ) {
    graph = Graph()..isTree = true;
    builder = new BuchheimWalkerConfiguration();
  }

I tried to find out, what is causing this issue, but haven't found anything. If you need more info, please let me know

@nabil6391
Copy link
Owner

The error happens for any algorithm ?

@DirtyNative
Copy link
Author

Happens also with SugiyamaAlgorithm

@nabil6391
Copy link
Owner

Can you try wrapping the text with Center widget

Try updating the flutter channel

@nabil6391
Copy link
Owner

Is this still relevant? otherwise I will close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants