Skip to content

Commit

Permalink
UI Changes + Service Timer : 5min
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravxdhingra committed May 25, 2021
1 parent 60ca02c commit e17300f
Show file tree
Hide file tree
Showing 9 changed files with 460 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class MyService : Service() {
check()
}
}
timer!!.schedule(timerTask, 20 * 1000, 1 * 60 * 1000)
// TODO: TIMER -> RELEASE
timer!!.schedule(timerTask, 5 * 60 * 1000, 5 * 60 * 1000)
}

private fun stopTimerTask() {
Expand Down Expand Up @@ -124,6 +125,7 @@ class MyService : Service() {
override fun onResponse(call: Call<Model>, response: Response<Model>) {
if (response.isSuccessful) {
Log.d("myCHECK", "response successful --> ")

val model = response.body()!!
if(model.centers == null) {
Log.d("myCHECK", "centers null")
Expand All @@ -145,6 +147,11 @@ class MyService : Service() {
if(flag) {
break
}
// else{
//// TODO: REMOVE THIS ELSE IN RELEASE
// notifyUser("Vaccines Not Available!", "We'll notify you once vaccines are available!")
// break
// }
}
} else {
Log.d("myCHECK", "response not successful --> " + response.raw())
Expand Down Expand Up @@ -176,6 +183,11 @@ class MyService : Service() {
if(flag) {
break
}
// else{
//// TODO: REMOVE THIS ELSE IN RELEASE
// notifyUser("Vaccines Not Available!", "We'll notify you once vaccines are available!")
// break
// }
}
} else {
Log.d("myCHECK", "response not successful --> " + response.raw())
Expand Down Expand Up @@ -315,7 +327,7 @@ class MyService : Service() {
return NotificationCompat.Builder(this, "101")
.setOngoing(true)
.setContentTitle("Vaccine Alert Set")
.setContentText("We will notify you as soon as the slots get available!")
.setContentText("We will notify you as soon as vaccines are available!")
.setSmallIcon(R.drawable.launch_background)
.build()
}
Expand Down
Binary file modified assets/images/notification_animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/phone-notification.gif
Binary file not shown.
3 changes: 0 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:cowintrackerindia/provider/api_provider.dart';
import 'package:cowintrackerindia/provider/platform_channel_provider.dart';
import 'package:cowintrackerindia/ui/alert_set_confimation.dart';
import 'package:cowintrackerindia/ui/input_details.dart';
import 'package:cowintrackerindia/ui/service_running.dart';
import 'package:cowintrackerindia/ui/splash_screen.dart';
Expand Down Expand Up @@ -35,8 +34,6 @@ class MyApp extends StatelessWidget {
'/': (context) =>
// ServiceAlreadyRunningPage(),
SplashScreen(),
AlertSetConfirmationPage.routeName: (context) =>
AlertSetConfirmationPage(),
InputDetails.routeName: (context) => InputDetails(),
ServiceAlreadyRunningPage.routeName: (context) =>
ServiceAlreadyRunningPage(),
Expand Down
4 changes: 2 additions & 2 deletions lib/provider/platform_channel_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ class PlatformChannelProvider with ChangeNotifier {
await setServiceRunning(true);
await setAge(age);
await setDistCode(getDistrictCodeProv!);
await setDistName("");
await setDistName(getStateNameProv!);
await setPincode(000000);
await setStateCode(0);
await setStateName("");
await setStateName(getStateNameProv!);
await setVaccine(vaccine);
await setDose(dose);
await setCost(cost);
Expand Down
Loading

0 comments on commit e17300f

Please sign in to comment.