Skip to content

Commit

Permalink
Fixed graph widget not rebuilding after dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Nov 25, 2023
1 parent 988a3c6 commit f890901
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/widgets/nt4_widgets/single_topic/graph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,23 @@ class GraphWidget extends StatelessWidget with NT4Widget {
_graphData = currentGraphData;
}

return _graphWidget = _GraphWidgetGraph(
key: GlobalKey(),
_graphWidget = _GraphWidgetGraph(
initialData: _graphData,
subscription: subscription,
mainColor: mainColor,
minValue: minValue,
maxValue: maxValue,
);

// Idk why this works but otherwise it doesn't ever rebuild ¯\_(ツ)_/¯
return StreamBuilder(
stream: Stream.periodic(const Duration(milliseconds: 500)),
builder: (context, snapshot) {
notifier = context.watch<NT4WidgetNotifier?>();

return _graphWidget!;
},
);
}
}

Expand Down

0 comments on commit f890901

Please sign in to comment.