diff --git a/flutter/lib/pages/drawing_page.dart b/flutter/lib/pages/drawing_page.dart index f166d71..c98e583 100644 --- a/flutter/lib/pages/drawing_page.dart +++ b/flutter/lib/pages/drawing_page.dart @@ -11,7 +11,7 @@ Graphs getGraph() { d.add(Dot.fromTwoLists("3", [1, 2], [1, 2])); //d.add(Dot.fromTwoLists("Name1", [], [])); //d.add(Dot.fromTwoLists("Name2", [], [])); - return Graphs.fromList("UMYA", d, true, true); + return Graphs.fromList("Имя", d, true, true); } class DrawingPage extends StatefulWidget { @@ -57,7 +57,7 @@ class _DrawingPageState extends State { ))), toolbarHeight: 110, flexibleSpace: Container( - color: Colors.blue, + color: Colors.green.shade900, child: Column(children: [ const SizedBox(height: 5), Row(children: [ @@ -148,10 +148,13 @@ class _DrawingPageState extends State { ElevatedButton createButton(String txt, void onPressing()) { return ElevatedButton( onPressed: onPressing, + style: ButtonStyle( + backgroundColor: MaterialStateProperty.resolveWith( + (states) => Colors.green.shade700)), child: Text(txt, style: const TextStyle( fontSize: 15, - color: Colors.white, + color: Colors.white70, height: 1, )), ); @@ -244,7 +247,7 @@ class _DrawingPageState extends State { if (_textNumbController.text == "") { showPopUp("Error", "No number in \"Dot number\" box"); } else if (_textDestController.text == "") { - showPopUp("Error", "No name in \"Destination number\" box"); + showPopUp("Error", "No number in \"Destination number\" box"); } else if (_textLnthController.text == "" && graphData.getUseLengthBool()) { showPopUp("Error", "No length in \"Input length\" box"); @@ -368,7 +371,7 @@ class _DrawingPageState extends State { if (_textNumbController.text == "") { showPopUp("Error", "No number in \"Dot number\" box"); } else if (_textDestController.text == "") { - showPopUp("Error", "No name in \"Destination number\" box"); + showPopUp("Error", "No number in \"Destination number\" box"); } else { int? from = int.tryParse(_textNumbController.text); int? to = int.tryParse(_textDestController.text); diff --git a/flutter/lib/src/graph.dart b/flutter/lib/src/graph.dart index 3f6860c..2d90efd 100644 --- a/flutter/lib/src/graph.dart +++ b/flutter/lib/src/graph.dart @@ -537,7 +537,7 @@ class Graphs { } //************Алгоритмы************ - /* bool bfsHasPath(int startDot, int goalDot) { + /* bool bfsHasPath(int startDot, int goalDot) { // обход в ширину startDot--; goalDot--; @@ -629,21 +629,25 @@ class Graphs { List? dfsIterative(int v) { v--; + //List? pos = []; List label = []; for (int i = 0; i < _amount; i++) { label.add(false); } List stack = []; stack.add(v); + //pos.add(v); while (stack.isNotEmpty) { v = stack.removeLast(); if (!label[v]) { label[v] = true; for (int i in _dots[v].getL().keys) { stack.add(i - 1); + //pos.add(i); } } } + //print(pos); return label; }