Skip to content

Instantly share code, notes, and snippets.

@iamriajul
Last active August 29, 2020 14:43
Show Gist options
  • Save iamriajul/d02c376c1617ec7579d9ac014f47d320 to your computer and use it in GitHub Desktop.
Save iamriajul/d02c376c1617ec7579d9ac014f47d320 to your computer and use it in GitHub Desktop.
@override
void initState() {
getLocationData().then((locationData) {
if (mounted) {
return;
}
if (locationData != null) {
setState(() {
prayerTimes = PrayerTimes(
Coordinates(locationData.latitude, locationData.longitude),
DateComponents.from(DateTime.now()),
CalculationMethod.karachi.getParameters());
});
} else {
setState(() {
locationError = "Couldn't Get Your Location!";
});
}
});
super.initState();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment