Skip to content

Commit

Permalink
fixed bug & switch order on starting screen
Browse files Browse the repository at this point in the history
  • Loading branch information
KhalidIshani committed Apr 22, 2021
1 parent 94404d4 commit fbbc55c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/Maze.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ class gameButtonState extends State<gameButton> {

void newMaze()
{
fillMaze();
resetGame();
fillMaze();
}

//function executed when any button pressed
Expand Down
5 changes: 4 additions & 1 deletion lib/PathGeneration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'main.dart';

void fillMaze() {

mat= [for(var i=0; i<100;i++) i];
path= genPath(mat);
//clear board
for (int i = 0; i < 100; i++) {
Expand Down Expand Up @@ -106,8 +107,10 @@ List genPath(List mat) {
return path;
}


List<int>mat= [for(var i=0; i<100;i++) i];






8 changes: 4 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ int recentMove; //records last move of user regardless of corectness

void main() {
//manually fill in maze
//for(var i=0; i<19; i++)
//{
//maze1.button_grid[path[i]].onPath=1;
//}
/*for(var i=0; i<19; i++)
{
maze1.button_grid[path[i]].onPath=1;
}*/

for(int j=0; j<27; j++) {
(maze1.button_grid[path[j]]).onPath=1;
Expand Down
27 changes: 14 additions & 13 deletions lib/startingScreen.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'main.dart';
import 'Maze.dart';
import 'MazeTest.dart';
import 'detection.dart';
//import 'detection.dart';

class startingScreen extends StatefulWidget {
@override
Expand All @@ -31,27 +32,29 @@ class startingScreenState extends State<startingScreen> {
),
Row(
children: <Widget>[

Column(
children: <Widget>[
Container(
margin:EdgeInsets.all(10.0),
margin:EdgeInsets.symmetric(horizontal:45.0,vertical: 10.0),
child: SizedBox(
width:55.0,
height:55.0,
child: new RaisedButton(
child: new FlatButton(
color: Colors.blue,
padding: EdgeInsets.all(0.0),
child: Image.asset("assets/mazeimage2.PNG", fit:BoxFit.fill),
onPressed:() {
Navigator.push(
context,
new MaterialPageRoute(builder: (context) => maze1),
new MaterialPageRoute(builder: (context) => maze2),
);
}
)
),
),
Container(
child: new Text("GMT-10x10", style:new TextStyle(color:Colors.white)),
child: new Text("GMT-6x6", style:new TextStyle(color:Colors.white)),
)

],
Expand All @@ -60,32 +63,30 @@ class startingScreenState extends State<startingScreen> {
Column(
children: <Widget>[
Container(
margin:EdgeInsets.symmetric(horizontal:45.0,vertical: 10.0),
margin:EdgeInsets.all(10.0),
child: SizedBox(
width:55.0,
height:55.0,
child: new FlatButton(
color: Colors.blue,
child: new RaisedButton(
padding: EdgeInsets.all(0.0),
child: Image.asset("assets/mazeimage2.PNG", fit:BoxFit.fill),
onPressed:() {
Navigator.push(
context,
new MaterialPageRoute(builder: (context) => maze2),
new MaterialPageRoute(builder: (context) => maze1),
);
}
)
),
),
Container(
child: new Text("GMT-6x6", style:new TextStyle(color:Colors.white)),
child: new Text("GMT-10x10", style:new TextStyle(color:Colors.white)),
)

],
),


Column(
/*Column(
children: <Widget>[
Container(
margin:EdgeInsets.symmetric(horizontal:45.0,vertical: 10.0),
Expand All @@ -108,9 +109,9 @@ class startingScreenState extends State<startingScreen> {
Container(
child: new Text("DetectionTask", style:new TextStyle(color:Colors.white)),
)

],
),
*/

],
)
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.27"
version: "1.6.28"
path_provider_linux:
dependency: transitive
description:
Expand Down

0 comments on commit fbbc55c

Please sign in to comment.