Debug
This commit is contained in:
@@ -712,6 +712,7 @@ class Dashboard extends ChangeNotifier {
|
||||
elements.removeWhere((element) {
|
||||
if (element.id == id) {
|
||||
elementId = element.id;
|
||||
arrows.removeWhere((a) => a.fromID.contains(elementId) || a.toID.contains(elementId));
|
||||
}
|
||||
return element.id == id;
|
||||
});
|
||||
@@ -733,10 +734,13 @@ class Dashboard extends ChangeNotifier {
|
||||
var found = false;
|
||||
final elementId = element.id;
|
||||
elements.removeWhere((e) {
|
||||
if (e.id == element.id) found = true;
|
||||
if (e.id == element.id) {
|
||||
found = true;
|
||||
|
||||
}
|
||||
return e.id == element.id;
|
||||
});
|
||||
|
||||
arrows.removeWhere( (e) => e.fromID.contains(elementId) || e.toID.contains(elementId));
|
||||
// remove all connections to the element
|
||||
for (final e in elements) {
|
||||
e.next.removeWhere(
|
||||
|
||||
@@ -386,7 +386,12 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
||||
}
|
||||
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.delete) {
|
||||
change = true;
|
||||
widget.dashboard.removeElements( (el) => el.isSelected, context );
|
||||
widget.dashboard.removeElements((element) {
|
||||
if (element.isSelected) {
|
||||
widget.dashboard.arrows.removeWhere( (e) => e.toID.contains(element.id) || e.fromID.contains(element.id));
|
||||
}
|
||||
return element.isSelected;
|
||||
}, context);
|
||||
for (var arrow in widget.dashboard.arrowsSelected) {
|
||||
for (var el in widget.dashboard.elements.where((element) => element.id == arrow.fromID.split("_")[0])) {
|
||||
el.next.removeAt(int.parse(arrow.fromID.split("_")[1]));
|
||||
|
||||
@@ -30,14 +30,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||
Tooltip( message: "remove",
|
||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
widget.dashboard.removeArrows((element) {
|
||||
if (element.isSelected && element.elementIndex != null && element.connIndex != null) {
|
||||
widget.dashboard.elements[element.elementIndex!].next.removeAt(element.connIndex!);
|
||||
onTap: () {
|
||||
widget.dashboard.removeElements((element) {
|
||||
if (element.isSelected) {
|
||||
widget.dashboard.arrows.removeWhere( (e) => e.toID.contains(element.id) || e.fromID.contains(element.id));
|
||||
}
|
||||
return element.isSelected;
|
||||
}, context);
|
||||
widget.dashboard.removeElements((element) => element.isSelected, context);
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
||||
});
|
||||
@@ -551,13 +550,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
Tooltip( message: "remove",
|
||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () {
|
||||
widget.dashboard.removeArrows((element) {
|
||||
if (element.isSelected && element.elementIndex != null && element.connIndex != null) {
|
||||
widget.dashboard.elements[element.elementIndex!].next.removeAt(element.connIndex!);
|
||||
widget.dashboard.removeElements((element) {
|
||||
if (element.isSelected) {
|
||||
widget.dashboard.arrows.removeWhere( (e) => e.toID.contains(element.id) || e.fromID.contains(element.id));
|
||||
}
|
||||
return element.isSelected;
|
||||
}, context);
|
||||
widget.dashboard.removeElements((element) => element.isSelected, context);
|
||||
}, context);
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user