Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBananaPants committed Mar 12, 2021
1 parent d4aeca2 commit f3c0f44
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,42 +55,9 @@ class BodyOfAppState extends State<BodyOfApp> {
get(url);
}

void changeStateToAAN() => buttonStatus = true;
void changeStateToUIT() => buttonStatus = false;

void changeStateToTRAAG() => buttonSnelheid = true;
void changeStateToSNEL() => buttonSnelheid = false;

void changeStateToOMHOOG() => buttonRichting = true;
void changeStateToOMLAAG() => buttonRichting = false;

void resetPressed() {
get(requestURL[0]);
get(requestURL[3]);
get(requestURL[5]);

buttonStatus = false;
buttonSnelheid = true;
buttonRichting = true;
}

var requestURLIndex = 0;
var requestURL = [
'http://192.168.4.1/StarTrackerMainAan',
'http://192.168.4.1/StarTrackerMainUit',
'http://192.168.4.1/SpeedTraag',
'http://192.168.4.1/SpeedSnel',
'http://192.168.4.1/RichtingOmhoog',
'http://192.168.4.1/RichtingOmlaag',
];

double latitude;
double longitude;

bool buttonStatus = true;
bool buttonSnelheid = false;
bool buttonRichting = false;

void getLocation() async {
Position location = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);

Expand Down Expand Up @@ -137,6 +104,39 @@ class BodyOfAppState extends State<BodyOfApp> {
}
}

void changeStateToAAN() => buttonStatus = true;
void changeStateToUIT() => buttonStatus = false;

void changeStateToTRAAG() => buttonSnelheid = true;
void changeStateToSNEL() => buttonSnelheid = false;

void changeStateToOMHOOG() => buttonRichting = true;
void changeStateToOMLAAG() => buttonRichting = false;

void resetPressed() {
get(requestURL[0]);
get(requestURL[3]);
get(requestURL[5]);

buttonStatus = false;
buttonSnelheid = true;
buttonRichting = true;
}

var requestURLIndex = 0;
var requestURL = [
'http://192.168.4.1/StarTrackerMainAan',
'http://192.168.4.1/StarTrackerMainUit',
'http://192.168.4.1/SpeedTraag',
'http://192.168.4.1/SpeedSnel',
'http://192.168.4.1/RichtingOmhoog',
'http://192.168.4.1/RichtingOmlaag',
];

bool buttonStatus = true;
bool buttonSnelheid = false;
bool buttonRichting = false;

@override
Widget build(BuildContext context) {
SizeConfig().init(context);
Expand Down

0 comments on commit f3c0f44

Please sign in to comment.