Debug
This commit is contained in:
parent
57c6d74ff5
commit
6b362d77f0
@ -57,7 +57,7 @@ class ItemWidgetState extends State<ItemWidget> {
|
|||||||
widgetsInstance.add(Container(height: 20, width: getWidth(context) / 2,));
|
widgetsInstance.add(Container(height: 20, width: getWidth(context) / 2,));
|
||||||
var count = 0;
|
var count = 0;
|
||||||
for (var info in instance.infos().keys) {
|
for (var info in instance.infos().keys) {
|
||||||
if (instance.infos()[info] == null || instance.infos()[info] is List) { continue; }
|
if (instance.infos()[info] == null || instance.infos()[info] is List || instance.infos()[info] is Map) { continue; }
|
||||||
count++;
|
count++;
|
||||||
widgetsInstance.add(Center(child: Padding( padding: EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
widgetsInstance.add(Center(child: Padding( padding: EdgeInsets.symmetric(vertical: 5), child : Row(children: [
|
||||||
Padding( padding: EdgeInsets.only(left: 50, right: 10), child : Text("${info.toUpperCase().replaceAll("_", " ")} :", style: TextStyle(fontSize: 15, color: Colors.grey))),
|
Padding( padding: EdgeInsets.only(left: 50, right: 10), child : Text("${info.toUpperCase().replaceAll("_", " ")} :", style: TextStyle(fontSize: 15, color: Colors.grey))),
|
||||||
@ -82,7 +82,9 @@ class ItemWidgetState extends State<ItemWidget> {
|
|||||||
width: getMainWidth(context),
|
width: getMainWidth(context),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
height: 100,
|
height: 100,
|
||||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: midColor))),
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
border: Border(bottom: BorderSide(color: midColor))),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 50),
|
padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 50),
|
||||||
child: Text(widget.item.description!.length > 350 ? "${widget.item.description!.substring(0, 347)}..." : widget.item.description!,
|
child: Text(widget.item.description!.length > 350 ? "${widget.item.description!.substring(0, 347)}..." : widget.item.description!,
|
||||||
style: TextStyle(fontSize: 15, color: Colors.grey, fontWeight: FontWeight.w500))),
|
style: TextStyle(fontSize: 15, color: Colors.grey, fontWeight: FontWeight.w500))),
|
||||||
|
@ -712,6 +712,7 @@ class Dashboard extends ChangeNotifier {
|
|||||||
elements.removeWhere((element) {
|
elements.removeWhere((element) {
|
||||||
if (element.id == id) {
|
if (element.id == id) {
|
||||||
elementId = element.id;
|
elementId = element.id;
|
||||||
|
arrows.removeWhere((a) => a.fromID.contains(elementId) || a.toID.contains(elementId));
|
||||||
}
|
}
|
||||||
return element.id == id;
|
return element.id == id;
|
||||||
});
|
});
|
||||||
@ -733,10 +734,13 @@ class Dashboard extends ChangeNotifier {
|
|||||||
var found = false;
|
var found = false;
|
||||||
final elementId = element.id;
|
final elementId = element.id;
|
||||||
elements.removeWhere((e) {
|
elements.removeWhere((e) {
|
||||||
if (e.id == element.id) found = true;
|
if (e.id == element.id) {
|
||||||
|
found = true;
|
||||||
|
|
||||||
|
}
|
||||||
return e.id == element.id;
|
return e.id == element.id;
|
||||||
});
|
});
|
||||||
|
arrows.removeWhere( (e) => e.fromID.contains(elementId) || e.toID.contains(elementId));
|
||||||
// remove all connections to the element
|
// remove all connections to the element
|
||||||
for (final e in elements) {
|
for (final e in elements) {
|
||||||
e.next.removeWhere(
|
e.next.removeWhere(
|
||||||
|
@ -386,7 +386,12 @@ class FlowChartState<T extends FlowData> extends State<FlowChart> {
|
|||||||
}
|
}
|
||||||
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.delete) {
|
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.delete) {
|
||||||
change = true;
|
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 arrow in widget.dashboard.arrowsSelected) {
|
||||||
for (var el in widget.dashboard.elements.where((element) => element.id == arrow.fromID.split("_")[0])) {
|
for (var el in widget.dashboard.elements.where((element) => element.id == arrow.fromID.split("_")[0])) {
|
||||||
el.next.removeAt(int.parse(arrow.fromID.split("_")[1]));
|
el.next.removeAt(int.parse(arrow.fromID.split("_")[1]));
|
||||||
|
@ -30,14 +30,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||||
Tooltip( message: "remove",
|
Tooltip( message: "remove",
|
||||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
widget.dashboard.removeArrows((element) {
|
widget.dashboard.removeElements((element) {
|
||||||
if (element.isSelected && element.elementIndex != null && element.connIndex != null) {
|
if (element.isSelected) {
|
||||||
widget.dashboard.elements[element.elementIndex!].next.removeAt(element.connIndex!);
|
widget.dashboard.arrows.removeWhere( (e) => e.toID.contains(element.id) || e.fromID.contains(element.id));
|
||||||
}
|
}
|
||||||
return element.isSelected;
|
return element.isSelected;
|
||||||
}, context);
|
}, context);
|
||||||
widget.dashboard.removeElements((element) => element.isSelected, context);
|
|
||||||
Future.delayed(Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
||||||
});
|
});
|
||||||
@ -551,13 +550,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
|||||||
Tooltip( message: "remove",
|
Tooltip( message: "remove",
|
||||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
widget.dashboard.removeArrows((element) {
|
widget.dashboard.removeElements((element) {
|
||||||
if (element.isSelected && element.elementIndex != null && element.connIndex != null) {
|
if (element.isSelected) {
|
||||||
widget.dashboard.elements[element.elementIndex!].next.removeAt(element.connIndex!);
|
widget.dashboard.arrows.removeWhere( (e) => e.toID.contains(element.id) || e.fromID.contains(element.id));
|
||||||
}
|
}
|
||||||
return element.isSelected;
|
return element.isSelected;
|
||||||
}, context);
|
}, context);
|
||||||
widget.dashboard.removeElements((element) => element.isSelected, context);
|
|
||||||
Future.delayed(Duration(milliseconds: 100), () {
|
Future.delayed(Duration(milliseconds: 100), () {
|
||||||
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user