File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,23 @@ 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).generateMaze ();
40+ },
41+ child: const RegularText (StringsManager .generateMaze),
42+ );
43+ },
44+ ),
3545 Consumer (
3646 builder: (context, ref, _) {
3747 return TextButton (
3848 onPressed: () {
3949 ref.read (gridNotifierProvider.notifier).performDijkstra ();
4050 },
41- child: const RegularText ("Start Dijkstra" ),
51+ child: const RegularText ("Dijkstra" ),
4252 );
4353 },
4454 ),
@@ -48,13 +58,16 @@ class GridPage extends StatelessWidget {
4858 onPressed: () {
4959 ref.read (gridNotifierProvider.notifier).performBFS ();
5060 },
51- child: const RegularText ("Start BFS" ),
61+ child: const RegularText ("BFS" ),
5262 );
5363 },
5464 ),
5565 Consumer (
5666 builder: (context, ref, _) {
5767 return TextButton (
68+ onLongPress: () {
69+ ref.read (gridNotifierProvider.notifier).clearTheGrid (keepWall: true );
70+ },
5871 onPressed: () {
5972 ref.read (gridNotifierProvider.notifier).clearTheGrid ();
6073 },
You can’t perform that action at this time.
0 commit comments