debug workflow
This commit is contained in:
@@ -743,18 +743,22 @@ class ChartWidgetState<T extends FlowData> extends State<ChartWidget> {
|
||||
onTapDown: (details) {
|
||||
hoverImportant = false;
|
||||
tapDownPos = details.localPosition;
|
||||
|
||||
for (var arr in widget.dashboard.arrows) {
|
||||
if (arr.isLine(tapDownPos)) {
|
||||
hoverImportant = true;
|
||||
for (var arr in widget.dashboard.arrows) {
|
||||
arr.isSelected = false;
|
||||
}
|
||||
arr.isSelected = !arr.isSelected;
|
||||
for (var sel in widget.dashboard.elements) {
|
||||
sel.isSelected = false;
|
||||
}
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
widget.dashboard.selectedMenuKey.currentState?.setState(() {});
|
||||
DrawingArrow.instance.notifyListeners();
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hoverImportant) {
|
||||
|
||||
@@ -79,9 +79,8 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
widget.dashboard.infoLinkWidget!(widget.dashboard.arrowsSelected.first) : Container(),
|
||||
widget.dashboard.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
||||
width: 200,
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
decoration: BoxDecoration(border: Border(
|
||||
top: BorderSide(color: Colors.grey, width: 1))),
|
||||
margin: const EdgeInsets.only(top: 15),
|
||||
decoration: const BoxDecoration(border: Border(top: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||
Tooltip( message: "remove",
|
||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
@@ -92,13 +91,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
return element.isSelected;
|
||||
}, context);
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
Future.delayed( const Duration(milliseconds: 100), () {
|
||||
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
||||
});
|
||||
}, child: Container( margin: EdgeInsets.all(10),
|
||||
}, child: Container( margin: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
||||
width: 200, height: 30,
|
||||
child: Icon(Icons.delete_outline, color: Colors.black),
|
||||
child: const Icon(Icons.delete_outline, color: Colors.black),
|
||||
))
|
||||
),
|
||||
])
|
||||
@@ -118,22 +117,22 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
height: widget.height,
|
||||
color: widget.dashboard.midDashColor,
|
||||
child: Column( children: [
|
||||
Container( padding: EdgeInsets.all(10), width: 200, height: 60,
|
||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
Container( padding: const EdgeInsets.all(10), width: 200, height: 60,
|
||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Text("STYLE ${widget.dashboard.elementSelected.isNotEmpty ? "ELEMENT" : "ARROW"}", style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
||||
Text("<${widget.dashboard.arrowsSelected.isEmpty && widget.dashboard.elementSelected.isEmpty ? "general" : "selected"}>", style: TextStyle(fontSize: 12), textAlign: TextAlign.center),
|
||||
])),
|
||||
SizedBox( width: 200, height: widget.height - 60, child: SingleChildScrollView( child: Column( children: [
|
||||
widget.dashboard.elementSelected.isNotEmpty ? Container() : Container( padding: EdgeInsets.symmetric(horizontal: 10, vertical: 20),
|
||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column( children: [
|
||||
Row( children: [
|
||||
InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
child: Padding( padding: EdgeInsets.only(left: 10, right: 10),
|
||||
child: Padding( padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
child: PopupMenuButton<ArrowDash>(
|
||||
tooltip: "line defaults",
|
||||
constraints: BoxConstraints(maxWidth: 100),
|
||||
constraints: const BoxConstraints(maxWidth: 100),
|
||||
initialValue: null,
|
||||
onSelected: (ArrowDash value) {
|
||||
if (widget.dashboard.elementSelected.isEmpty) {
|
||||
@@ -199,14 +198,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
dashSpace: widget.dashboard.defaultDashSpace,
|
||||
color: Colors.black
|
||||
),
|
||||
SizedBox(height: 25, width: 10),
|
||||
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
const SizedBox(height: 25, width: 10),
|
||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
),
|
||||
)
|
||||
),
|
||||
PopupMenuButton<void>(
|
||||
tooltip: "color picker",
|
||||
constraints: BoxConstraints(maxWidth: 664),
|
||||
constraints: const BoxConstraints(maxWidth: 664),
|
||||
initialValue: null,
|
||||
onSelected: (void value) {},
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<void>>[
|
||||
@@ -222,12 +221,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
],
|
||||
child: Row( children: [
|
||||
Container(width: 15, height: 15, color: widget.dashboard.defaultColor),
|
||||
SizedBox(height: 25, width: 5),
|
||||
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
const SizedBox(height: 25, width: 5),
|
||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
),
|
||||
Tooltip( message: "stroke width",
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 10),
|
||||
margin: const EdgeInsets.only(left: 10),
|
||||
width: 55, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
readOnly: widget.dashboard.defaultDashWidth <= 0,
|
||||
@@ -239,8 +238,8 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
setState(() { widget.dashboard.defaultStroke = double.parse(value); });
|
||||
},
|
||||
style: TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
style: const TextStyle(fontSize: 12),
|
||||
decoration: const InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
labelText: "stroke",
|
||||
@@ -266,7 +265,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
]),
|
||||
Row(children: [
|
||||
InkWell( mouseCursor: SystemMouseCursors.click, child: Padding(
|
||||
padding: EdgeInsets.only(left: 10, top: 10, right: 10),
|
||||
padding: const EdgeInsets.only(left: 10, top: 10, right: 10),
|
||||
child: PopupMenuButton<ArrowStyle>(
|
||||
initialValue: null,
|
||||
onSelected: (ArrowStyle value) {
|
||||
@@ -279,7 +278,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
},
|
||||
tooltip: "line styles",
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<ArrowStyle>>[
|
||||
PopupMenuItem<ArrowStyle>(
|
||||
const PopupMenuItem<ArrowStyle>(
|
||||
value: ArrowStyle.segmented,
|
||||
child: Row( children: [
|
||||
Icon(Icons.turn_slight_left),
|
||||
@@ -287,7 +286,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: Text('straight', textAlign: TextAlign.center,))
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<ArrowStyle>(
|
||||
const PopupMenuItem<ArrowStyle>(
|
||||
value: ArrowStyle.curve,
|
||||
child: Row( children: [
|
||||
Icon(Icons.roundabout_left),
|
||||
@@ -295,7 +294,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: Text('curved', textAlign: TextAlign.center,))
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<ArrowStyle>(
|
||||
const PopupMenuItem<ArrowStyle>(
|
||||
value: ArrowStyle.rectangular,
|
||||
child: Row( children: [
|
||||
Icon(Icons.turn_sharp_left_outlined),
|
||||
@@ -307,13 +306,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child:
|
||||
Row( children: [ Icon(widget.dashboard.defaultArrowStyle == ArrowStyle.segmented ? Icons.turn_slight_left : widget.dashboard.defaultArrowStyle == ArrowStyle.curve ? Icons.roundabout_left : Icons.turn_sharp_left_outlined
|
||||
, color: Colors.black),
|
||||
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
)
|
||||
)
|
||||
),
|
||||
Tooltip( message: "space dash",
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
width: 105 / 2, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
readOnly: widget.dashboard.defaultDashWidth <= 0,
|
||||
@@ -325,14 +324,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
setState(() { widget.dashboard.defaultDashWidth = double.parse(value); });
|
||||
},
|
||||
style: TextStyle(fontSize: 12),
|
||||
style: const TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||
filled: true,
|
||||
labelText: "dash",
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
border: OutlineInputBorder(),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
labelStyle: const TextStyle(fontSize: 10),
|
||||
border: const OutlineInputBorder(),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
),
|
||||
inputFormatters: [
|
||||
NumberTextInputFormatter(
|
||||
@@ -351,7 +350,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
))),
|
||||
Tooltip( message: "space width",
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 10, top: 10),
|
||||
margin: const EdgeInsets.only(left: 10, top: 10),
|
||||
width: 105 / 2, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
initialValue: "${widget.dashboard.defaultDashSpace}",
|
||||
@@ -362,14 +361,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
setState(() { widget.dashboard.defaultDashSpace = double.parse(value); });
|
||||
},
|
||||
style: TextStyle(fontSize: 12),
|
||||
style: const TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||
filled: true,
|
||||
labelText: "space",
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
border: OutlineInputBorder(),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
labelStyle: const TextStyle(fontSize: 10),
|
||||
border: const OutlineInputBorder(),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
),
|
||||
inputFormatters: [
|
||||
NumberTextInputFormatter(
|
||||
@@ -389,12 +388,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
]),
|
||||
])),
|
||||
widget.dashboard.elementSelected.isNotEmpty ? Container() :
|
||||
Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 20, top: 15),
|
||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
Container( padding: const EdgeInsets.only(left: 10, right: 10, bottom: 20, top: 15),
|
||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column( children: [
|
||||
Row( mainAxisAlignment: MainAxisAlignment.center, children : [
|
||||
InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
child: Padding( padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Padding( padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: PopupMenuButton<ArrowDirection>(
|
||||
initialValue: null,
|
||||
onSelected: (ArrowDirection value) {
|
||||
@@ -407,7 +406,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
},
|
||||
tooltip: widget.dashboard.defaultArrowDirection == ArrowDirection.forward ? 'forward' : widget.dashboard.defaultArrowDirection == ArrowDirection.backward ? 'backward' : 'bidirectionnal',
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<ArrowDirection>>[
|
||||
PopupMenuItem<ArrowDirection>(
|
||||
const PopupMenuItem<ArrowDirection>(
|
||||
value: ArrowDirection.forward,
|
||||
child: Row( children: [
|
||||
Icon(Icons.arrow_forward),
|
||||
@@ -415,7 +414,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: Text('forward', textAlign: TextAlign.center,))
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<ArrowDirection>(
|
||||
const PopupMenuItem<ArrowDirection>(
|
||||
value: ArrowDirection.backward,
|
||||
child: Row( children: [
|
||||
Icon(Icons.arrow_back),
|
||||
@@ -423,7 +422,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: Text('curved', textAlign: TextAlign.center,))
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<ArrowDirection>(
|
||||
const PopupMenuItem<ArrowDirection>(
|
||||
value: ArrowDirection.bidirectionnal,
|
||||
child: Row( children: [
|
||||
Icon(Icons.sync_alt_outlined),
|
||||
@@ -435,16 +434,16 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child:
|
||||
Row( children: [
|
||||
Icon(widget.dashboard.defaultArrowDirection == ArrowDirection.forward ? Icons.arrow_forward : widget.dashboard.defaultArrowDirection == ArrowDirection.backward ? Icons.arrow_back : Icons.sync_alt_outlined, color: Colors.black),
|
||||
Padding( padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
Padding( padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Text(widget.dashboard.defaultArrowDirection == ArrowDirection.forward ? 'forward' : widget.dashboard.defaultArrowDirection == ArrowDirection.backward ? 'backward' : 'bidirectionnal')),
|
||||
Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
const Icon(Icons.arrow_drop_down, size: 10, color: Colors.black) ])
|
||||
),)
|
||||
),
|
||||
]),
|
||||
Row(children: [
|
||||
Tooltip( message: "forward size",
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
width: 150, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
initialValue: "${widget.dashboard.defaultForwardWidth}",
|
||||
@@ -467,14 +466,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
});
|
||||
},
|
||||
style: TextStyle(fontSize: 12),
|
||||
style: const TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||
filled: true,
|
||||
labelText: "forward size",
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
border: OutlineInputBorder(),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
labelStyle: const TextStyle(fontSize: 10),
|
||||
border: const OutlineInputBorder(),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
),
|
||||
inputFormatters: [
|
||||
NumberTextInputFormatter(
|
||||
@@ -491,12 +490,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
],
|
||||
keyboardType: TextInputType.number,
|
||||
))),
|
||||
Padding( padding: EdgeInsets.only(top: 10, left: 5), child: Icon(Icons.arrow_forward, color: Colors.black))
|
||||
const Padding( padding: EdgeInsets.only(top: 10, left: 5), child: Icon(Icons.arrow_forward, color: Colors.black))
|
||||
]),
|
||||
Row(children: [
|
||||
Tooltip( message: "back size",
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
width: 150, height: 25,
|
||||
child: TextFormField( textAlign: TextAlign.center,
|
||||
initialValue: "${widget.dashboard.defaultBackWidth}",
|
||||
@@ -519,14 +518,14 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
});
|
||||
},
|
||||
style: TextStyle(fontSize: 12),
|
||||
style: const TextStyle(fontSize: 12),
|
||||
decoration: InputDecoration(
|
||||
fillColor: widget.dashboard.defaultDashWidth <= 0 ? widget.dashboard.midDashColor : Colors.white,
|
||||
filled: true,
|
||||
labelText: "back size",
|
||||
labelStyle: TextStyle(fontSize: 10),
|
||||
border: OutlineInputBorder(),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
labelStyle: const TextStyle(fontSize: 10),
|
||||
border: const OutlineInputBorder(),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
),
|
||||
inputFormatters: [
|
||||
NumberTextInputFormatter(
|
||||
@@ -543,12 +542,12 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
],
|
||||
keyboardType: TextInputType.number,
|
||||
))),
|
||||
Padding( padding: EdgeInsets.only(top: 10, left: 5), child: Icon(Icons.arrow_back, color: Colors.black))
|
||||
const Padding( padding: EdgeInsets.only(top: 10, left: 5), child: Icon(Icons.arrow_back, color: Colors.black))
|
||||
])
|
||||
])),
|
||||
widget.dashboard.arrowsSelected.isNotEmpty || widget.dashboard.elementSelected.isNotEmpty ? Container(
|
||||
width: 200,
|
||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
decoration: const BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||
Tooltip( message: "remove",
|
||||
child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
@@ -559,13 +558,13 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
}
|
||||
return element.isSelected;
|
||||
}, context);
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
widget.dashboard.flutterChartKey.currentState?.setState(() { });
|
||||
});
|
||||
}, child: Container( margin: EdgeInsets.all(10),
|
||||
}, child: Container( margin: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
||||
width: 200, height: 30,
|
||||
child: Icon(Icons.delete_outline, color: Colors.black),
|
||||
child: const Icon(Icons.delete_outline, color: Colors.black),
|
||||
))
|
||||
),
|
||||
Tooltip( message: "copy",
|
||||
@@ -573,15 +572,15 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
onTap: () {
|
||||
for (var sel in widget.dashboard.elementSelected) {
|
||||
widget.dashboard.addElement(FlowElement.fromMap(widget.dashboard, sel.toMap()), context);
|
||||
widget.dashboard.elements.last.position += Offset(50, 50);
|
||||
widget.dashboard.elements.last.position += const Offset(50, 50);
|
||||
}
|
||||
Future.delayed(Duration(milliseconds: 100), () {
|
||||
Future.delayed( const Duration(milliseconds: 100), () {
|
||||
widget.dashboard.chartKey.currentState?.setState(() { });
|
||||
});
|
||||
}, child: Container( margin: EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
||||
}, child: Container( margin: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.black, width: 1)),
|
||||
width: 200, height: 30,
|
||||
child: Icon(Icons.copy, color: Colors.black),
|
||||
child: const Icon(Icons.copy, color: Colors.black),
|
||||
))
|
||||
),
|
||||
])
|
||||
@@ -594,15 +593,15 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
Container( // SHORTCUT
|
||||
width: 200, height: 50,
|
||||
decoration: BoxDecoration(color: widget.dashboard.midDashColor,
|
||||
border: Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
border: const Border(bottom: BorderSide(color: Colors.grey, width: 1))),
|
||||
child: Row( children: [
|
||||
Tooltip( message: "dashboard information",
|
||||
child: InkWell( onTap: () => setState(() {widget.isDashboardInfo = true; }),
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
child: Container( alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
color: widget.isDashboardInfo ? Colors.grey : widget.dashboard.midDashColor,
|
||||
width: 200 / 2, child: Icon(Icons.info, color: Colors.white))
|
||||
width: 200 / 2, child: const Icon(Icons.info, color: Colors.white))
|
||||
)
|
||||
),
|
||||
Tooltip(
|
||||
@@ -610,9 +609,9 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
child: InkWell( onTap: () => setState(() {widget.isDashboardInfo = false; }),
|
||||
mouseCursor: SystemMouseCursors.click,
|
||||
child: Container( alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
color: !widget.isDashboardInfo ? Colors.grey : widget.dashboard.midDashColor,
|
||||
width: 200 / 2, child: Icon(Icons.format_paint, color: Colors.white)),
|
||||
width: 200 / 2, child: const Icon(Icons.format_paint, color: Colors.white)),
|
||||
)
|
||||
)
|
||||
]
|
||||
@@ -620,7 +619,7 @@ class FlowChartSelectedMenuState extends State<FlowChartSelectedMenu> {
|
||||
),
|
||||
widget.dashboard.error != null ? Container( width: 200, color: Colors.red, padding: EdgeInsets.all(10),
|
||||
child: Center( child: Text(widget.dashboard.error!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 15), textAlign: TextAlign.center))) : Container(),
|
||||
style: const TextStyle(color: Colors.white, fontSize: 15), textAlign: TextAlign.center))) : Container(),
|
||||
w
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -744,8 +744,28 @@ class ArrowPainter extends CustomPainter {
|
||||
return _dashedPathProperties.path;
|
||||
}
|
||||
|
||||
|
||||
bool isLine(Offset position) {
|
||||
bool isLine(Offset point) {
|
||||
final metrics = path.computeMetrics(forceClosed: false);
|
||||
for (final metric in metrics) {
|
||||
final length = metric.length;
|
||||
const steps = 100;
|
||||
for(int i = 0; i <= steps; i++) {
|
||||
final distance = length * i / steps;
|
||||
final tangent = metric.getTangentForOffset(distance);
|
||||
if (tangent != null) {
|
||||
final position = tangent.position;
|
||||
if ((position - point).distance <= 10) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
bool isLine(Offset position, String name) {
|
||||
position = Offset(position.dx, position.dy + 10);
|
||||
print("${position.dx} ${position.dy}");
|
||||
for (double i=-5; i < 5; i++) {
|
||||
for (double y=-5; y < 5; y++) {
|
||||
var pos = position + Offset(i, y);
|
||||
@@ -756,7 +776,7 @@ class ArrowPainter extends CustomPainter {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
*/
|
||||
@override
|
||||
bool? hitTest(Offset position) {
|
||||
/* graphkey?.currentState?.widget.isShowed = isLine(position);
|
||||
|
||||
Reference in New Issue
Block a user