implementing Smart Watch Integration

fix_authentication
haroon amjad 5 years ago
parent 22ef24c4ff
commit 0b6cd845f1

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -235,7 +235,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
return children;
},
),
onDaySelected: (date, events,holidays) {
onDaySelected: (date, events) {
_onDaySelected(date, events);
_animationController.forward(from: 0.0);
},

@ -348,7 +348,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
return children;
},
),
onDaySelected: (date, events,holidays) {
onDaySelected: (date, events) {
_onDaySelected(date, events);
_animationController.forward(from: 0.0);
},

@ -0,0 +1,145 @@
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class HealthDataList extends StatefulWidget {
@override
_HealthDataListState createState() => _HealthDataListState();
}
class _HealthDataListState extends State<HealthDataList> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "Smartwatches",
isShowAppBar: true,
body: Container(
height: MediaQuery.of(context).size.height,
margin: EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Heart Rate",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/sleep_data.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Sleep Data",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Steps",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Distance",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Energy",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
],
),
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.1,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(
color: Colors.transparent,
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () {
// launch(model.radImageURL);
},
label: 'Sync Health Data',
backgroundColor: Colors.grey[800],
),
),
],
),
));
}
}

@ -1,7 +1,10 @@
import 'dart:io';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class SmartWatchInstructions extends StatefulWidget {
@override
@ -9,6 +12,8 @@ class SmartWatchInstructions extends StatefulWidget {
}
class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
CarouselController buttonCarouselController = CarouselController();
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -22,10 +27,763 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
}
_getAppleWatchInstructions() {
return SingleChildScrollView();
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(
enableInfiniteScroll: false,
viewportFraction: 0.95,
height: MediaQuery.of(context).size.height * 0.9),
items: [1, 2].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: i == 1
? Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("Supported Smartwatches",
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
fontFamily: "WorkSans")),
),
Container(
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-1.jpeg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 1",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-2.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 2",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-3.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 3",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-4.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 4",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-5.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 5",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/Apple-Watch-6.png",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 6",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/miBand3.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 3",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/miBand4.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 4",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.fromLTRB(
10.0, 30.0, 10.0, 10.0),
child: Text(
"It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"Before syncing data, please make sure that you have followed the instructions properly",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
buttonCarouselController.nextPage();
},
child: Text("CONTINUE",
style: TextStyle(fontSize: 18.0)),
),
),
),
],
)
: Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("Watch Instructions:",
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
fontFamily: "WorkSans")),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.fromLTRB(
10.0, 20.0, 10.0, 10.0),
child: Text(
"Before syncing data, please make sure that following instructions are met: ",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.fromLTRB(
10.0, 20.0, 10.0, 10.0),
child: Text(
"1. Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"2. Make sure that your Apple Watch is connected with the Watch & Health Apps.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"3. Make sure that data like heart rate, steps, distance etc. are being shown on your health app.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.fromLTRB(
15.0, 110.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
buttonCarouselController.nextPage();
},
child: Text("SYNC HEALTH DATA",
style: TextStyle(fontSize: 18.0)),
),
),
),
Container(
margin: EdgeInsets.fromLTRB(
15.0, 0.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
_openHealthDataList();
},
child: Text("ALREADY SYNCED",
style: TextStyle(fontSize: 18.0)),
),
),
),
],
),
));
},
);
}).toList(),
),
)
],
),
);
}
_getGoogleWatchInstructions() {
return SingleChildScrollView();
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(
enableInfiniteScroll: false,
viewportFraction: 0.95,
height: MediaQuery.of(context).size.height * 0.9),
items: [1, 2].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: i == 1
? Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("Supported Smartwatches",
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
fontFamily: "WorkSans")),
),
Container(
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/huawei-watch-2.png",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Huawei Watch 2",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/ticwatche2.png",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Mobovi TicWatch E2",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/huawei-watch-2-classic.png",
width: 70.0,
height: 70.0),
Container(
child: Text("Huawei Watch",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/ticwatche2.png",
width: 70.0,
height: 70.0),
Container(
child: Text("Fossil Sport",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/misfit-vapor-2.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"MisFit Vapor 2",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/lg-watch-sport.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"LG Watch Sport",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/miBand3.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 3",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/miBand4.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 4",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
InkWell(
onTap: () {
launch(
"https://wearos.google.com/#find-your-watch");
},
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Text(
"More Supported Smartwatches...",
style: TextStyle(
fontSize: 17.0,
color: Colors.blue,
decoration:
TextDecoration.underline)),
),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"Before syncing data, please make sure that you have followed the instructions properly",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
buttonCarouselController.nextPage();
},
child: Text("CONTINUE",
style: TextStyle(fontSize: 18.0)),
),
),
),
],
)
: Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("Watch Instructions:",
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
fontFamily: "WorkSans")),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"Before syncing data, please make sure that following instructions are met: ",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"2. Make sure that you have installed your watch related apps from Google PlayStore.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"4. Make sure that your smart watch apps are linked/associated with Google Fit App.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.fromLTRB(
15.0, 95.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
buttonCarouselController.nextPage();
},
child: Text("SYNC HEALTH DATA",
style: TextStyle(fontSize: 18.0)),
),
),
),
Container(
margin: EdgeInsets.fromLTRB(
15.0, 0.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
_openHealthDataList();
},
child: Text("ALREADY SYNCED",
style: TextStyle(fontSize: 18.0)),
),
),
),
],
),
));
},
);
}).toList(),
),
)
],
),
);
}
_openHealthDataList() {
Navigator.push(context,
MaterialPageRoute(builder: (context) => HealthDataList()));
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Loading…
Cancel
Save