voice command

merge-update-with-lab-changes
Sultan Khan 6 years ago
parent da317431ba
commit 3ad928902b

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 5.0 KiB

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

@ -32,7 +32,9 @@ class BaseAppClient {
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['VersionID'] = VERSION_ID;
@ -41,7 +43,9 @@ class BaseAppClient {
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
@ -55,9 +59,11 @@ class BaseAppClient {
body['DeviceTypeID'] = DeviceTypeID;
if(!body.containsKey('IsPublicRequest')) {
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE
? body['PatientType'] != null
? body['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
@ -71,14 +77,14 @@ class BaseAppClient {
body['PatientID'] =
body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = getSessionId(token);
body['SessionID'] = SESSION_ID;//getSessionId(token);
}
}
print("URL : $url");
print("Body : ${json.encode(body)}");
var asd="";
var asd = "";
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),
body: json.encode(body),
@ -139,6 +145,7 @@ class BaseAppClient {
}
String getSessionId(String id) {
return id.replaceAll(RegExp('/[^a-zA-Z ]'), '');
///return id.replaceAll(RegExp('/[^\w\s]/'), '');
// return id.replaceAll(RegExp('/[^a-zA-Z ]'), '');
}
}

@ -66,7 +66,8 @@ class MyApp extends StatelessWidget {
hintColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor:Hexcolor('#E9E9E9'),// Colors.grey[100],
scaffoldBackgroundColor:
HexColor('#E9E9E9'), // Colors.grey[100],
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
@ -74,9 +75,8 @@ class MyApp extends StatelessWidget {
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme:BottomSheetThemeData(
backgroundColor: Hexcolor('#E0E0E0')
) ,
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(

@ -22,15 +22,14 @@ class EReferralIndexPage extends StatelessWidget {
appBarTitle: "Service Information",
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child:
Column(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
"E-Referral: ",
fontWeight: FontWeight.normal,
fontSize: 25,
color: Hexcolor("#60686b"),
color: HexColor("#60686b"),
),
SizedBox(
height: 12,
@ -59,9 +58,7 @@ class EReferralIndexPage extends StatelessWidget {
height: 77,
),
],
)
),
)),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
@ -70,13 +67,13 @@ class EReferralIndexPage extends StatelessWidget {
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: ()=> Navigator.push(context, FadePage(page: EReferralPage())),
onTap: () => Navigator.push(
context, FadePage(page: EReferralPage())),
label: "E-Referral",
textColor: Theme.of(context).backgroundColor),
),
],
),
));
}
}

@ -23,7 +23,7 @@ class H2OPageIndexPage extends StatelessWidget {
"Water Tracker:",
fontWeight: FontWeight.normal,
fontSize: 25,
color: Hexcolor("#60686b"),
color: HexColor("#60686b"),
),
SizedBox(
height: 12,

@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
class TodayPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
@ -27,11 +28,11 @@ class TodayPage extends StatelessWidget {
animation: true,
animationDuration: 1200,
lineWidth: 15.0,
percent:model.userProgressData ==null ?0.0:
(model.userProgressData.percentageConsumed /
100) >= 1 ? 1 : (model.userProgressData
.percentageConsumed /
100),
percent: model.userProgressData == null
? 0.0
: (model.userProgressData.percentageConsumed / 100) >= 1
? 1
: (model.userProgressData.percentageConsumed / 100),
//,
center: Center(
child: Column(
@ -46,13 +47,16 @@ class TodayPage extends StatelessWidget {
SizedBox(
height: 4,
),
Text(model.userProgressData ==null ?"0.0":
model.userProgressData.quantityConsumed
.toString() + 'ml',
Text(
model.userProgressData == null
? "0.0"
: model.userProgressData.quantityConsumed
.toString() +
'ml',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
color: Hexcolor("#60BCF9")),
color: HexColor("#60BCF9")),
),
SizedBox(
height: 4,
@ -60,9 +64,7 @@ class TodayPage extends StatelessWidget {
SizedBox(
height: 5,
width: 50,
child: Container(
),
child: Container(),
),
SizedBox(
height: 4,
@ -74,23 +76,28 @@ class TodayPage extends StatelessWidget {
SizedBox(
height: 4,
),
Text(model.userProgressData ==null ?"0.0":
(model.userProgressData.quantityLimit -
Text(
model.userProgressData == null
? "0.0"
: (model.userProgressData.quantityLimit -
model.userProgressData
.quantityConsumed) < 0 ? "0 ml" :
(model.userProgressData.quantityLimit -
.quantityConsumed) <
0
? "0 ml"
: (model.userProgressData.quantityLimit -
model.userProgressData
.quantityConsumed).toString() + ' ml',
.quantityConsumed)
.toString() +
' ml',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0),
fontWeight: FontWeight.bold, fontSize: 18.0),
),
],
),
),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Hexcolor("#D1E3F6"),
progressColor: Hexcolor("#60BCF9"),
backgroundColor: HexColor("#D1E3F6"),
progressColor: HexColor("#60BCF9"),
),
),
Row(
@ -105,9 +112,9 @@ class TodayPage extends StatelessWidget {
height: 30,
width: 70,
decoration: BoxDecoration(
color: Hexcolor("#D1E3F6"),
borderRadius: BorderRadius.all(
Radius.circular(30))),
color: HexColor("#D1E3F6"),
borderRadius:
BorderRadius.all(Radius.circular(30))),
),
),
Text(
@ -125,9 +132,9 @@ class TodayPage extends StatelessWidget {
height: 30,
width: 70,
decoration: BoxDecoration(
color: Hexcolor("#60BCF9"),
borderRadius: BorderRadius.all(
Radius.circular(30))),
color: HexColor("#60BCF9"),
borderRadius:
BorderRadius.all(Radius.circular(30))),
),
),
Text(
@ -143,10 +150,7 @@ class TodayPage extends StatelessWidget {
),
SizedBox(
height: 0.5,
width: MediaQuery
.of(context)
.size
.width,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey,
),
@ -163,4 +167,3 @@ class TodayPage extends StatelessWidget {
);
}
}

@ -39,7 +39,7 @@ class MyBalancePage extends StatelessWidget {
width: double.infinity,
height: 65,
decoration: BoxDecoration(
color: Hexcolor('#B61422'),
color: HexColor('#B61422'),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),
@ -97,7 +97,8 @@ class MyBalancePage extends StatelessWidget {
textColor: Colors.white,
label: TranslationBase.of(context).createAdvancedPayment,
onTap: () {
Navigator.push(context,
Navigator.push(
context,
//FadePage(page: AdvancePaymentPage()));
FadePage(page: BloodDonationPage()));
},

@ -21,12 +21,6 @@ class _SearchResultsState extends State<SearchResults> {
// var event = RobotProvider();
List<DoctorList> tempList = [];
@override
void initState() {
// event.controller.stream.listen((p) {});
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -41,6 +35,7 @@ class _SearchResultsState extends State<SearchResults> {
...List.generate(
widget.patientDoctorAppointmentListHospital.length,
(index) => AppExpandableNotifier(
isExpand: index == 1 ? true : false,
title: widget.patientDoctorAppointmentListHospital[index]
.filterName +
" - " +

@ -31,6 +31,7 @@ class _BranchViewState extends State<BranchView> {
body: new ListView.builder(
itemBuilder: (BuildContext context, int index) {
return new ExpandableListView(
isExpanded: index == 0 ? true : false,
result2: widget.result,
resultDistance: widget.resultDistance,
val: index,
@ -48,8 +49,14 @@ class ExpandableListView extends StatefulWidget {
final List<DoctorList> doctorsList2;
final val;
static int doctorListheight = 0;
final bool isExpanded;
const ExpandableListView(
{Key key, this.result2, this.resultDistance, this.val, this.doctorsList2})
{Key key,
this.result2,
this.resultDistance,
this.val,
this.doctorsList2,
this.isExpanded})
: super(key: key);
@override
@ -58,9 +65,17 @@ class ExpandableListView extends StatefulWidget {
class _ExpandableListViewState extends State<ExpandableListView> {
bool expandFlag = false;
@override
void initState() {
setState(() {
expandFlag = widget.isExpanded;
setDoctorViewHeight(widget.result2[widget.val].toString());
});
super.initState();
}
@override
Widget build(BuildContext context) {
return new Container(
width: MediaQuery.of(context).size.width * 0.6,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0),

@ -123,7 +123,7 @@ class _HomePageState extends State<HomePage> {
width: double.infinity,
height: 125,
decoration: BoxDecoration(
color: Hexcolor('#A59E9E'),
color: HexColor('#A59E9E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent, width: 0.5),
@ -169,7 +169,7 @@ class _HomePageState extends State<HomePage> {
width: 90,
height: 30,
decoration: BoxDecoration(
color: Hexcolor('#D81A2E'),
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
@ -196,7 +196,7 @@ class _HomePageState extends State<HomePage> {
width: double.infinity,
height: 130,
decoration: BoxDecoration(
color: Hexcolor('#A59E9E'),
color: HexColor('#A59E9E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent, width: 0.5),
@ -256,7 +256,7 @@ class _HomePageState extends State<HomePage> {
width: 90,
height: 30,
decoration: BoxDecoration(
color: Hexcolor('#D81A2E'),
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
@ -364,7 +364,7 @@ class _HomePageState extends State<HomePage> {
height: 50,
),
SizedBox(
height: 5,
height: 3,
),
Texts(
TranslationBase.of(context)
@ -401,7 +401,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.white,
bold: true,
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier * 1.7,
)
],
),
@ -422,21 +422,21 @@ class _HomePageState extends State<HomePage> {
height: 50,
),
SizedBox(
height: 5,
height: 3,
),
Texts(
TranslationBase.of(context).emergencyService,
textAlign: TextAlign.center,
color: Colors.white,
bold: true,
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier * 1.7,
)
],
),
),
),
height: MediaQuery.of(context).size.width * 0.4,
color: Hexcolor("#747C80"),
color: HexColor("#747C80"),
imageName: 'emergency_service_image.png',
),
],
@ -473,7 +473,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 1.9,
fontSize: SizeConfig.textMultiplier * 1.7,
)
],
),
@ -497,7 +497,7 @@ class _HomePageState extends State<HomePage> {
height: 55,
),
SizedBox(
height: 15,
height: 10,
),
Texts(
TranslationBase.of(context)
@ -505,7 +505,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 2,
fontSize: SizeConfig.textMultiplier * 1.7,
)
],
),
@ -537,7 +537,7 @@ class _HomePageState extends State<HomePage> {
height: 50,
),
SizedBox(
height: 15,
height: 10,
),
Texts(
TranslationBase.of(context)
@ -545,7 +545,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 2.0,
fontSize: SizeConfig.textMultiplier * 1.7,
)
],
),
@ -563,7 +563,7 @@ class _HomePageState extends State<HomePage> {
),
),
SizedBox(
height: 8,
height: 5,
),
Container(
margin: EdgeInsets.only(left: 15, right: 15),
@ -698,7 +698,9 @@ class DashboardItem extends StatelessWidget {
: MediaQuery.of(context).size.height * 0.35,
decoration: BoxDecoration(
color: !hasBorder
? color != null ? color : Hexcolor('#050705').withOpacity(opacity)
? color != null
? color
: HexColor('#050705').withOpacity(opacity)
: Colors.white,
borderRadius: BorderRadius.circular(6.0),
border: hasBorder
@ -706,7 +708,7 @@ class DashboardItem extends StatelessWidget {
: Border.all(width: 0.0, color: Colors.transparent),
image: imageName != null
? DecorationImage(
image: AssetImage('assets/images/$imageName'),
image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover,
colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn),

@ -348,7 +348,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
actions: [
IconButton(
iconSize: 70,
icon: SvgPicture.asset('assets/images/robort_svg.svg',
icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
height: 100, width: 100, fit: BoxFit.cover),
onPressed: () {
triggerRobot();

@ -38,7 +38,7 @@ class MyBalancePage extends StatelessWidget {
width: double.infinity,
height: 65,
decoration: BoxDecoration(
color: Hexcolor('#B61422'),
color: HexColor('#B61422'),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),
@ -96,8 +96,7 @@ class MyBalancePage extends StatelessWidget {
textColor: Colors.white,
label: TranslationBase.of(context).createAdvancedPayment,
onTap: () {
Navigator.push(context,
FadePage(page: AdvancePaymentPage()));
Navigator.push(context, FadePage(page: AdvancePaymentPage()));
},
),
),

@ -135,7 +135,7 @@ class _WeightHomePageState extends State<WeightHomePage>
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Hexcolor('515B5D')),
shape: BoxShape.circle, color: HexColor('515B5D')),
child: Center(
child: Icon(
Icons.add,

@ -15,8 +15,7 @@ class WeightMonthlyPage extends StatelessWidget {
final List<charts.Series<YearMonthlyChartDate, int>> data;
final List<WeightMeasurementResult> diabtecPatientResult;
const WeightMonthlyPage(
{Key key, this.data, this.diabtecPatientResult})
const WeightMonthlyPage({Key key, this.data, this.diabtecPatientResult})
: super(key: key);
@override
@ -67,7 +66,7 @@ class WeightMonthlyPage extends StatelessWidget {
children: [
Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -83,18 +82,26 @@ class WeightMonthlyPage extends StatelessWidget {
),
Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Time', color: Colors.white,fontSize: 15,),
child: Texts(
'Time',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Value', color: Colors.white,fontSize: 15,),
child: Texts(
'Value',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
],

@ -29,8 +29,9 @@ class WeightWeeklyPage extends StatelessWidget {
dateTimeFactory: const charts.LocalDateTimeFactory(),
),
),
SizedBox(height: 12,),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('Details'),
@ -62,7 +63,7 @@ class WeightWeeklyPage extends StatelessWidget {
children: [
Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -78,37 +79,50 @@ class WeightWeeklyPage extends StatelessWidget {
),
Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Time', color: Colors.white,fontSize: 15,),
child: Texts(
'Time',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Value', color: Colors.white,fontSize: 15,),
child: Texts(
'Value',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
),
child: Center(
child: Texts('Edit', color: Colors.white,fontSize: 15,),
child: Texts(
'Edit',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
],
),
);
diabtecPatientResult.forEach((diabtec) {
diabtecPatientResult.forEach(
(diabtec) {
tableRow.add(
TableRow(
children: [

@ -65,7 +65,7 @@ class WeightYearPage extends StatelessWidget {
children: [
Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -81,18 +81,26 @@ class WeightYearPage extends StatelessWidget {
),
Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Time', color: Colors.white,fontSize: 15,),
child: Texts(
'Time',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Value', color: Colors.white,fontSize: 15,),
child: Texts(
'Value',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
],

@ -138,7 +138,7 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage>
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Hexcolor('515B5D')),
shape: BoxShape.circle, color: HexColor('515B5D')),
child: Center(
child: Icon(
Icons.add,

@ -67,7 +67,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -85,7 +85,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts(
@ -99,7 +99,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts(
@ -113,7 +113,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
@ -149,7 +149,8 @@ class BloodPressureMonthlyPage extends StatelessWidget {
),
),
),
Container(child: Container(
Container(
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
@ -160,7 +161,8 @@ class BloodPressureMonthlyPage extends StatelessWidget {
fontSize: 12,
),
),
),),
),
),
Container(
child: Container(
height: 70,

@ -65,7 +65,7 @@ class BloodPressureYearPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -83,7 +83,7 @@ class BloodPressureYearPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts(
@ -97,7 +97,7 @@ class BloodPressureYearPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts(
@ -108,11 +108,10 @@ class BloodPressureYearPage extends StatelessWidget {
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),

@ -30,8 +30,9 @@ class BloodPressureWeeklyPage extends StatelessWidget {
dateTimeFactory: const charts.LocalDateTimeFactory(),
),
),
SizedBox(height: 12,),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('Details'),
@ -64,7 +65,7 @@ class BloodPressureWeeklyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -82,50 +83,67 @@ class BloodPressureWeeklyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Time', color: Colors.white,fontSize: 15,),
child: Texts(
'Time',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Measured', color: Colors.white,fontSize: 15,),
child: Texts(
'Measured',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Value', color: Colors.white,fontSize: 15,),
child: Texts(
'Value',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
),
child: Center(
child: Texts('Edit', color: Colors.white,fontSize: 15,),
child: Texts(
'Edit',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
],
),
);
diabtecPatientResult.forEach((diabtec) {
diabtecPatientResult.forEach(
(diabtec) {
tableRow.add(
TableRow(
children: [

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart';
@ -14,7 +13,8 @@ class BloodMonthlyPage extends StatelessWidget {
final List<charts.Series<YearMonthlyChartDate, int>> data;
final List<DiabtecPatientResult> diabtecPatientResult;
const BloodMonthlyPage({Key key, this.data,this.diabtecPatientResult}) : super(key: key);
const BloodMonthlyPage({Key key, this.data, this.diabtecPatientResult})
: super(key: key);
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -24,14 +24,14 @@ class BloodMonthlyPage extends StatelessWidget {
width: double.maxFinite,
height: 180,
color: Colors.white,
child: charts.LineChart(
data,
child: charts.LineChart(data,
//animate: animate,
defaultRenderer: new charts.LineRendererConfig(includePoints: true)
defaultRenderer:
new charts.LineRendererConfig(includePoints: true)),
),
SizedBox(
height: 12,
),
SizedBox(height: 12,),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('Details'),
@ -51,7 +51,6 @@ class BloodMonthlyPage extends StatelessWidget {
],
),
)
],
),
);
@ -65,7 +64,7 @@ class BloodMonthlyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -83,41 +82,53 @@ class BloodMonthlyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Time', color: Colors.white,fontSize: 15,),
child: Texts(
'Time',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Measured', color: Colors.white,fontSize: 15,),
child: Texts(
'Measured',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
),
child: Center(
child: Texts('Value', color: Colors.white,fontSize: 15,),
child: Texts(
'Value',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
],
),
);
diabtecPatientResult.forEach((diabtec) {
diabtecPatientResult.forEach(
(diabtec) {
tableRow.add(
TableRow(
children: [
@ -177,7 +188,6 @@ class BloodMonthlyPage extends StatelessWidget {
),
),
),
],
),
);

@ -64,7 +64,7 @@ class BloodYearPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -82,7 +82,7 @@ class BloodYearPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts(
@ -96,7 +96,7 @@ class BloodYearPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts(
@ -107,11 +107,10 @@ class BloodYearPage extends StatelessWidget {
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),

@ -37,7 +37,6 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
_tabController.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<BloodSugarViewMode>(
@ -78,7 +77,8 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
indicatorSize: TabBarIndicatorSize.label,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0),
labelPadding:
EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
@ -114,27 +114,37 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
BloodSugarWeeklyPage(data: model.getBloodWeeklySeries(),diabtecPatientResult: model.weekDiabtecPatientResult,),
BloodMonthlyPage(data: model.getBloodMonthlyTimeSeriesSales(),diabtecPatientResult: model.monthDiabtecPatientResult,),
BloodYearPage(data: model.getBloodYearTimeSeriesSales(),diabtecPatientResult: model.yearDiabtecPatientResult,)
BloodSugarWeeklyPage(
data: model.getBloodWeeklySeries(),
diabtecPatientResult: model.weekDiabtecPatientResult,
),
BloodMonthlyPage(
data: model.getBloodMonthlyTimeSeriesSales(),
diabtecPatientResult: model.monthDiabtecPatientResult,
),
BloodYearPage(
data: model.getBloodYearTimeSeriesSales(),
diabtecPatientResult: model.yearDiabtecPatientResult,
)
],
),
)
],
),
floatingActionButton: InkWell(
onTap: (){
onTap: () {
Navigator.push(context, FadePage(page: AddBloodSugarPage()));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Hexcolor('515B5D')
),
shape: BoxShape.circle, color: HexColor('515B5D')),
child: Center(
child: Icon(Icons.add,color: Colors.white,),
child: Icon(
Icons.add,
color: Colors.white,
),
),
),
),

@ -29,8 +29,9 @@ class BloodSugarWeeklyPage extends StatelessWidget {
dateTimeFactory: const charts.LocalDateTimeFactory(),
),
),
SizedBox(height: 12,),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('Details'),
@ -63,7 +64,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -81,50 +82,67 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Time', color: Colors.white,fontSize: 15,),
child: Texts(
'Time',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Measured', color: Colors.white,fontSize: 15,),
child: Texts(
'Measured',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Value', color: Colors.white,fontSize: 15,),
child: Texts(
'Value',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
),
child: Center(
child: Texts('Edit', color: Colors.white,fontSize: 15,),
child: Texts(
'Edit',
color: Colors.white,
fontSize: 15,
),
),
height: 40),
),
],
),
);
diabtecPatientResult.forEach((diabtec) {
diabtecPatientResult.forEach(
(diabtec) {
tableRow.add(
TableRow(
children: [

@ -52,7 +52,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -69,7 +69,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),

@ -46,15 +46,21 @@ class VitalSignItem extends StatelessWidget {
des,
style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Hexcolor('#B8382C'),
fontWeight: FontWeight.bold,),
color: HexColor('#B8382C'),
fontWeight: FontWeight.bold,
),
),
),
),
),
Expanded(
flex: 1,
child: Container(child: Icon(icon,size: 40,),),
child: Container(
child: Icon(
icon,
size: 40,
),
),
)
],
),
@ -65,7 +71,7 @@ class VitalSignItem extends StatelessWidget {
child: Align(
alignment: Alignment.topRight,
child: Container(
margin: EdgeInsets.only(left: 5,right: 5),
margin: EdgeInsets.only(left: 5, right: 5),
child: RichText(
text: TextSpan(
style: TextStyle(color: Colors.black),
@ -74,7 +80,7 @@ class VitalSignItem extends StatelessWidget {
TextSpan(
text: unit,
style: TextStyle(
color: Hexcolor('#B8382C'),
color: HexColor('#B8382C'),
),
),
]),

@ -41,7 +41,7 @@ class PaymentService extends StatelessWidget {
children: [
Texts(
TranslationBase.of(context).payment,
color: Hexcolor('#B61422'),
color: HexColor('#B61422'),
bold: true,
),
Texts(
@ -73,7 +73,7 @@ class PaymentService extends StatelessWidget {
children: [
Texts(
TranslationBase.of(context).onlineCheckIn,
color: Hexcolor('#B61422'),
color: HexColor('#B61422'),
bold: true,
),
Texts(
@ -115,7 +115,7 @@ class PaymentService extends StatelessWidget {
children: [
Texts(
'My Balances',
color: Hexcolor('#B61422'),
color: HexColor('#B61422'),
bold: true,
),
Texts(

@ -226,7 +226,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
child: Texts(
'Later',
decoration: TextDecoration.underline,
color: Hexcolor('#151DFE'),
color: HexColor('#151DFE'),
fontSize: 18,
),
)

@ -177,7 +177,9 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
},
),
),
SizedBox(height: 12,),
SizedBox(
height: 12,
),
Container(
width: double.infinity,
child: Column(
@ -222,7 +224,7 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
child: Texts(
'Later',
decoration: TextDecoration.underline,
color: Hexcolor('#151DFE'),
color: HexColor('#151DFE'),
fontSize: 18,
),
)

@ -14,7 +14,7 @@ class SearchProvider with ChangeNotifier {
static var sessionID = new DateTime.now().millisecondsSinceEpoch;
Future<dynamic> getBotPages(request) async {
try {
request['SessionID'] = sessionID;
request['SessionID'] = '123';
await BaseAppClient().post(SEARCH_BOT,
onSuccess: (dynamic response, int statusCode) {
pageData = response;

@ -105,7 +105,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
: 19),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
color: widget.backgroundColor ?? Hexcolor('#515b5d'),
color: widget.backgroundColor ?? HexColor('#515b5d'),
boxShadow: [
BoxShadow(
color: Color.fromRGBO(

@ -155,7 +155,9 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
width: double.infinity,
child: Text(widget.details ?? 'No Data')),
),
SizedBox(height: 12,),
SizedBox(
height: 12,
),
BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResult(
patientLabOrder: widget.patientLabOrder),
@ -166,7 +168,8 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
children: [
InkWell(
onTap: () {
setState(() {
setState(
() {
_isShowMoreGeneral = !_isShowMoreGeneral;
},
);
@ -269,10 +272,14 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0): Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
),
),
child: Center(
@ -287,8 +294,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
),
child: Center(
child: Texts('Value', color: Colors.white),
@ -298,10 +304,14 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(10.0):Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
),
),
child: Center(

@ -27,7 +27,7 @@ class MedicalProfileItem extends StatelessWidget {
title,
style: TextStyle(
fontSize: 1.5 * SizeConfig.textMultiplier,
color: Hexcolor('#B8382C'),
color: HexColor('#B8382C'),
fontWeight: FontWeight.bold),
),
RichText(

@ -12,16 +12,28 @@ class AppExpandableNotifier extends StatefulWidget {
final Widget bodyWidget;
final String title;
final Widget collapsed;
final bool isExpand;
bool expandFlag = false;
var controller = new ExpandableController();
AppExpandableNotifier(
{this.headerWidget, this.bodyWidget, this.title, this.collapsed});
{this.headerWidget,
this.bodyWidget,
this.title,
this.collapsed,
this.isExpand});
_AppExpandableNotifier createState() => _AppExpandableNotifier();
}
class _AppExpandableNotifier extends State<AppExpandableNotifier> {
@override
Widget build(BuildContext context) {
setState(() {
if (widget.isExpand == true) {
widget.expandFlag = widget.isExpand;
widget.controller.expanded = true;
}
});
return ExpandableNotifier(
child: Padding(
padding: const EdgeInsets.only(left: 10, right: 10, top: 4),

@ -66,7 +66,7 @@ class AppScaffold extends StatelessWidget {
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.of(context).popUntil(ModalRoute.withName('/'));
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
},
),
],

@ -92,23 +92,31 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
var sharedPref = new AppSharedPreferences();
bool _hasSpeech = false;
ProjectViewModel projectProvider;
@override
void initState() {
super.initState();
event.controller.stream.listen((p) {
if (p['isRobot'] == 'true') {
if (this.mounted) {
setState(() {
position = Offset(250, 400);
activeAnimation = false;
});
}
}
});
Future.delayed(const Duration(seconds: 2), () {
// _currentLocaleId =
// TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
// ? 'en-US'
// : 'ar-SA';
requestPermissions();
// Future.delayed(const Duration(seconds: 10), () {
initSpeechState().then((value) => {});
getUserData();
// });
});
super.initState();
}
@override
@ -168,11 +176,15 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
// children: <Widget>[
GestureDetector(
child: Container(
child: SvgPicture.asset('assets/images/robort_svg.svg'),
child: SvgPicture.asset('assets/images/svg/robort_svg.svg'),
),
onTap: () {
new RoboSearch(context: context).showAlertDialog(context);
startVoiceSearch();
showDialog(
context: context,
builder: (_) {
return RoboSearch();
});
initSpeechState().then((value) => {startVoiceSearch()});
},
),
// ],
@ -203,13 +215,11 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
startVoiceSearch() async {
_currentLocaleId =
TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'en-US'
: 'ar-SA';
TranslationBase.of(AppGlobal.context).locale.languageCode;
speech.listen(
onResult: resultListener,
listenFor: Duration(seconds: 10),
localeId: _currentLocaleId,
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
onSoundLevelChange: soundLevelListener,
cancelOnError: true,
partialResults: true,
@ -219,12 +229,12 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
void resultListener(SpeechRecognitionResult result) {
// lastWords = "${result.recognizedWords} - ${result.finalResult}";
print(result);
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
if (result.finalResult == true) {
// setState(() {
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
// setState(() {
// searchText = reconizedWord;
// });
@ -236,8 +246,9 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
}
Future _speak(reconizedWord) async {
Navigator.of(AppGlobal.context).pop();
//await flutterTts.speak(reconizedWord);
RoboSearch.closeAlertDialog(context);
//RoboSearch.closeAlertDialog(context);
getPages(reconizedWord);
}
@ -259,13 +270,13 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
if (hasSpeech) {
_currentLocaleId =
TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'en-US'
: 'ar-SA'; // systemLocale.localeId;
//if (hasSpeech) {
// _currentLocaleId =
// _currentLocaleId == 'en'
// ? 'en-US'
// : 'ar-SA'; // systemLocale.localeId;
}
// }
if (!mounted) return;
// setState(() {
@ -274,6 +285,8 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
}
void errorListener(SpeechRecognitionError error) {
print(error);
event.setValue({"searchText": 'null'});
//setState(() {
// reconizedWord = "${error.errorMsg} - ${error.permanent}";
//});
@ -289,9 +302,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
getPages(text) {
var request = {
'VoiceMessage': text,
'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'En'
: 'Ar'
'Lang': _currentLocaleId == 'en' ? 'En' : 'Ar'
};
searchProvider
@ -306,62 +317,70 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
switch (result["CommandNumber"]) {
case '100':
{
List clnicID = unique(result['ClinicId']);
if (result['ProjectId'] != 0 &&
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
doctorId: result['DoctorId'],
doctorName: null,
);
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] != 0 &&
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
);
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] == 0 &&
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
);
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] == 0 &&
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
result['ClinicId'].length > 0 ? result['ClinicId'][0] : 0,
context,
doctorId: result['DoctorId'],
doctorName: null,
);
} else {
goToClinic(clnicID);
}
} else {
goToClinic(clnicID);
}
// List clnicID = unique(result['ClinicId']);
// if (result['ProjectId'] != 0 &&
// clnicID.length > 0 &&
// result['DoctorId'].length > 0) {
// if (clnicID.length == 1) {
// getDoctorsList(
// result['ProjectId'],
// clnicID[0],
// context,
// doctorId: result['DoctorId'],
// doctorName: null,
// );
// } else {
// goToClinic(clnicID);
// }
// } else if (result['ProjectId'] != 0 &&
// clnicID.length > 0 &&
// result['DoctorId'].length == 0) {
// if (clnicID.length == 1) {
// getDoctorsList(
// result['ProjectId'],
// clnicID[0],
// context,
// );
// } else {
// goToClinic(clnicID);
// }
// } else if (result['ProjectId'] == 0 &&
// clnicID.length > 0 &&
// result['DoctorId'].length == 0) {
// if (clnicID.length == 1) {
// getDoctorsList(
// result['ProjectId'],
// clnicID[0],
// context,
// );
// } else {
// goToClinic(clnicID);
// }
// } else if (result['ProjectId'] == 0 &&
// clnicID.length > 0 &&
// result['DoctorId'].length > 0) {
// if (clnicID.length == 1) {
// getDoctorsList(
// result['ProjectId'],
// clnicID[0],
// context,
// doctorId: result['DoctorId'],
// doctorName: null,
// );
// } else {
// goToClinic(clnicID);
// }
// } else {
// goToClinic(clnicID);
// }
// speak();
}
break;
@ -680,7 +699,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
break;
default:
Navigator.of(context).pushNamed(HOME);
Navigator.of(AppGlobal.context).pushNamed(HOME);
speak();
break;
}
@ -803,12 +822,12 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
}
speak() async {
if (_currentLocaleId == 'en-US' && results['ReturnMessage'] != null) {
if (_currentLocaleId == 'en' && results['ReturnMessage'] != null) {
await flutterTts.setVoice("en-us-x-sfg#male_2-local");
await flutterTts.setLanguage(_currentLocaleId);
await flutterTts.setLanguage("en-US");
await flutterTts.speak(results['ReturnMessage']);
} else if (results['ReturnMessage_Ar'] != null) {
await flutterTts.setLanguage(_currentLocaleId);
await flutterTts.setLanguage("ar-SA");
await flutterTts.setVoice("ar-sa-x-sfg#male_1-local");
await flutterTts.speak(results['ReturnMessage_Ar']);
@ -834,11 +853,14 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
}
getUserData() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
setState(() async {
//setState(() async {
user = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
});
// });
}
print(_currentLocaleId);
}
}

@ -1,80 +1,249 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/search.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RoboSearch {
final BuildContext context;
var event = RobotProvider();
var searchText = null;
RoboSearch({
@required this.context,
});
class RoboSearch extends StatefulWidget {
@override
_RoboSearch createState() => new _RoboSearch();
}
showAlertDialog(BuildContext context) {
// set up the buttons
class _RoboSearch extends State<RoboSearch> {
var event = RobotProvider();
var searchText = '';
bool isRetry = false;
var tween = Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: Curves.ease));
// set up the AlertDialog
AlertDialog alert = AlertDialog(
content: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
setState((){
@override
void initState() {
event.controller.stream.listen((p) {
if (p['searchText']!=null) {
if (p['searchText'] != null) {
if (p['searchText'] == 'null') {
//Future.delayed(const Duration(seconds: 1), () {
if (mounted) {
setState(() {
searchText = p['searchText'];
isRetry = true;
searchText = '';
});
}
//});
} else {
if (mounted) {
setState(() {
searchText = p['searchText'];
});
}
}
}
});
return Container(
super.initState();
}
@override
Widget build(BuildContext context) {
return AlertDialog(
content: Container(
color: Colors.white,
height: SizeConfig.realScreenHeight * 0.5,
width: SizeConfig.realScreenWidth * 0.8,
child: Container(
child: Column(children: [
Expanded(
flex: 1,
child: Center(
child: Image.asset(
'assets/images/habib-logo.png',
height: 75,
width: 75,
))),
Expanded(
flex: 3,
child: Center(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
isRetry == true
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.all(20),
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(width: 2, color: Colors.red)),
borderRadius:
BorderRadius.circular(100),
border: Border.all(
width: 5, color: Colors.red)),
child: Icon(
Icons.mic,
color: Colors.blue,
size: 48,
),
))),
Expanded(
flex: 1, child: Center(child: Text( searchText != null ? searchText : 'Try saying something' )))
]),
));
}),
);
// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
)),
Center(
child: AppText(
"Didn't catch that, Try speaking again",
fontSize: 14,
)),
RaisedButton(
color: Colors.transparent,
onPressed: () {
setState(() {
isRetry = false;
});
FloatingSearchButton()
.createState()
.startVoiceSearch();
},
);
}
static closeAlertDialog(BuildContext context) {
Navigator.of(context).pop();
child: AppText(
'Try again',
color: Colors.blue,
))
])
: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.all(20),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(100)),
child: Icon(
Icons.mic,
color: Colors.white,
size: 48,
)),
SizedBox(height: 20),
Center(
child: Text(searchText == ''
? 'Try saying something'
: searchText))
],
)
]),
)));
}
}
// class RoboSearch {
// final BuildContext context;
// var event = RobotProvider();
// var searchText = '';
// bool isRetry = false;
// var tween = Tween(begin: 0.0, end: 1.0).chain(CurveTween(curve: Curves.ease));
// RoboSearch({
// @required this.context,
// });
// showAlertDialog(BuildContext context) {
// // set up the buttons
// // set up the AlertDialog
// AlertDialog alert = AlertDialog(
// content: StatefulBuilder(
// builder: (BuildContext context, StateSetter setState) {
// event.controller.stream.listen((p) {
// if (p['searchText'] != null) {
// if (p['searchText'] == 'null') {
// Future.delayed(const Duration(seconds: 1), ()
// {
// setState(() {
// isRetry = true;
// searchText = '';
// });
// });
// } else {
// Future.delayed(const Duration(seconds: 1), ()
// {
// setState(() {
// searchText = p['searchText'];
// });
// });
// }
// }
// });
// return Container(
// color: Colors.white,
// height: SizeConfig.realScreenHeight * 0.5,
// width: SizeConfig.realScreenWidth * 0.8,
// child: Container(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// isRetry == true
// ? Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Container(
// margin: EdgeInsets.all(20),
// padding: EdgeInsets.all(10),
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.circular(100),
// border: Border.all(
// width: 5, color: Colors.red)),
// child: Icon(
// Icons.mic,
// color: Colors.blue,
// size: 48,
// )),
// Center(
// child: AppText(
// "Didn't catch that, Try speaking again",
// fontSize: 14,
// )),
// RaisedButton(
// color: Colors.transparent,
// onPressed: () {
// setState(() {
// isRetry = false;
// });
// startVoiceSearch();
// },
// child: AppText(
// 'Try again',
// color: Colors.blue,
// ))
// ])
// : Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Container(
// margin: EdgeInsets.all(20),
// padding: EdgeInsets.all(20),
// decoration: BoxDecoration(
// color: Colors.blue,
// borderRadius: BorderRadius.circular(100)),
// child: Icon(
// Icons.mic,
// color: Colors.white,
// size: 48,
// )),
// SizedBox(height: 20),
// Center(
// child: Text(searchText == ''
// ? 'Try saying something'
// : searchText))
// ],
// )
// ]),
// ));
// }),
// );
// // show the dialog
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return alert;
// },
// );
// }
// static closeAlertDialog(BuildContext context) {
// Navigator.of(context).pop();
// }
// startVoiceSearch() {
// // Navigator.of(context).pop();
// //this.showAlertDialog(context);
// // new RoboSearch(context: context).showAlertDialog(context);
// FloatingSearchButton().createState().startVoiceSearch();
// }
// }

@ -20,7 +20,7 @@ dependencies:
webview_flutter: ^0.3.24
# http client
http: ^0.12.1
connectivity: ^0.4.9
connectivity: ^0.4.9+3
# State Management
provider: ^4.3.2+2
@ -161,9 +161,7 @@ flutter:
- assets/images/login/
- assets/json/
- assets/sounds/
- assets/images/symptom.svg
- assets/images/robort_svg.svg
- assets/images/svg/
- assets/tracker/

Loading…
Cancel
Save