File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ BorderDirectional _thineVerticalBorder() => BorderDirectional(
2121 top: _borderSide (true ),
2222 start: _borderSide (true ),
2323 end: _borderSide (true ),
24- bottom: _borderSide (true ),
24+ bottom: _borderSide (true ),
2525 );
2626
2727class GridPage extends StatelessWidget {
@@ -32,6 +32,16 @@ class GridPage extends StatelessWidget {
3232 return Scaffold (
3333 appBar: AppBar (
3434 actions: [
35+ Consumer (
36+ builder: (context, ref, _) {
37+ return TextButton (
38+ onPressed: () {
39+ ref.read (gridNotifierProvider.notifier).performDijkstra ();
40+ },
41+ child: const RegularText ("Start Dijkstra" ),
42+ );
43+ },
44+ ),
3545 Consumer (
3646 builder: (context, ref, _) {
3747 return TextButton (
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ class GridNotifierCubit extends StateNotifier<GridNotifierState> {
215215 // for marking the current grid as visited
216216 if (gridData[currentIndex] != GridStatus .startPoint &&
217217 gridData[currentIndex] != GridStatus .targetPoint) {
218- gridData[currentIndex] = GridStatus .filledSearcher ;
218+ gridData[currentIndex] = GridStatus .searcher ;
219219 state = state.copyWith (gridData: List <GridStatus >.from (gridData));
220220 await Future .delayed (drawSearcherDuration);
221221 }
@@ -276,7 +276,7 @@ class GridNotifierCubit extends StateNotifier<GridNotifierState> {
276276 // Visualize the search process
277277 if (gridData[neighborIndex] != GridStatus .startPoint &&
278278 gridData[neighborIndex] != GridStatus .targetPoint) {
279- gridData[neighborIndex] = GridStatus .filledSearcher ;
279+ gridData[neighborIndex] = GridStatus .searcher ;
280280 state = state.copyWith (gridData: List <GridStatus >.from (gridData));
281281 await Future .delayed (drawSearcherDuration);
282282 }
You can’t perform that action at this time.
0 commit comments