Page MenuHomec4science

Ac1.dart
No OneTemporary

File Metadata

Created
Wed, Jul 31, 19:26

Ac1.dart

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:student/widgets/onlineRobotMap.Dart';
import 'package:student/widgets/celluloMap.Dart';
import 'dart:async';
import 'dart:convert';
import 'package:student/Database.dart';
import 'package:student/model/Group.dart';
import 'package:student/model/Cellulo.dart';
import 'package:student/widgets/showAlertDialog.Dart';
import 'package:student/widgets/membersBar.Dart';
import 'package:student/widgets/inactivityDetector.Dart';
import 'package:flutter_appavailability/flutter_appavailability.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:map_controller/map_controller.dart';
import 'package:student/widgets/mapShapeMaker.dart';
import 'dart:math' as math;
import 'package:audioplayers/audioplayers.dart';
import 'package:audioplayers/audio_cache.dart';
class Ac1 extends StatefulWidget {
Ac1({Key key}) : super(key: key);
@override
_Ac1State createState() => _Ac1State();
}
class _Ac1State extends State<Ac1> {
// Activity_Independent
AudioPlayer audioPlugin = AudioPlayer();
AudioPlayer advancedPlayer = AudioPlayer();
static AudioCache cache = AudioCache();
AudioPlayer player;
bool isPlaying = false;
bool isPaused = false;
var elapseTimer = new Stopwatch();
Timer timerCelluloPosition;
Timer timerCheckCelluloGame;
int currentTurn = 1;
bool enterBorderX = false;
bool enterBorderY = false;
bool enterBorderpolygonX = false;
bool enterBorderpolygonY = false;
bool enterBorderRectX = false;
bool enterBorderRectY = false;
bool reachendX = false;
bool reachendY = false;
bool gameoverX = false;
bool gameoverY = false;
Timer timerCelluloPositiontoserver;
// Celulo
var celluloxPosition = [0.0, 0.0];
var celluloyPosition = [0.0, 0.0];
var prevcelluloxPosition = [0.0, 0.0];
var prevcelluloyPosition = [0.0, 0.0];
var celluloxVelocity = [0.0, 0.0];
var celluloyVelocity = [0.0, 0.0];
List<double> celluloxPositiontopaint = [0.0, 0.0];
List<double> celluloyPositiontopaint = [0.0, 0.0];
bool addtoprint;
AnimationController controllerRobotPath;
Animation<double> animationRobotPath;
// Learning
List<int> mistakesSlope = [0, 0, 0];
List<int> mistakesIntrepet = [0, 0, 0];
List<int> mistakesInitialPosition = [0, 0, 0];
List<int> trapped = [0];
int scoreX = 6;
int scoreY = 6;
int trappedCircleX;
int trappedCircleY;
int trappedRectangleX;
int trappedRectangleY;
int trappedPolygonX;
int trappedPolygonY;
//Activity Dependent
double radiuosStart = 45;
String activityTitle = 'Activity 1';
var linesPath = [
'assets/images/Ac7_function1.svg',
'assets/images/Ac7_function2.svg',
'assets/images/Ac7_function3.svg',
'assets/images/GridOnlyPositive.svg',
];
List<int> progress = [0, -2, -2];
List<int> progressElpasedTime = [0, 0, 0];
int inactivity = 0;
int tapCounter = 0;
var startPoint = ['C', 'A', 'C'];
var endPoint = ['B', 'D', 'B'];
var startPointorder = [2, 0, 2];
var endPointorder = [1, 3, 1];
var pointOrder = ['A', 'B', 'C', 'D'];
static List<Offset> pointPosition = [
Offset(80, 80),
Offset(760, 80),
Offset(80, 760),
Offset(760, 760)
];
// map-related
final double mapSizeWidth = 860;
final double mapSizeHeight = 860;
Offset startpoint = mapShape[0]['startCenter'];
double coeffScreenMapWidth;
double coeffScreenMapHeight;
final String mapPath = 'assets/images/GridOnlyPositive.svg';
var overlayPolygons = <Polygon>[
Polygon(points: [
LatLng(0.0, 0.0),
LatLng(30.0, 0.0),
LatLng(30.0, 30.0),
LatLng(0.0, 30.0)
], color: Colors.blue)
];
static var mapShape = [
{
'numCircles': 4,
'originCircles': [
Offset(390, 300),
Offset(190, 470),
Offset(60, 560),
Offset(560, 690)
],
'radiuosCircles': [60.0, 70.0, 60.0, 60.0],
'numRectangles': 2,
'originRectangles': [Offset(300, 30), Offset(600, 430)],
'widthRectangles': [150.0, 100.0],
'heightRectangles': [50.0, 250.0],
'numPolygons': 2,
'sidesofPolygon': [3, 3, 5, 4, 4],
'radiusPolygon': [60.0, 70.0, 70.0, 60.0, 80.0],
'centerPolygon': [
Offset(60, 230),
Offset(600, 90),
Offset(600, 250),
Offset(600, 500),
Offset(780, 400)
],
'startCenter': pointPosition[2],
'endCenter': pointPosition[1]
},
{
'numCircles': 2,
'originCircles': [
Offset(380, 320),
Offset(460, 690),
],
'radiuosCircles': [60.0, 70.0],
'numRectangles': 3,
'originRectangles': [
Offset(100, 500),
Offset(700, 560),
Offset(500, 360)
],
'widthRectangles': [150.0, 100.0, 80.0],
'heightRectangles': [50.0, 250.0, 230.0],
'numPolygons': 2,
'sidesofPolygon': [3, 5, 4, 4],
'radiusPolygon': [70.0, 80.0, 70.0, 70.0],
'centerPolygon': [
Offset(300, 90),
Offset(600, 60),
Offset(500, 650),
Offset(780, 300)
],
'startCenter': pointPosition[0],
'endCenter': pointPosition[3]
},
{
'numCircles': 2,
'originCircles': [
Offset(260, 170),
Offset(690, 360),
Offset(690, 590),
],
'radiuosCircles': [80.0, 70.0, 70.0],
'numRectangles': 2,
'originRectangles': [Offset(500, 30), Offset(350, 560)],
'widthRectangles': [150.0, 100.0],
'heightRectangles': [80.0, 300.0],
'numPolygons': 2,
'sidesofPolygon': [3, 4, 4],
'radiusPolygon': [70.0, 90.0, 80.0],
'centerPolygon': [
Offset(40, 630),
Offset(70, 390),
Offset(620, 220),
],
'startCenter': pointPosition[2],
'endCenter': pointPosition[1]
},
];
var mapHit = [
{
'Circles': [0, 0, 0, 0, 0, 0],
'Rectangles': [0, 0, 0, 0, 0],
'Polygons': [0, 0, 0, 0, 0, 0],
},
{
'Circles': [0, 0, 0, 0, 0, 0],
'Rectangles': [0, 0, 0, 0, 0],
'Polygons': [0, 0, 0, 0, 0, 0],
},
{
'Circles': [0, 0, 0, 0, 0, 0],
'Rectangles': [0, 0, 0, 0, 0],
'Polygons': [0, 0, 0, 0, 0, 0],
},
];
Timer timerEnagagement;
Future loadMusic() async {
advancedPlayer = await AudioCache().loop("music/song3.mp3");
}
@override
void initState() {
super.initState();
loadMusic();
cellulox.setGoalPosition(startpoint.dx, startpoint.dy, 150);
cellulox.setGoalPosition(startpoint.dx + 10, startpoint.dy + 50, 150);
dbRef.child('groups').child(group.id).child('tabletStatus').set("YES");
dbRef.child('groups').child(group.id).child('currentActivity').set("Ac1");
elapseTimer.start();
timerCelluloPosition =
new Timer.periodic(new Duration(milliseconds: 100), (time) {
var xxprev = celluloxPosition[0];
var xyprev = celluloxPosition[1];
var yxprev = celluloyPosition[0];
var yyprev = celluloyPosition[1];
if (totalRobots() > 1) {
// print(cellulox.getrobotKidnapped().toString());
// print(celluloy.getrobotKidnapped().toString());
cellulox.getrobotx().then((val) => setState(() {
if (val != null) {
group.cellulox.traveledDistance =
group.cellulox.traveledDistance +
(val - celluloxPosition[0]);
celluloxPosition[0] = val;
// print(celluloxPosition[0]);
if (addtoprint == true) celluloxPositiontopaint.add(val);
}
// print(addtoprint.toString());
}));
cellulox.getroboty().then((val) => setState(() {
if (val != null) {
celluloxPosition[1] = val;
group.cellulox.traveledDistance =
group.cellulox.traveledDistance +
math.sqrt(math.pow((xxprev - celluloxPosition[0]), 2) +
math.pow((xyprev - celluloxPosition[1]), 2)) /
20;
}
}));
celluloy.getrobotx().then((val) => setState(() {
if (val != null) {
celluloyPosition[0] = val;
}
}));
celluloy.getroboty().then((val) => setState(() {
if (val != null) {
group.celluloy.traveledDistance =
group.celluloy.traveledDistance +
math.sqrt(math.pow((yxprev - celluloyPosition[0]), 2) +
math.pow((yyprev - celluloyPosition[1]), 2)) /
20;
celluloyPosition[1] = val;
if (addtoprint == true) celluloyPositiontopaint.add(val);
}
}));
if (celluloxPosition[0] > 800 || celluloyPosition[1] > 800) {
cellulox.setVelocity(0, 0);
celluloy.setVelocity(0, 0);
}
}
});
timerCelluloPositiontoserver =
new Timer.periodic(new Duration(milliseconds: 800), (time) {
dbRef.child("celluloPosition").push().set(json.encode({
"x": 0.0,
"y": 0.0,
"xx": celluloxPosition[0],
"xy": celluloxPosition[1],
"yx": celluloyPosition[0],
"yy": celluloyPosition[1],
"acID": "Ac1",
"turn": currentTurn,
"groupID": group.id,
}));
});
timerCheckCelluloGame =
new Timer.periodic(new Duration(milliseconds: 500), (time) {
setState(() {
checkCelluloGame(
mapShape[currentTurn - 1],
Offset((celluloxPosition[0]), (celluloxPosition[1])),
Offset(celluloxPosition[0], celluloxPosition[1]),
Offset(celluloyPosition[0], celluloyPosition[1]),
0);
checkCelluloGame(
mapShape[currentTurn - 1],
Offset((celluloyPosition[0]), (celluloyPosition[1])),
Offset(celluloxPosition[0], celluloxPosition[1]),
Offset(celluloyPosition[0], celluloyPosition[1]),
1);
});
});
onDataSend();
}
void colorRobots() {
for (int i = 0; i < 6; i++) {
cellulox.setColor(0, 0, 0, 0, 0);
}
for (int i = 0; i < scoreX; i++) {
cellulox.setColor(0, 255, 0, 1, i);
}
for (int i = 0; i < 6; i++) {
celluloy.setColor(0, 0, 0, 0, 0);
}
for (int i = 0; i < scoreY; i++) {
celluloy.setColor(0, 0, 255, 1, i);
}
}
void onDataSend() {
dbRef.child('attempts').push().set(json.encode({
"numAttempts": tapCounter,
"groupID": group.id,
"acID": "Ac1",
"engagementX": group.cellulox.traveledDistance,
"engagementY": group.celluloy.traveledDistance,
"elpasedTime": elapseTimer.elapsedMilliseconds -
progressElpasedTime[currentTurn - 1],
"progress": {
"turn1": progress[0],
"turn2": progress[1],
"turn3": progress[2]
},
"progressElpasedTime": {
"turn1": progressElpasedTime[0],
"turn2": progressElpasedTime[1],
"turn3": progressElpasedTime[2],
},
"currentTurn": currentTurn,
"inactivity": inactivity,
"mistakes": {
"turn1": {
"slope": mistakesSlope[0],
"initialPoint": mistakesInitialPosition[0]
},
"turn2": {
"slope": mistakesSlope[1],
"initialPoint": mistakesInitialPosition[1]
},
"turn3": {
"slope": mistakesSlope[2],
"initialPoint": mistakesInitialPosition[2]
},
}
}));
}
void playHandler(String songpath) async {
player = await cache.play(songpath);
}
void pauseHandler() {
if (isPaused && isPlaying) {
player.resume();
} else {
player.pause();
}
setState(() {
isPaused = !isPaused;
});
}
void checkCelluloGame(var mapShape, Offset celluloTargetPosition,
Offset celluloXPosition, Offset celluloYPosition, int id) {
var insideBorder = false;
var insideShape = false;
final double coeffHaptic = 10;
double radiuosBorder = 40;
bool enterShape = false;
var XVelocityCelluloX;
var YVelocityCelluloX;
var XVelocityCelluloY;
var YVelocityCelluloY;
double celluloXYdistances = math.sqrt(
math.pow((celluloXPosition.dx - celluloYPosition.dx), 2) +
math.pow((celluloXPosition.dy - celluloYPosition.dy), 2));
double distanceThreshold = 120;
//print(score.toString());
//print(enterBorder.toString());
if (celluloXYdistances < distanceThreshold) {
cellulox.robotVibrate(10, 10, 0, 100, 100);
celluloy.robotVibrate(10, 10, 0, 100, 100);
// cellulox.setVelocity(-celluloxVelocity[0], -celluloxVelocity[1]);
// celluloy.setVelocity(-celluloyVelocity[0], -celluloyVelocity[1]);
}
var distancePointCenter = math.sqrt(math.pow(
(celluloTargetPosition.dx - mapShape['startCenter'].dx), 2) +
math.pow((celluloTargetPosition.dy - mapShape['startCenter'].dy), 2));
if (distancePointCenter <= radiuosStart) {
if (id == 0) {
scoreX = 6;
reachendX = false;
gameoverX = false;
// onDataSend();
}
if (id == 1) {
scoreY = 6;
reachendY = false;
gameoverY = false;
// onDataSend();
}
}
if (scoreX <= 0 && gameoverX == false) {
tapCounter = tapCounter + 1;
gameoverX = true;
onDataSend();
playHandler('images/gameover.mp3');
showAlertDialog(context, 'Red Robot Does not have energy',
'Tell your friend with Red Robot to go start point');
}
if (scoreY <= 0 && gameoverY == false) {
tapCounter = tapCounter + 1;
onDataSend();
gameoverY = true;
playHandler('images/gameover.mp3');
showAlertDialog(context, 'BLue Robot Does not have energy',
'Tell your friend with Blue Robot to go start point');
}
var distancePointEnd = math.sqrt(
math.pow((celluloTargetPosition.dx - mapShape['endCenter'].dx), 2) +
math.pow((celluloTargetPosition.dy - mapShape['endCenter'].dy), 2));
if (distancePointEnd <= radiuosStart) {
if (id == 0 && reachendX == false) {
// scoreX = -1;
playHandler('images/win.mp3');
showAlertDialog(context, 'Red Robot reached the goal point',
'Tell your friend to start again or when both robots reached the end, you can go to next turn.');
onDataSend();
reachendX = true;
}
if (id == 1 && reachendY == false) {
showAlertDialog(context, 'Blue Robot reached the goal point',
'Tell your friend to start again or when both robots reached the end, you can go to next turn.');
onDataSend();
reachendY = true;
playHandler('images/win.mp3');
}
}
for (int i = 0; i < mapShape['numCircles']; i++) {
var distancePointCenter = math.sqrt(math.pow(
(celluloTargetPosition.dx - mapShape['originCircles'][i].dx), 2) +
math.pow(
(celluloTargetPosition.dy - mapShape['originCircles'][i].dy), 2));
if (distancePointCenter <=
mapShape['radiuosCircles'][i] + radiuosBorder) {
insideBorder = true;
XVelocityCelluloX = coeffHaptic *
(celluloXPosition.dx - mapShape['originCircles'][i].dx);
YVelocityCelluloX = coeffHaptic *
(celluloXPosition.dy - mapShape['originCircles'][i].dy);
XVelocityCelluloY = coeffHaptic *
(celluloYPosition.dx - mapShape['originCircles'][i].dx);
YVelocityCelluloY = coeffHaptic *
(celluloYPosition.dy - mapShape['originCircles'][i].dy);
if (id == 0) cellulox.setVelocity(XVelocityCelluloX, YVelocityCelluloX);
if (id == 1) celluloy.setVelocity(XVelocityCelluloY, YVelocityCelluloY);
if (id == 0) {
if (enterBorderX == false) {
scoreX = scoreX - 1;
playHandler('images/smb_breakblock.mp3');
enterBorderX = true;
}
trappedCircleX = i;
}
if (id == 1) {
if (enterBorderY == false) {
scoreY = scoreY - 1;
playHandler('images/smb_breakblock.mp3');
enterBorderY = true;
}
trappedCircleY = i;
}
break;
} else if (id == 0 && i == trappedCircleX) {
enterBorderX = false;
} else if (id == 1 && i == trappedCircleY) {
enterBorderY = false;
}
/*
insideBorder = false;
if (distancePointCenter <= mapShape['radiuosCircles'][i]) {
insideShape = true;
} else {
insideShape = false;
enterShape = false;
}
if (insideShape == true) {
if (enterShape == false) {
score = score - 1;
enterShape = true;
}
}
*/
}
for (int i = 0; i < mapShape['numRectangles']; i++) {
if ((Rect.fromCenter(
center: Offset(mapShape['originRectangles'][i].dx,
mapShape['originRectangles'][i].dy),
width: mapShape['widthRectangles'][i],
height: mapShape['heightRectangles'][i])
.contains(celluloTargetPosition) ==
true)) {
insideBorder = true;
XVelocityCelluloX = coeffHaptic *
(celluloXPosition.dx - mapShape['originRectangles'][i].dx);
YVelocityCelluloX = coeffHaptic *
(celluloXPosition.dy - mapShape['originRectangles'][i].dy);
XVelocityCelluloY = coeffHaptic *
(celluloYPosition.dx - mapShape['originRectangles'][i].dx);
YVelocityCelluloY = coeffHaptic *
(celluloYPosition.dy - mapShape['originRectangles'][i].dy);
if (id == 0) cellulox.setVelocity(XVelocityCelluloX, YVelocityCelluloX);
if (id == 1) celluloy.setVelocity(XVelocityCelluloY, YVelocityCelluloY);
if (id == 0) {
if (enterBorderRectX == false) {
scoreX = scoreX - 1;
playHandler('images/smb_breakblock.mp3');
enterBorderRectX = true;
}
trappedRectangleX = i;
}
if (id == 1) {
if (enterBorderRectY == false) {
scoreY = scoreY - 1;
playHandler('images/smb_breakblock.mp3');
enterBorderRectY = true;
}
trappedRectangleY = i;
}
break;
} else if (id == 0 && i == trappedRectangleX) {
enterBorderRectX = false;
} else if (id == 1 && i == trappedRectangleY) {
enterBorderRectY = false;
}
// if (id == 0) cellulox.clearrobot();
//if (id == 1) celluloy.clearrobot();
}
for (int i = 0; i < mapShape['numPolygons']; i++) {
var distancePointCenter = math.sqrt(math.pow(
(celluloTargetPosition.dx - mapShape['centerPolygon'][i].dx), 2) +
math.pow(
(celluloTargetPosition.dy - mapShape['centerPolygon'][i].dy), 2));
if (distancePointCenter <= mapShape['radiusPolygon'][i] + radiuosBorder) {
insideBorder = true;
XVelocityCelluloX = coeffHaptic *
(celluloXPosition.dx - mapShape['centerPolygon'][i].dx);
YVelocityCelluloX = coeffHaptic *
(celluloXPosition.dy - mapShape['centerPolygon'][i].dy);
XVelocityCelluloY = coeffHaptic *
(celluloYPosition.dx - mapShape['centerPolygon'][i].dx);
YVelocityCelluloY = coeffHaptic *
(celluloYPosition.dy - mapShape['centerPolygon'][i].dy);
if (id == 0) cellulox.setVelocity(XVelocityCelluloX, YVelocityCelluloX);
if (id == 1) celluloy.setVelocity(XVelocityCelluloY, YVelocityCelluloY);
if (id == 0) {
if (enterBorderpolygonX == false) {
scoreX = scoreX - 1;
playHandler('images/smb_breakblock.mp3');
enterBorderpolygonX = true;
}
trappedPolygonX = i;
}
if (id == 1) {
if (enterBorderpolygonY == false) {
scoreY = scoreY - 1;
playHandler('images/smb_breakblock.mp3');
enterBorderpolygonY = true;
}
trappedPolygonY = i;
}
break;
} else if (id == 0 && i == trappedPolygonX) {
enterBorderpolygonX = false;
} else if (id == 1 && i == trappedPolygonY) {
enterBorderpolygonY = false;
}
}
if (enterBorderX == false &&
enterBorderRectX == false &&
enterBorderpolygonX == false &&
id == 0) cellulox.clearrobot();
if (enterBorderY == false &&
enterBorderRectY == false &&
enterBorderpolygonY == false &&
id == 1) celluloy.clearrobot();
colorRobots();
}
void calcVelocity() {
celluloxVelocity[0] = celluloxPosition[0] - prevcelluloxPosition[0];
celluloxVelocity[1] = celluloxPosition[1] - prevcelluloxPosition[1];
celluloyVelocity[0] = celluloyPosition[0] - prevcelluloyPosition[0];
celluloyVelocity[1] = celluloyPosition[1] - prevcelluloyPosition[1];
prevcelluloxPosition = celluloxPosition;
prevcelluloyPosition = celluloyPosition;
}
@override
void dispose() {
advancedPlayer = null;
cellulox.resetrobot();
celluloy.resetrobot();
timerCelluloPosition.cancel();
timerCheckCelluloGame.cancel();
elapseTimer.stop();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Avoid the hidden obstacles'),
actions: <Widget>[
Padding(
padding: EdgeInsets.only(right: 20.0),
child: GestureDetector(
onTap: () {
group.prevActivity = 'Ac1';
group.currentActivity = 'Ac61';
group.navigatorKeygame.currentState.pushReplacementNamed(
group.currentActivity,
);
// print('ff');
},
child: Icon(Icons.help),
)),
],
),
backgroundColor: Colors.white,
body: SingleChildScrollView(
child: Column(children: <Widget>[
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
Container(
height: 70,
width: 600,
child: Card(
color: Colors.lightBlue,
child: ListTile(
title: Text(
'Guide your friedns to go from point ' +
startPoint[currentTurn - 1].toString() +
' to ' +
endPoint[currentTurn - 1].toString(),
style: new TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
)),
SizedBox(width: 20),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(100)),
color: Colors.blue),
child: FlatButton(
child: Text(
"Next Turn",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 18),
),
onPressed: () => {
tapCounter = 0,
startpoint = mapShape[currentTurn - 1]['startCenter'],
if (currentTurn <= 2)
{
cellulox.setGoalPosition(
startpoint.dx, startpoint.dy, 150),
cellulox.setGoalPosition(
startpoint.dx + 10, startpoint.dy + 50, 150),
setState(() {
currentTurn = currentTurn + 1;
}),
progress[currentTurn - 2] = 1,
// controller.reset(),
progress[currentTurn - 1] = 0,
onDataSend(),
}
else
{
progress[2] = 1,
onDataSend(),
showAlertDialog(
group.navigatorKeygame.currentState.context,
'Wait for teacher',
'Game has finished! ')
.then(group.isAlertShown = false),
},
},
)),
]),
SizedBox(
height: 50,
),
Container(
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).size.height * 0.65,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(100)),
// color: Colors.blue
),
child: Stack(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).size.height * 0.65,
child: CustomPaint(
//size: Size(200, 200),
painter:
//LinePainter2(celluloxPositiontopaint, celluloyPositiontopaint),
MapShapeMaker(
pointPosition,
MediaQuery.of(context).size.width *
0.9 /
mapSizeWidth,
MediaQuery.of(context).size.height *
0.65 /
mapSizeHeight,
mapShape[currentTurn - 1]['numRectangles'],
mapShape[currentTurn - 1]['originRectangles'],
mapShape[currentTurn - 1]['widthRectangles'],
mapShape[currentTurn - 1]['heightRectangles'],
mapShape[currentTurn - 1]['numCircles'],
mapShape[currentTurn - 1]['originCircles'],
mapShape[currentTurn - 1]['radiuosCircles'],
mapShape[currentTurn - 1]['numPolygons'],
mapShape[currentTurn - 1]['sidesofPolygon'],
mapShape[currentTurn - 1]['radiusPolygon'],
mapShape[currentTurn - 1]['centerPolygon'],
mapShape[currentTurn - 1]['startCenter'],
mapShape[currentTurn - 1]['endCenter']),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).size.height * 0.65,
child: Align(
alignment: Alignment(
2 * ((celluloxPosition[0]) / mapSizeWidth) - 1,
2 * ((celluloxPosition[1]) / mapSizeHeight) - 1),
child: Card(
child: SvgPicture.asset("assets/images/celluloRed.svg",
height: 60, width: 60),
),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).size.height * 0.65,
child: Align(
alignment: Alignment(
2 * ((celluloyPosition[0]) / mapSizeWidth) - 1,
2 * ((celluloyPosition[1]) / mapSizeHeight) - 1),
child: Card(
child: SvgPicture.asset("assets/images/celluloBlue.svg",
height: 60, width: 60),
),
),
),
],
)),
SizedBox(
height: 45,
),
MembersBar(
curTurn: currentTurn,
),
])));
}
}

Event Timeline