diff options
| author | Rishi-k-s <rishikrishna.sr@gmail.com> | 2021-08-17 17:42:03 +0530 |
|---|---|---|
| committer | Rishi-k-s <rishikrishna.sr@gmail.com> | 2021-08-17 17:42:03 +0530 |
| commit | ea34e7fae5145bae88fc945ff3c1ea441647adf3 (patch) | |
| tree | 34e5a756ce77084e7b2f16fea23f87e416aee18b | |
| parent | d401e797f0b0ce9d253669d193859d50050584a4 (diff) | |
UI and addedBug fixes
| -rw-r--r-- | lib/auth/LoginPage.dart | 5 | ||||
| -rw-r--r-- | lib/auth/RegisterPage.dart | 2 | ||||
| -rw-r--r-- | lib/main.dart | 4 | ||||
| -rw-r--r-- | lib/main_UI/Doctor/DocDetails.dart | 15 | ||||
| -rw-r--r-- | lib/main_UI/Doctor/SelectionDoc.dart | 15 | ||||
| -rw-r--r-- | lib/main_UI/Doctor/doctorDashboard.dart (renamed from lib/main_UI/doctorDashboard.dart) | 94 | ||||
| -rw-r--r-- | lib/main_UI/Patient/PatientDashboard.dart (renamed from lib/main_UI/PatientDashboard.dart) | 69 | ||||
| -rw-r--r-- | lib/main_UI/Patient/PatientDetails.dart | 39 | ||||
| -rw-r--r-- | lib/main_UI/Patient/createP2P.dart | 220 | ||||
| -rw-r--r-- | lib/main_UI/createP2P.dart | 215 | ||||
| -rw-r--r-- | pubspec.lock | 112 | ||||
| -rw-r--r-- | pubspec.yaml | 2 | ||||
| -rw-r--r-- | web/index.html | 5 |
13 files changed, 553 insertions, 244 deletions
diff --git a/lib/auth/LoginPage.dart b/lib/auth/LoginPage.dart index 0638187..8671727 100644 --- a/lib/auth/LoginPage.dart +++ b/lib/auth/LoginPage.dart @@ -132,7 +132,7 @@ class _SignInLogInPageState extends State<SignInLogInPage> { style: TextStyle(color: Colors.grey[700]), ), Container( - height: 30.9, + height: 40.9, width: 100.0, child: TextButton( style: ButtonStyle( @@ -150,6 +150,9 @@ class _SignInLogInPageState extends State<SignInLogInPage> { style: TextStyle(fontSize: 20), ), )), + SizedBox( + height: 10.0, + ), ], ), ), diff --git a/lib/auth/RegisterPage.dart b/lib/auth/RegisterPage.dart index 4897c51..ed1fb06 100644 --- a/lib/auth/RegisterPage.dart +++ b/lib/auth/RegisterPage.dart @@ -19,7 +19,7 @@ class _RegisterPageState extends State<RegisterPage> { String error = ''; String email = ''; String name = ''; - String role = 'Patient'; + String? role; String aadhaar = ''; String password = ''; String dropdownValue = 'Patient'; diff --git a/lib/main.dart b/lib/main.dart index 5dcc00d..d0b7212 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -10,6 +10,7 @@ import 'package:url_launcher/url_launcher.dart'; import 'gogl cal/calhelper.dart'; import 'dataSecrets.dart'; import 'dart:io' show Platform; +import 'package:shared_preferences/shared_preferences.dart'; Future<void> main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -17,8 +18,11 @@ Future<void> main() async { var _clientID = new ClientId(Secret.getId(), ""); const _scopes = const [cal.CalendarApi.calendarScope]; + await clientViaUserConsent(_clientID, _scopes, prompt).then((AuthClient client) async { CalendarClient.calendar = cal.CalendarApi(client); + print(' chnggg $_clientID'); + print('chnggg $_scopes'); }); runApp(MyApp()); diff --git a/lib/main_UI/Doctor/DocDetails.dart b/lib/main_UI/Doctor/DocDetails.dart new file mode 100644 index 0000000..f728538 --- /dev/null +++ b/lib/main_UI/Doctor/DocDetails.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class DoctorDetailsPage extends StatefulWidget { + const DoctorDetailsPage({Key? key}) : super(key: key); + + @override + _DoctorDetailsPageState createState() => _DoctorDetailsPageState(); +} + +class _DoctorDetailsPageState extends State<DoctorDetailsPage> { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/main_UI/Doctor/SelectionDoc.dart b/lib/main_UI/Doctor/SelectionDoc.dart new file mode 100644 index 0000000..1a7adfd --- /dev/null +++ b/lib/main_UI/Doctor/SelectionDoc.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class SearchDoctor extends StatefulWidget { + const SearchDoctor({Key? key}) : super(key: key); + + @override + _SearchDoctorState createState() => _SearchDoctorState(); +} + +class _SearchDoctorState extends State<SearchDoctor> { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/main_UI/doctorDashboard.dart b/lib/main_UI/Doctor/doctorDashboard.dart index 33c9163..76e3519 100644 --- a/lib/main_UI/doctorDashboard.dart +++ b/lib/main_UI/Doctor/doctorDashboard.dart @@ -1,10 +1,13 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/material.dart'; import 'package:healthtastic/gogl%20cal/calDatabase.dart'; +import 'package:healthtastic/main_UI/Patient/PatientDetails.dart'; +import 'package:healthtastic/main_UI/Patient/createP2P.dart'; 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 DoctorDashboard extends StatefulWidget { @override @@ -13,6 +16,7 @@ class DoctorDashboard extends StatefulWidget { class _DoctorDashboardState extends State<DoctorDashboard> { Storage storage = Storage(); + int _currentIndex = 0; @override Widget build(BuildContext context) { @@ -32,6 +36,17 @@ class _DoctorDashboardState extends State<DoctorDashboard> { ), ), ), + // floatingActionButton: FloatingActionButton( + // // backgroundColor: CustomColor.dark_cyan, + // child: Icon(Icons.add), + // onPressed: () { + // Navigator.of(context).push( + // MaterialPageRoute( + // builder: (context) => CreateAppoin(), + // ), + // ); + // }, + // ), body: Padding( padding: const EdgeInsets.only( left: 16.0, @@ -76,7 +91,7 @@ class _DoctorDashboardState extends State<DoctorDashboard> { right: 16.0, ), decoration: BoxDecoration( - // color: CustomColor.neon_green.withOpacity(0.3), + color: Colors.blueGrey, borderRadius: BorderRadius.circular(12.0), ), child: Column( @@ -85,7 +100,7 @@ class _DoctorDashboardState extends State<DoctorDashboard> { Text( event.name, style: TextStyle( - // color: CustomColor.dark_blue, + color: Colors.white, fontWeight: FontWeight.bold, fontSize: 22, letterSpacing: 1, @@ -97,7 +112,7 @@ class _DoctorDashboardState extends State<DoctorDashboard> { maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( - color: Colors.black38, + color: Colors.white, fontWeight: FontWeight.bold, fontSize: 16, letterSpacing: 1, @@ -106,13 +121,23 @@ class _DoctorDashboardState extends State<DoctorDashboard> { 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, + ), ), ), ), @@ -137,16 +162,16 @@ class _DoctorDashboardState extends State<DoctorDashboard> { 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, ), ), ], @@ -186,6 +211,49 @@ class _DoctorDashboardState extends State<DoctorDashboard> { ), ), ), + bottomNavigationBar: BottomNavigationBar( + selectedItemColor: Colors.teal[800], + currentIndex: _currentIndex, + selectedFontSize: 15, + unselectedFontSize: 12, + items: [ + BottomNavigationBarItem( + icon: Icon(Icons.home), + label: 'Home', + backgroundColor: Colors.lightBlue[900], + ), + BottomNavigationBarItem( + icon: Icon(Icons.add), + label: 'New', + backgroundColor: Colors.lightBlue[900], + ), + BottomNavigationBarItem( + icon: Icon(Icons.person), + label: 'Settings', + backgroundColor: Colors.lightBlue[900], + ), + ], + onTap: (index) { + print(_currentIndex); + setState(() { + _currentIndex = index; + }); + if (index == 1) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => CreateAppoin(), + ), + ); + } + if (index == 2) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => PatientDetalsScreen(), + ), + ); + } + }, + ), ); } } diff --git a/lib/main_UI/PatientDashboard.dart b/lib/main_UI/Patient/PatientDashboard.dart index 3e94f27..e46ca6a 100644 --- a/lib/main_UI/PatientDashboard.dart +++ b/lib/main_UI/Patient/PatientDashboard.dart @@ -2,7 +2,8 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/material.dart'; import 'package:healthtastic/common/textstyles.dart'; import 'package:healthtastic/gogl%20cal/calDatabase.dart'; -import 'package:healthtastic/main_UI/createP2P.dart'; +import 'package:healthtastic/main_UI/Patient/PatientDetails.dart'; +import 'package:healthtastic/main_UI/Patient/createP2P.dart'; import 'package:healthtastic/models/calModel.dart'; import 'package:healthtastic/services/authService.dart'; import 'package:healthtastic/gogl%20cal/calhelper.dart'; @@ -16,6 +17,7 @@ class PatientDashboard extends StatefulWidget { class _PatientDashboardState extends State<PatientDashboard> { Storage storage = Storage(); + int _currentIndex = 0; @override Widget build(BuildContext context) { @@ -35,17 +37,17 @@ class _PatientDashboardState extends State<PatientDashboard> { ), ), ), - floatingActionButton: FloatingActionButton( - // backgroundColor: CustomColor.dark_cyan, - child: Icon(Icons.add), - onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => CreateAppoin(), - ), - ); - }, - ), + // floatingActionButton: FloatingActionButton( + // // backgroundColor: CustomColor.dark_cyan, + // child: Icon(Icons.add), + // onPressed: () { + // Navigator.of(context).push( + // MaterialPageRoute( + // builder: (context) => CreateAppoin(), + // ), + // ); + // }, + // ), body: Padding( padding: const EdgeInsets.only( left: 16.0, @@ -210,6 +212,49 @@ class _PatientDashboardState extends State<PatientDashboard> { ), ), ), + bottomNavigationBar: BottomNavigationBar( + selectedItemColor: Colors.teal[800], + currentIndex: _currentIndex, + selectedFontSize: 15, + unselectedFontSize: 12, + items: [ + BottomNavigationBarItem( + icon: Icon(Icons.home), + label: 'Home', + backgroundColor: Colors.lightBlue[900], + ), + BottomNavigationBarItem( + icon: Icon(Icons.add), + label: 'New', + backgroundColor: Colors.lightBlue[900], + ), + BottomNavigationBarItem( + icon: Icon(Icons.person), + label: 'Settings', + backgroundColor: Colors.lightBlue[900], + ), + ], + onTap: (index) { + print(_currentIndex); + setState(() { + _currentIndex = index; + }); + if (index == 1) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => CreateAppoin(), + ), + ); + } + if (index == 2) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => PatientDetalsScreen(), + ), + ); + } + }, + ), ); } } diff --git a/lib/main_UI/Patient/PatientDetails.dart b/lib/main_UI/Patient/PatientDetails.dart new file mode 100644 index 0000000..8aedac3 --- /dev/null +++ b/lib/main_UI/Patient/PatientDetails.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +import 'package:healthtastic/main_UI/Patient/PatientDashboard.dart'; +import 'package:healthtastic/main_UI/Patient/createP2P.dart'; +import 'package:healthtastic/services/authService.dart'; +import 'package:healthtastic/services/database.dart'; + +class PatientDetalsScreen extends StatefulWidget { + const PatientDetalsScreen({Key? key}) : super(key: key); + + @override + _PatientDetalsScreenState createState() => _PatientDetalsScreenState(); +} + +class _PatientDetalsScreenState extends State<PatientDetalsScreen> { + int _currentIndex = 2; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + actions: [ + IconButton( + icon: Icon(Icons.logout), + onPressed: () { + AuthService.signout(); + Navigator.pop(context); + }) + ], + ), + body: Column( + children: [ + SizedBox( + height: 20.0, + ), + ], + ), + ); + } +} diff --git a/lib/main_UI/Patient/createP2P.dart b/lib/main_UI/Patient/createP2P.dart new file mode 100644 index 0000000..1871a9e --- /dev/null +++ b/lib/main_UI/Patient/createP2P.dart @@ -0,0 +1,220 @@ +import 'package:flutter/material.dart'; +import 'package:googleapis/analyticsreporting/v4.dart'; +import 'package:googleapis/calendar/v3.dart' as calendar; +import 'package:healthtastic/common/textstyles.dart'; +import 'package:healthtastic/main_UI/Patient/PatientDetails.dart'; +import 'package:healthtastic/models/calModel.dart'; +import 'package:healthtastic/gogl%20cal/calDatabase.dart'; +import 'package:healthtastic/gogl%20cal/calhelper.dart'; +import 'package:intl/intl.dart'; + +class CreateAppoin extends StatefulWidget { + const CreateAppoin({Key? key}) : super(key: key); + + @override + _CreateAppoinState createState() => _CreateAppoinState(); +} + +class _CreateAppoinState extends State<CreateAppoin> { + Storage storage = Storage(); + CalendarClient calendarClient = CalendarClient(); + final _formKey = GlobalKey<FormState>(); + + DateTime selectedDate = DateTime.now(); + TimeOfDay selectedStartTime = TimeOfDay.now(); + TimeOfDay selectedEndTime = TimeOfDay.now(); + + late TextEditingController textControllerDate; + late TextEditingController textControllerStartTime; + late TextEditingController textControllerEndTime; + + String title = ''; + String docName = ''; + String desc = ''; + String location = ''; + String allergies = ''; + + int _currentIndex = 1; + + _selectDate(BuildContext context) async { + final DateTime picked = (await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime(2020), + lastDate: DateTime(2050), + ))!; + if (picked != null && picked != selectedDate) { + setState(() { + selectedDate = picked; + textControllerDate.text = DateFormat.yMMMMd().format(selectedDate); + }); + } + } + + _selectStartTime(BuildContext context) async { + final TimeOfDay picked = (await showTimePicker( + context: context, + initialTime: selectedStartTime, + ))!; + if (picked != null && picked != selectedStartTime) { + setState(() { + selectedStartTime = picked; + textControllerStartTime.text = selectedStartTime.format(context); + }); + } else { + setState(() { + textControllerStartTime.text = selectedStartTime.format(context); + }); + } + } + + _selectEndTime(BuildContext context) async { + final TimeOfDay picked = (await showTimePicker( + context: context, + initialTime: selectedEndTime, + ))!; + if (picked != null && picked != selectedEndTime) { + setState(() { + selectedEndTime = picked; + textControllerEndTime.text = selectedEndTime.format(context); + }); + } else { + setState(() { + textControllerEndTime.text = selectedEndTime.format(context); + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Appoinment'), + ), + body: SingleChildScrollView( + child: Form( + key: _formKey, + child: Column( + children: [ + TextFormField( + style: commontextstyle, + validator: (val) => val!.isEmpty ? 'Required' : null, + onChanged: (val) { + setState(() => title = val); + }, + decoration: InputDecoration( + hintText: 'Title', + hintStyle: commontextstyle, + fillColor: Colors.white, + filled: true, + ), + ), + SizedBox( + height: 10.0, + ), + TextFormField( + style: commontextstyle, + validator: (val) => val!.isEmpty ? 'Required' : null, + onChanged: (val) { + setState(() => desc = val); + }, + decoration: InputDecoration( + hintText: 'describtion', + hintStyle: commontextstyle, + fillColor: Colors.white, + filled: true, + ), + ), + SizedBox( + height: 10.0, + ), + TextFormField( + style: commontextstyle, + validator: (val) => val!.isEmpty ? 'Required' : null, + onChanged: (val) { + setState(() => location = val); + }, + decoration: InputDecoration( + hintText: 'Location', + hintStyle: commontextstyle, + fillColor: Colors.white, + filled: true, + ), + ), + SizedBox( + height: 20, + ), + Container( + height: 40.9, + width: 100.0, + child: TextButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all<Color>(Color(0xffEC5F5F)), + foregroundColor: MaterialStateProperty.all<Color>(Color(0xffffffff)), + ), + onPressed: () async { + if (_formKey.currentState!.validate()) { + int startTimeInEpoch = DateTime( + selectedDate.year, + selectedDate.month, + selectedDate.day, + selectedStartTime.hour, + selectedStartTime.minute, + ).millisecondsSinceEpoch; + + int endTimeInEpoch = DateTime( + selectedDate.year, + selectedDate.month, + selectedDate.day, + selectedEndTime.hour, + selectedEndTime.minute, + ).millisecondsSinceEpoch; + + await calendarClient + .insert( + title: title, + description: desc, + location: location, + docName: docName, + allergies: allergies, + hasConferenceSupport: true, + 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()); + })); + } + }, + child: Text( + 'Register', + style: TextStyle(fontSize: 20), + ), + )), + ], + )), + ), + ); + } +} diff --git a/lib/main_UI/createP2P.dart b/lib/main_UI/createP2P.dart deleted file mode 100644 index 345c46d..0000000 --- a/lib/main_UI/createP2P.dart +++ /dev/null @@ -1,215 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:googleapis/analyticsreporting/v4.dart'; -import 'package:googleapis/calendar/v3.dart' as calendar; -import 'package:healthtastic/common/textstyles.dart'; -import 'package:healthtastic/models/calModel.dart'; -import 'package:healthtastic/gogl%20cal/calDatabase.dart'; -import 'package:healthtastic/gogl%20cal/calhelper.dart'; -import 'package:intl/intl.dart'; - -class CreateAppoin extends StatefulWidget { - const CreateAppoin({Key? key}) : super(key: key); - - @override - _CreateAppoinState createState() => _CreateAppoinState(); -} - -class _CreateAppoinState extends State<CreateAppoin> { - Storage storage = Storage(); - CalendarClient calendarClient = CalendarClient(); - final _formKey = GlobalKey<FormState>(); - - DateTime selectedDate = DateTime.now(); - TimeOfDay selectedStartTime = TimeOfDay.now(); - TimeOfDay selectedEndTime = TimeOfDay.now(); - - late TextEditingController textControllerDate; - late TextEditingController textControllerStartTime; - late TextEditingController textControllerEndTime; - - String title = ''; - String docName = ''; - String desc = ''; - String location = ''; - String allergies = ''; - - _selectDate(BuildContext context) async { - final DateTime picked = (await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime(2020), - lastDate: DateTime(2050), - ))!; - if (picked != null && picked != selectedDate) { - setState(() { - selectedDate = picked; - textControllerDate.text = DateFormat.yMMMMd().format(selectedDate); - }); - } - } - - _selectStartTime(BuildContext context) async { - final TimeOfDay picked = (await showTimePicker( - context: context, - initialTime: selectedStartTime, - ))!; - if (picked != null && picked != selectedStartTime) { - setState(() { - selectedStartTime = picked; - textControllerStartTime.text = selectedStartTime.format(context); - }); - } else { - setState(() { - textControllerStartTime.text = selectedStartTime.format(context); - }); - } - } - - _selectEndTime(BuildContext context) async { - final TimeOfDay picked = (await showTimePicker( - context: context, - initialTime: selectedEndTime, - ))!; - if (picked != null && picked != selectedEndTime) { - setState(() { - selectedEndTime = picked; - textControllerEndTime.text = selectedEndTime.format(context); - }); - } else { - setState(() { - textControllerEndTime.text = selectedEndTime.format(context); - }); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Appoinment'), - ), - body: Form( - key: _formKey, - child: Column( - children: [ - TextFormField( - style: commontextstyle, - validator: (val) => val!.isEmpty ? 'Required' : null, - onChanged: (val) { - setState(() => title = val); - }, - decoration: InputDecoration( - hintText: 'Title', - hintStyle: commontextstyle, - fillColor: Colors.white, - filled: true, - ), - ), - SizedBox( - height: 10.0, - ), - TextFormField( - style: commontextstyle, - validator: (val) => val!.isEmpty ? 'Required' : null, - onChanged: (val) { - setState(() => desc = val); - }, - decoration: InputDecoration( - hintText: 'describtion', - hintStyle: commontextstyle, - fillColor: Colors.white, - filled: true, - ), - ), - SizedBox( - height: 10.0, - ), - TextFormField( - style: commontextstyle, - validator: (val) => val!.isEmpty ? 'Required' : null, - onChanged: (val) { - setState(() => location = val); - }, - decoration: InputDecoration( - hintText: 'Location', - hintStyle: commontextstyle, - fillColor: Colors.white, - filled: true, - ), - ), - SizedBox( - height: 20, - ), - Container( - height: 40.9, - width: 100.0, - child: TextButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all<Color>(Color(0xffEC5F5F)), - foregroundColor: MaterialStateProperty.all<Color>(Color(0xffffffff)), - ), - onPressed: () async { - if (_formKey.currentState!.validate()) { - int startTimeInEpoch = DateTime( - selectedDate.year, - selectedDate.month, - selectedDate.day, - selectedStartTime.hour, - selectedStartTime.minute, - ).millisecondsSinceEpoch; - - int endTimeInEpoch = DateTime( - selectedDate.year, - selectedDate.month, - selectedDate.day, - selectedEndTime.hour, - selectedEndTime.minute, - ).millisecondsSinceEpoch; - - await calendarClient - .insert( - title: title, - description: desc, - location: location, - docName: docName, - allergies: allergies, - hasConferenceSupport: true, - 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()); - })); - } - }, - child: Text( - 'Register', - style: TextStyle(fontSize: 20), - ), - )), - ], - )), - ); - } -} diff --git a/pubspec.lock b/pubspec.lock index b5fb5db..1565ad4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -92,6 +92,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" firebase_auth: dependency: "direct main" description: @@ -149,6 +163,13 @@ packages: description: flutter source: sdk version: "0.0.0" + google_place: + dependency: "direct main" + description: + name: google_place + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.3" googleapis: dependency: "direct main" description: @@ -219,6 +240,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" pedantic: dependency: transitive description: @@ -226,6 +268,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.11.1" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" plugin_platform_interface: dependency: transitive description: @@ -233,6 +282,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.3" provider: dependency: "direct main" description: @@ -240,6 +296,48 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "5.0.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" sky_engine: dependency: transitive description: flutter @@ -343,6 +441,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" sdks: dart: ">=2.12.0 <3.0.0" flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index cc35a00..d78ab3d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,6 +32,8 @@ dependencies: googleapis: ^4.0.0 url_launcher: ^6.0.9 googleapis_auth: ^1.1.0 + shared_preferences: ^2.0.6 + google_place: ^0.4.3 # The following adds the Cupertino Icons font to your application. diff --git a/web/index.html b/web/index.html index 474c4be..dc62660 100644 --- a/web/index.html +++ b/web/index.html @@ -24,8 +24,9 @@ <link rel="apple-touch-icon" href="icons/Icon-192.png"> <title>healthtastic</title> - <!-- <script src="https://cdn.agora.io/sdk/release/AgoraRTCSDK-3.6.3.js"></script> --> - <script src="https://www.gstatic.com/firebasejs/6.3.1/firebase-app.js"></script> + + <script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js"></script> + <script src="https://cdn.agora.io/sdk/release/AgoraRTCSDK-3.6.3.js"></script> <script src="https://www.gstatic.com/firebasejs/6.3.1/firebase-firestore.js"></script> <script src="https://www.gstatic.com/firebasejs/6.3.1/firebase-auth.js"></script> <script src="https://www.gstatic.com/firebasejs/6.3.1/firebase-storage.js"></script> |
