summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRishi-k-s <rishikrishna.sr@gmail.com>2021-08-17 11:45:02 +0530
committerRishi-k-s <rishikrishna.sr@gmail.com>2021-08-17 11:45:02 +0530
commitd401e797f0b0ce9d253669d193859d50050584a4 (patch)
tree1b92b5a7d4c6be4f3a03e8c643474acbed7551d2
parentb7580e0634a26d7d1d2406b68958a20fa3de771c (diff)
added dashboard
-rw-r--r--lib/gogl cal/calDatabase.dart2
-rw-r--r--lib/main_UI/PatientDashboard.dart37
-rw-r--r--lib/main_UI/createP2P.dart21
3 files changed, 45 insertions, 15 deletions
diff --git a/lib/gogl cal/calDatabase.dart b/lib/gogl cal/calDatabase.dart
index 6eeb359..ce48580 100644
--- a/lib/gogl cal/calDatabase.dart
+++ b/lib/gogl cal/calDatabase.dart
@@ -7,7 +7,7 @@ final CollectionReference mainCollection = FirebaseFirestore.instance.collection
final DocumentReference documentReference = mainCollection.doc('data');
class Storage {
- Future<void> storeEventData(EventInfo eventInfo, String userUid) async {
+ Future<void> storeEventData(EventInfo eventInfo) async {
DocumentReference documentReferencer = documentReference.collection('liveAppoinments').doc(eventInfo.id);
Map<String, dynamic> data = eventInfo.toJson();
diff --git a/lib/main_UI/PatientDashboard.dart b/lib/main_UI/PatientDashboard.dart
index 0bbda4f..3e94f27 100644
--- a/lib/main_UI/PatientDashboard.dart
+++ b/lib/main_UI/PatientDashboard.dart
@@ -7,6 +7,7 @@ import 'package:healthtastic/models/calModel.dart';
import 'package:healthtastic/services/authService.dart';
import 'package:healthtastic/gogl%20cal/calhelper.dart';
import 'package:intl/intl.dart';
+import 'package:url_launcher/url_launcher.dart';
class PatientDashboard extends StatefulWidget {
@override
@@ -89,7 +90,7 @@ class _PatientDashboardState extends State<PatientDashboard> {
right: 16.0,
),
decoration: BoxDecoration(
- // color: CustomColor.neon_green.withOpacity(0.3),
+ color: Colors.blueGrey,
borderRadius: BorderRadius.circular(12.0),
),
child: Column(
@@ -98,7 +99,7 @@ class _PatientDashboardState extends State<PatientDashboard> {
Text(
event.name,
style: TextStyle(
- // color: CustomColor.dark_blue,
+ color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 22,
letterSpacing: 1,
@@ -110,7 +111,7 @@ class _PatientDashboardState extends State<PatientDashboard> {
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
- color: Colors.black38,
+ color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: 1,
@@ -119,13 +120,23 @@ class _PatientDashboardState extends State<PatientDashboard> {
SizedBox(height: 10),
Padding(
padding: const EdgeInsets.only(top: 8.0, bottom: 8.0),
- child: Text(
- event.link,
- style: TextStyle(
- // color: CustomColor.dark_blue.withOpacity(0.5),
- fontWeight: FontWeight.bold,
- fontSize: 16,
- letterSpacing: 0.5,
+ child: InkWell(
+ onTap: () async {
+ if (await canLaunch(event.link)) {
+ CircularProgressIndicator();
+ await launch(event.link);
+ } else {
+ throw 'Could not launch $event.link';
+ }
+ },
+ child: Text(
+ event.link,
+ style: TextStyle(
+ color: Colors.blue[400],
+ fontWeight: FontWeight.bold,
+ fontSize: 16,
+ letterSpacing: 1,
+ ),
),
),
),
@@ -150,16 +161,16 @@ class _PatientDashboardState extends State<PatientDashboard> {
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: 1.5,
+ color: Colors.white,
),
),
Text(
'$startTimeString - $endTimeString',
style: TextStyle(
- // color: CustomColor.dark_cyan,
- fontFamily: 'OpenSans',
+ color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16,
- letterSpacing: 1.5,
+ letterSpacing: 1,
),
),
],
diff --git a/lib/main_UI/createP2P.dart b/lib/main_UI/createP2P.dart
index 5d92898..345c46d 100644
--- a/lib/main_UI/createP2P.dart
+++ b/lib/main_UI/createP2P.dart
@@ -174,13 +174,32 @@ class _CreateAppoinState extends State<CreateAppoin> {
docName: docName,
allergies: allergies,
hasConferenceSupport: true,
- shouldNotifyAttendees: false,
+ shouldNotifyAttendees: true,
startTime: DateTime.fromMillisecondsSinceEpoch(startTimeInEpoch),
endTime: DateTime.fromMillisecondsSinceEpoch(endTimeInEpoch),
)
.then(((eventData) async {
String eventId = eventData['id']!;
String eventLink = eventData['link']!;
+
+ List<String> emails = [];
+
+ EventInfo eventInfo = EventInfo(
+ id: eventId,
+ name: title,
+ description: desc,
+ location: location,
+ link: eventLink,
+ docName: docName,
+ allergies: allergies,
+ attendeeEmails: emails,
+ shouldNotifyAttendees: true,
+ hasConfereningSupport: true,
+ startTimeInEpoch: startTimeInEpoch,
+ endTimeInEpoch: endTimeInEpoch,
+ );
+
+ await storage.storeEventData(eventInfo).whenComplete(() => Navigator.of(context).pop());
}));
}
},