voice command

merge-update-with-lab-changes
Sultan Khan 5 years ago
parent eeb073fb17
commit 9fca52efca

@ -42,6 +42,7 @@ class _HomePageState extends State<HomePage> {
onModelReady: (model) => model.getPatientRadOrders(), onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isHelp: true,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -69,7 +70,7 @@ class _HomePageState extends State<HomePage> {
right: 5, right: 5,
child: Container( child: Container(
width: width:
MediaQuery.of(context).size.width * 0.8, MediaQuery.of(context).size.width * 0.8,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -84,54 +85,82 @@ class _HomePageState extends State<HomePage> {
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
color: color:
Colors.white.withOpacity(0.3), Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5))), Radius.circular(5))),
child: Container( child: Container(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).covidTest, Texts(
color: Colors.white, TranslationBase.of(context)
fontWeight: FontWeight.w700, .covidTest,
), color: Colors.white,
fontWeight: FontWeight.w700,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment:
MainAxisAlignment
.spaceAround,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 15.0,), top: 15.0,
),
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg', 'assets/images/new-design/covid-19-car.svg',
width: 45.0, width: 45.0,
height: 45.0), height: 45.0),
), ),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(
top: 5.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Texts(TranslationBase.of(context).driveThru, Texts(
fontWeight: FontWeight.w700, TranslationBase.of(
color: Colors.white,), context)
.driveThru,
fontWeight:
FontWeight.w700,
color: Colors.white,
),
ButtonTheme( ButtonTheme(
shape: RoundedRectangleBorder( shape:
RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.circular(5.0),), BorderRadius
minWidth: MediaQuery.of(context).size.width * 0.15, .circular(
5.0),
),
minWidth: MediaQuery.of(
context)
.size
.width *
0.15,
height: 25.0, height: 25.0,
child: RaisedButton( child: RaisedButton(
color: Colors.red[800], color: Colors
textColor: Colors.white, .red[800],
disabledTextColor: Colors.white, textColor:
disabledColor: new Color(0xFFbcc2c4), Colors.white,
disabledTextColor:
Colors.white,
disabledColor:
new Color(
0xFFbcc2c4),
onPressed: () { onPressed: () {
navigateToCovidDriveThru(); navigateToCovidDriveThru();
}, },
child: Texts( child: Texts(
TranslationBase.of(context).bookNow, TranslationBase.of(
fontWeight: FontWeight.w700, context)
color: Colors.white, .bookNow,
), fontWeight:
FontWeight
.w700,
color: Colors
.white,
),
), ),
), ),
], ],
@ -172,251 +201,255 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
), ),
Container(width: double.infinity, height:projectViewModel.isArabic ?110: 80) Container(
width: double.infinity,
height: projectViewModel.isArabic ? 110 : 80)
], ],
), ),
Positioned( Positioned(
top: 155, top: 155,
left: MediaQuery.of(context).size.width * left: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation ==
Orientation.landscape Orientation.landscape
? 0.02 ? 0.02
: 0.03), : 0.03),
right: MediaQuery.of(context).size.width * right: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation ==
Orientation.landscape Orientation.landscape
? 0.02 ? 0.02
: 0.03), : 0.03),
child: (!model.isLogin) child: (!model.isLogin)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: 125, height: 125,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
color: Colors.transparent, width: 0.5), color: Colors.transparent, width: 0.5),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(9)), BorderRadius.all(Radius.circular(9)),
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage(
'assets/images/bg_graphic.png'), 'assets/images/bg_graphic.png'),
fit: BoxFit.cover)), fit: BoxFit.cover)),
child: Container( child: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 2, height: 2,
),
Texts(
TranslationBase.of(context).myMedicalFile,
color: Colors.black87,
fontWeight: FontWeight.w700,
fontSize: 23,
),
Texts(
TranslationBase.of(context)
.myMedicalFileSubTitle,
color: Colors.black,
fontSize: 16,
),
Align(
alignment: projectViewModel.isArabic
? Alignment.bottomLeft
: Alignment.bottomRight,
child: InkWell(
onTap: () {
widget.goToMyProfile();
},
child: Container(
margin: EdgeInsets.only(left: 15,right: 15),
width: 90,
height: 30,
decoration: BoxDecoration(
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(0)),
), ),
child: Center( Texts(
child: Texts( TranslationBase.of(context).myMedicalFile,
TranslationBase.of(context).viewMore, color: Colors.black87,
color: Colors.white, fontWeight: FontWeight.w700,
fontWeight: FontWeight.w700, fontSize: 23,
fontSize: 12,
),
), ),
), Texts(
), TranslationBase.of(context)
) .myMedicalFileSubTitle,
], color: Colors.black,
), fontSize: 16,
), ),
) Align(
: Container( alignment: projectViewModel.isArabic
width: double.infinity, ? Alignment.bottomLeft
height: projectViewModel.isArabic ? 160:130, : Alignment.bottomRight,
decoration: BoxDecoration( child: InkWell(
color: HexColor('#A59E9E'), onTap: () {
shape: BoxShape.rectangle, widget.goToMyProfile();
border: Border.all( },
color: Colors.transparent, width: 0.5), child: Container(
borderRadius: margin: EdgeInsets.only(
BorderRadius.all(Radius.circular(9)), left: 15, right: 15),
image: DecorationImage( width: 90,
image: ExactAssetImage( height: 30,
'assets/images/bg_graphic.png'), decoration: BoxDecoration(
fit: BoxFit.cover), color: HexColor('#D81A2E'),
), shape: BoxShape.rectangle,
child: Container( border: Border.all(
margin: EdgeInsets.all(5), color: Colors.transparent,
child: Column( width: 0.5),
children: <Widget>[ borderRadius: BorderRadius.all(
Row( Radius.circular(0)),
children: <Widget>[
if (projectViewModel.user != null && model.isLogin)
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 8,
),
Texts(
model.user.firstName +
" " +
model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
Texts(
'${model.user.patientID}',
color: Colors.white,
fontSize: 14,
),
SizedBox(
height: 5,
), ),
Texts( child: Center(
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', child: Texts(
color: Colors.grey[100], TranslationBase.of(context)
fontWeight: FontWeight.normal, .viewMore,
fontSize: 14, color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 12,
),
), ),
],
),
),
InkWell(
onTap: () {
widget.goToMyProfile();
},
child: Container(
margin: EdgeInsets.all(2),
width: 90,
height: 30,
decoration: BoxDecoration(
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(5),
), ),
), ),
child: Center( )
child: Texts( ],
TranslationBase.of(context) ),
.viewMore,
color: Colors.white,
fontSize: 12,
),
),
),
)
],
), ),
Row( )
children: <Widget>[ : Container(
Expanded( width: double.infinity,
child: Row( height: projectViewModel.isArabic ? 160 : 130,
decoration: BoxDecoration(
color: HexColor('#A59E9E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent, width: 0.5),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage(
image: ExactAssetImage(
'assets/images/bg_graphic.png'),
fit: BoxFit.cover),
),
child: Container(
margin: EdgeInsets.all(5),
child: Column(
children: <Widget>[
Row(
children: <Widget>[ children: <Widget>[
Image.asset( if (projectViewModel.user != null &&
'assets/images/height_icon.png', model.isLogin)
width: 35, Expanded(
height: 40, child: Column(
), crossAxisAlignment:
Texts( CrossAxisAlignment.start,
"${model.heightCm}", children: <Widget>[
color: Colors.white, SizedBox(
fontSize: 17, height: 8,
),
Texts(
model.user.firstName +
" " +
model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
Texts(
'${model.user.patientID}',
color: Colors.white,
fontSize: 14,
),
SizedBox(
height: 5,
),
Texts(
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}',
color: Colors.grey[100],
fontWeight: FontWeight.normal,
fontSize: 14,
),
],
),
),
InkWell(
onTap: () {
widget.goToMyProfile();
},
child: Container(
margin: EdgeInsets.all(2),
width: 90,
height: 30,
decoration: BoxDecoration(
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Center(
child: Texts(
TranslationBase.of(context)
.viewMore,
color: Colors.white,
fontSize: 12,
),
),
),
) )
], ],
), ),
), Row(
SizedBox(
width: 3,
),
Expanded(
child: Row(
children: <Widget>[ children: <Widget>[
Image.asset( Expanded(
'assets/images/weight_icon.png', child: Row(
width: 25, children: <Widget>[
height: 40, Image.asset(
'assets/images/height_icon.png',
width: 35,
height: 40,
),
Texts(
"${model.heightCm}",
color: Colors.white,
fontSize: 17,
)
],
),
), ),
Texts( SizedBox(
'${model.weightKg}', width: 3,
color: Colors.white, ),
fontSize: 17 Expanded(
) child: Row(
], children: <Widget>[
), Image.asset(
), 'assets/images/weight_icon.png',
SizedBox( width: 25,
width: 3, height: 40,
), ),
Expanded( Texts('${model.weightKg}',
child: Row( color: Colors.white,
mainAxisAlignment: fontSize: 17)
MainAxisAlignment.spaceBetween, ],
children: <Widget>[ ),
Image.asset( ),
'assets/images/blood_icon.png', SizedBox(
width: 35, width: 3,
height: 40, ),
Expanded(
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Image.asset(
'assets/images/blood_icon.png',
width: 35,
height: 40,
),
Texts(
'${model.booldType}',
color: Colors.white,
)
],
),
), ),
Texts(
'${model.booldType}',
color: Colors.white,
)
], ],
), )
), ],
], ),
) ),
], ),
),
),
),
), ),
], ],
), ),
if(projectViewModel.havePrivilege(64)||projectViewModel.havePrivilege(65)||projectViewModel.havePrivilege(67)) if (projectViewModel.havePrivilege(64) ||
projectViewModel.havePrivilege(65) ||
projectViewModel.havePrivilege(67))
Container( Container(
margin: EdgeInsets.only(left: 15, right: 15), margin: EdgeInsets.only(left: 15, right: 15),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
if(projectViewModel.havePrivilege(64)) if (projectViewModel.havePrivilege(64))
DashboardItem( DashboardItem(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -444,7 +477,8 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: SizeConfig.textMultiplier * 1.55, fontSize:
SizeConfig.textMultiplier * 1.55,
) )
], ],
), ),
@ -454,10 +488,10 @@ class _HomePageState extends State<HomePage> {
imageName: 'home_healthcare_service_bg.png', imageName: 'home_healthcare_service_bg.png',
opacity: 0.5, opacity: 0.5,
), ),
if(projectViewModel.havePrivilege(65)) if (projectViewModel.havePrivilege(65))
DashboardItem( DashboardItem(
onTap: () => Navigator.push(context, FadePage(page: LandingPagePharmacy())), onTap: () => Navigator.push(
context, FadePage(page: LandingPagePharmacy())),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -472,11 +506,13 @@ class _HomePageState extends State<HomePage> {
height: 20, height: 20,
), ),
Texts( Texts(
TranslationBase.of(context).onlinePharmacy, TranslationBase.of(context)
.onlinePharmacy,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: SizeConfig.textMultiplier * 1.55, fontSize:
SizeConfig.textMultiplier * 1.55,
) )
], ],
), ),
@ -485,9 +521,9 @@ class _HomePageState extends State<HomePage> {
height: MediaQuery.of(context).size.width * 0.4, height: MediaQuery.of(context).size.width * 0.4,
imageName: 'al-habib_onlne_pharmacy_bg.png', imageName: 'al-habib_onlne_pharmacy_bg.png',
), ),
if(projectViewModel.havePrivilege(67)) if (projectViewModel.havePrivilege(67))
DashboardItem( DashboardItem(
onTap: (){ onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -506,14 +542,16 @@ class _HomePageState extends State<HomePage> {
height: 50, height: 50,
), ),
SizedBox( SizedBox(
height:10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context).emergencyService, TranslationBase.of(context)
.emergencyService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: SizeConfig.textMultiplier * 1.55, fontSize:
SizeConfig.textMultiplier * 1.55,
) )
], ],
), ),
@ -601,7 +639,7 @@ class _HomePageState extends State<HomePage> {
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
color: Colors.white, color: Colors.white,
)), )),
if(projectViewModel.havePrivilege(60)) if (projectViewModel.havePrivilege(60))
Container( Container(
width: MediaQuery.of(context).size.width * 0.29, width: MediaQuery.of(context).size.width * 0.29,
child: InkWell( child: InkWell(
@ -609,8 +647,8 @@ class _HomePageState extends State<HomePage> {
context, context,
FadePage( FadePage(
page: ErOptions( page: ErOptions(
isAppbar: true, isAppbar: true,
))), ))),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -630,7 +668,8 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
fontSize: SizeConfig.textMultiplier * 1.7, fontSize:
SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -757,15 +796,15 @@ class _HomePageState extends State<HomePage> {
class DashboardItem extends StatelessWidget { class DashboardItem extends StatelessWidget {
const DashboardItem( const DashboardItem(
{this.hasBorder = false, {this.hasBorder = false,
this.imageName, this.imageName,
@required this.child, @required this.child,
this.onTap, this.onTap,
Key key, Key key,
this.width, this.width,
this.height, this.height,
this.color, this.color,
this.opacity = 0.4, this.opacity = 0.4,
this.hasColorFilter = true}) this.hasColorFilter = true})
: super(key: key); : super(key: key);
final bool hasBorder; final bool hasBorder;
final String imageName; final String imageName;
@ -783,14 +822,16 @@ class DashboardItem extends StatelessWidget {
onTap: onTap, onTap: onTap,
child: Container( child: Container(
width: width != null ? width : MediaQuery.of(context).size.width * 0.29, width: width != null ? width : MediaQuery.of(context).size.width * 0.29,
height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait height: height != null
? MediaQuery.of(context).size.height * 0.17 ? height
: MediaQuery.of(context).size.height * 0.35, : MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.height * 0.17
: MediaQuery.of(context).size.height * 0.35,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder
? color != null ? color != null
? color ? color
: HexColor('#050705').withOpacity(opacity) : HexColor('#050705').withOpacity(opacity)
: Colors.white, : Colors.white,
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
border: hasBorder border: hasBorder
@ -798,11 +839,13 @@ class DashboardItem extends StatelessWidget {
: Border.all(width: 0.0, color: Colors.transparent), : Border.all(width: 0.0, color: Colors.transparent),
image: imageName != null image: imageName != null
? DecorationImage( ? DecorationImage(
image: ExactAssetImage('assets/images/$imageName'), image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: hasColorFilter ? new ColorFilter.mode( colorFilter: hasColorFilter
Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, ? new ColorFilter.mode(
) Colors.black.withOpacity(0.2), BlendMode.dstIn)
: null,
)
: null, : null,
), ),
child: Center( child: Center(

@ -514,7 +514,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
: IconButton( : IconButton(
icon: Icon(Icons.arrow_back), icon: Icon(Icons.arrow_back),
color: Colors.white, color: Colors.white,
onPressed: () => currentTab = 0, onPressed: () {
setState(() {
currentTab = 0;
});
pageController.jumpToPage(0);
},
), ),
notificationCount != '' notificationCount != ''
? new Positioned( ? new Positioned(
@ -572,7 +578,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: [ children: [
HomePage( HomePage(
goToMyProfile: () { goToMyProfile: () {
// _changeCurrentTab(1); _changeCurrentTab(0);
}, },
), ),
MedicalProfilePage(), MedicalProfilePage(),
@ -608,7 +614,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return TranslationBase.of(context).medicalProfile; return TranslationBase.of(context).medicalProfile;
case 2: case 2:
return TranslationBase.of(context).bookAppo; return TranslationBase.of(context).bookAppo;
case 5: case 5:
return TranslationBase.of(context).bookAppo; return TranslationBase.of(context).bookAppo;
case 3: case 3:
return TranslationBase.of(context).services; return TranslationBase.of(context).services;

@ -47,67 +47,70 @@ class _BottomNavBarState extends State<BottomNavBar> {
color: Colors.white, color: Colors.white,
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 18), padding: EdgeInsets.symmetric(horizontal: 18),
child: Row( child: Directionality(
mainAxisSize: MainAxisSize.max, textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.spaceAround, child: Row(
children: [ mainAxisSize: MainAxisSize.max,
BottomNavigationItem( mainAxisAlignment: MainAxisAlignment.spaceAround,
icon: EvaIcons.home, children: [
activeIcon: EvaIcons.home, BottomNavigationItem(
changeIndex: _changeIndex, icon: DQIcons.my_medical_file,
index: widget.index, activeIcon: DQIcons.my_medical_file,
currentIndex: 0, changeIndex: _changeIndex,
name: TranslationBase.of(context).home, index: widget.index,
), currentIndex: 1,
BottomNavigationItem( name: TranslationBase.of(context).medicalProfile,
icon: DQIcons.my_medical_file, ),
activeIcon: DQIcons.my_medical_file, BottomNavigationItem(
changeIndex: _changeIndex, icon: DQIcons.family,
index: widget.index, activeIcon: DQIcons.family,
currentIndex: 1, changeIndex: _changeIndex,
name: TranslationBase.of(context).medicalProfile, index: widget.index,
), currentIndex: 3,
if (widget.index == 0 && projectViewModel.havePrivilege(34)) name: TranslationBase.of(context).myFamily,
Expanded(
child: SizedBox(
height: 50,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 22),
],
),
), ),
), if (widget.index == 0)
if (widget.index != 0 && projectViewModel.havePrivilege(34)) Expanded(
BottomNavigationItem( child: SizedBox(
icon: EvaIcons.calendar, height: 50,
activeIcon: EvaIcons.calendar, child: Column(
changeIndex: _changeIndex, mainAxisSize: MainAxisSize.min,
index: widget.index, mainAxisAlignment: MainAxisAlignment.center,
currentIndex: 2, children: <Widget>[
name: TranslationBase.of(context).bookAppo, SizedBox(height: 22),
), ],
BottomNavigationItem( ),
icon: DQIcons.family, ),
activeIcon: DQIcons.family, ),
changeIndex: _changeIndex, if (widget.index != 0 && projectViewModel.havePrivilege(34))
index: widget.index, BottomNavigationItem(
currentIndex: 3, icon: EvaIcons.calendar,
name: TranslationBase.of(context).myFamily, activeIcon: EvaIcons.calendar,
), changeIndex: _changeIndex,
if (projectViewModel.havePrivilege(51)) index: _index,
BottomNavigationItem( currentIndex: 2,
icon: EvaIcons.calendar, name: TranslationBase.of(context).bookAppo,
activeIcon: EvaIcons.calendar, ),
changeIndex: _changeIndex, if (widget.index == 0 && projectViewModel.havePrivilege(34))
index: widget.index, BottomNavigationItem(
currentIndex: 4, icon: EvaIcons.calendar,
name: TranslationBase.of(context).todoList, activeIcon: EvaIcons.calendar,
) changeIndex: _changeIndex,
], index: widget.index,
), currentIndex: 4,
name: TranslationBase.of(context).todoList,
),
if (projectViewModel.havePrivilege(77))
BottomNavigationItem(
icon: DQIcons.roboticon,
activeIcon: DQIcons.roboticon,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 0,
name: TranslationBase.of(context).help,
)
],
)),
), ),
); );
} }

@ -106,8 +106,6 @@ class PharmacyAppScaffold extends StatelessWidget {
buildBodyWidget() { buildBodyWidget() {
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]); // return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
return Stack(children: <Widget>[ return Stack(children: <Widget>[body, FloatingSearchButton()]);
body, /*FloatingSearchButton()*/
]);
} }
} }

@ -8,11 +8,14 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/widgets/typewriter/typewiter.dart';
import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -24,6 +27,8 @@ import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart'; import 'arrow_back.dart';
import 'network_base_view.dart'; import 'network_base_view.dart';
import 'not_auh_page.dart'; import 'not_auh_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
class AppScaffold extends StatelessWidget { class AppScaffold extends StatelessWidget {
final String appBarTitle; final String appBarTitle;
@ -44,7 +49,8 @@ class AppScaffold extends StatelessWidget {
final double preferredSize; final double preferredSize;
final List<Widget> appBarIcons; final List<Widget> appBarIcons;
final List<ImagesInfo> imagesInfo; final List<ImagesInfo> imagesInfo;
final bool isHelp;
bool isAnimation = false;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
@ -66,6 +72,7 @@ class AppScaffold extends StatelessWidget {
this.preferredSize = 0.0, this.preferredSize = 0.0,
this.appBarIcons, this.appBarIcons,
this.infoList, this.infoList,
this.isHelp = false,
this.imagesInfo}); this.imagesInfo});
@override @override
@ -93,16 +100,21 @@ class AppScaffold extends StatelessWidget {
) )
: baseViewModel != null : baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
child: body, child: buildBodyWidget(context),
baseViewModel: baseViewModel, baseViewModel: baseViewModel,
) )
: body, : buildBodyWidget(context),
); );
} }
buildAppLoaderWidget(bool isLoading) { buildAppLoaderWidget(bool isLoading) {
return isLoading ? AppLoaderWidget() : Container(); return isLoading ? AppLoaderWidget() : Container();
} }
buildBodyWidget(context) {
return Stack(
children: <Widget>[body, isHelp == true ? RobotIcon() : Container()]);
}
} }
class AppBarWidget extends StatelessWidget with PreferredSizeWidget { class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
@ -175,3 +187,98 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
@override @override
Size get preferredSize => Size(double.maxFinite, 60); Size get preferredSize => Size(double.maxFinite, 60);
} }
class RobotIcon extends StatefulWidget {
@override
_RobotIcon createState() => _RobotIcon();
}
class _RobotIcon extends State<RobotIcon> {
var event = RobotProvider();
bool isAnimation = false;
@override
void initState() {
event.controller.stream.listen((p) {
if (p['animationEnable'] == 'false') {
//setState(() {
// if (this.mounted) {
this.isAnimation = false;
//}
// });
}
});
setState(() {
setAnimation();
});
super.initState();
}
@override
Widget build(BuildContext context) {
return Positioned(
child: Column(
children: [
isAnimation
? Container(
height: 150,
width: 200,
padding: EdgeInsets.all(5),
margin: EdgeInsets.only(right: 35.0, bottom: 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
boxShadow: [
BoxShadow(color: Colors.black, spreadRadius: 1),
],
),
child: TyperAnimatedTextKit(
text: Provider.of<ProjectViewModel>(context,
listen: false)
.isArabic ==
true
? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
: "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.",
textLength: Provider.of<ProjectViewModel>(context,
listen: false)
.isArabic ==
true
? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
.length
: "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file."
.length))
: Container(),
Stack(
children: [
isAnimation
? Positioned(
top: 0,
right: 40,
child: Container(
height: 0,
width: 0,
decoration: ShapeDecoration(
color: Colors.grey,
shape: MessageBorder(reverse: true),
)))
: Container(),
FloatingSearchButton()
],
)
],
),
right: -30,
bottom: 50);
}
setAnimation() async {
//await sharedPref.getBool(IS_ROBOT_VISIBLE) ||
var animation =
await sharedPref.getBool(IS_ROBOT_INIT) == null ? true : false;
setState(() {
this.isAnimation = animation;
});
}
}

@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:collection'; import 'dart:collection';
import 'dart:io'; import 'dart:io';
import 'dart:math'; import 'dart:math';
@ -48,6 +49,7 @@ import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -63,8 +65,6 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart';
@ -180,6 +180,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
: 'assets/images/gif/robot-idle.gif'), : 'assets/images/gif/robot-idle.gif'),
), ),
onTap: () { onTap: () {
RoboSearch.isClosed = false;
new RoboSearch(context: context).showAlertDialog(context); new RoboSearch(context: context).showAlertDialog(context);
initSpeechState().then((value) => {startVoiceSearch()}); initSpeechState().then((value) => {startVoiceSearch()});
}, },
@ -709,10 +710,12 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
List<String> arr = []; List<String> arr = [];
List<String> arrDistance = []; List<String> arrDistance = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service service
.getDoctorsList(clinicId, projectId, isNearest, context, .getDoctorsList(clinicId, projectId, isNearest, context,
doctorId: doctorId, doctorName: doctorName) doctorId: doctorId, doctorName: doctorName)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null &&
@ -760,9 +763,10 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToDoctorProfile(context, docObject, docProfile, Future navigateToDoctorProfile(context, docObject, docProfile,
@ -892,27 +896,28 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
class RoboSearch { class RoboSearch {
final BuildContext context; final BuildContext context;
var event = RobotProvider(); var event = RobotProvider();
var searchText = null; var searchText;
static StreamSubscription<dynamic> streamSubscription;
static var isClosed = false;
RoboSearch({ RoboSearch({
@required this.context, @required this.context,
}); });
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
// set up the buttons
// set up the AlertDialog
AlertDialog alert = AlertDialog( AlertDialog alert = AlertDialog(
content: StatefulBuilder( content: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) { builder: (BuildContext context, StateSetter setState) {
setState(() { streamSubscription = event.controller.stream.listen((p) {
event.controller.stream.listen((p) { if (p['searchText'] != 'null' &&
if (p['searchText'] != null) { p['searchText'] != null &&
setState(() { p['searchText'] != "" &&
searchText = p['searchText']; isClosed == false) {
}); setState(() {
} searchText = p['searchText'];
}); });
}
}); });
print(streamSubscription);
return Container( return Container(
color: Colors.white, color: Colors.white,
height: SizeConfig.realScreenHeight * 0.5, height: SizeConfig.realScreenHeight * 0.5,
@ -969,10 +974,12 @@ class RoboSearch {
builder: (BuildContext context) { builder: (BuildContext context) {
return alert; return alert;
}, },
); ).then((value) => {});
} }
static closeAlertDialog(BuildContext context) { static closeAlertDialog(BuildContext context) {
isClosed = true;
streamSubscription.cancel();
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} }

Loading…
Cancel
Save