Ongoing online
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:tasktracker/NotificationsManager.dart';
|
||||
import 'main.dart';
|
||||
import 'User.dart' as User;
|
||||
|
||||
class Dialogs{
|
||||
static String syncingMessage = "Syncing";
|
||||
@@ -65,6 +69,59 @@ class Dialogs{
|
||||
}
|
||||
}
|
||||
|
||||
static ongoing() async{
|
||||
List<String>? data= await User.getOngoingData();
|
||||
if(data == null){return;}
|
||||
|
||||
context=navigatorKey.currentContext;
|
||||
if(context!=null) {
|
||||
return showDialog(
|
||||
context: context!,
|
||||
routeSettings: const RouteSettings(name: "Ongoing"),
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
|
||||
backgroundColor: Color(0xFF101010),
|
||||
title: Text('Take Action for Ongoing Activity'),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(''),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Task : ${data[0]}'),
|
||||
Text('Description: ${data[1]}'),
|
||||
Text('Started Time: ${DateFormat("MM-dd hh:mm").format(DateTime.parse(data[2]))}')
|
||||
],
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
|
||||
MaterialButton(onPressed: (){Navigator.of(context).pop();}, child: Text('Cancel', style:TextStyle(color: Colors.grey))),
|
||||
MaterialButton(onPressed: (){
|
||||
User.CancelOngoingActivity();
|
||||
NotificationManager.RescheduleNotifications();
|
||||
Navigator.of(context).pop();
|
||||
}, child:Text('Remove', style:TextStyle(color: Colors.redAccent))),
|
||||
MaterialButton(
|
||||
onPressed: (){
|
||||
User.StopActivityTimer();
|
||||
NotificationManager.RescheduleNotifications();
|
||||
Navigator.of(context).pop();
|
||||
|
||||
},
|
||||
child: Text('Complete', style:TextStyle(color: Colors.green)),
|
||||
),
|
||||
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static hide(){
|
||||
showing=false;
|
||||
|
||||
Reference in New Issue
Block a user