From 2422274ea35ddc4f52d6f5989f1d0fdd2de95831 Mon Sep 17 00:00:00 2001 From: lnd212 Date: Tue, 9 Nov 2021 04:15:36 +0400 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D1=81?= =?UTF-8?q?=20=D1=86=D0=B2=D0=B5=D1=82=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flutter/lib/pages/drawing_page.dart | 13 ++++++++----- flutter/lib/src/graph.dart | 6 +++++- 2 files changed, 13 insertions(+), 6 deletions(-) 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; }