Merge branch 'sultan' into 'development'

Sultan

See merge request Cloud_Solution/doctor_app_flutter!564
merge-requests/563/merge
Mohammad Aljammal 5 years ago
commit c4aaea0f78

@ -20,6 +20,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
@ -57,6 +58,12 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
}); });
} }
@override
void initState() {
requestPermissions();
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (widget.note != null) { if (widget.note != null) {
@ -225,6 +232,12 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
} }
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
}
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord}); event.setValue({"searchText": reconizedWord});

@ -114,131 +114,140 @@ class AddSickLeavScreen extends StatelessWidget {
children: model.getAllSIckLeave children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) { .map<Widget>((GetAllSickLeaveResponse item) {
return RoundedContainer( return RoundedContainer(
margin: EdgeInsets.all(10),
child: Column( child: Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
left: BorderSide( left: BorderSide(
color: item.status == 1 color: item.status == 1
? Colors.yellow[800] ? Colors.yellow[800]
: item.status == 2 : item.status == 2
? Colors.green ? Colors.green
: Colors.black, : Colors.black,
width: 5.0, width: 5.0,
))), ))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
children: <Widget>[ MainAxisAlignment.start,
Expanded( children: <Widget>[
flex: 4, Expanded(
child: Wrap( flex: 4,
// mainAxisAlignment: child: Wrap(
// MainAxisAlignment.start, // mainAxisAlignment:
children: <Widget>[ // MainAxisAlignment.start,
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Column(
padding: EdgeInsets.all(3), crossAxisAlignment:
child: AppText( CrossAxisAlignment.start,
item.status == 1 children: <Widget>[
? TranslationBase.of( Container(
context) padding: EdgeInsets.all(3),
.hold child: AppText(
: item.status == 2 item.status == 1
? TranslationBase.of( ? TranslationBase.of(
context) context)
.active .hold
: TranslationBase.of( : item.status == 2
? TranslationBase
.of(
context)
.active
: TranslationBase
.of(context)
.all,
fontWeight:
FontWeight.bold,
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
),
),
Row(
children: [
AppText(
TranslationBase.of(
context) context)
.all, .daysSickleave),
fontWeight: FontWeight.bold, AppText(
color: item.status == 1 item.noOfDays
? Colors.yellow[800] .toString(),
: item.status == 2 fontWeight:
? Colors.green FontWeight.bold,
: Colors.black, ),
), ],
),
Row(
children: [
AppText(TranslationBase.of(
context)
.daysSickleave),
AppText(
item.noOfDays.toString(),
fontWeight: FontWeight.bold,
), ),
], Row(
), children: [
Row( AppText(
children: [ TranslationBase.of(
AppText( context)
TranslationBase.of(context) .startDate +
.startDate + ' ',
' ', ),
Flexible(
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight:
FontWeight.bold,
))
],
), ),
Flexible( Row(
child: AppText( mainAxisAlignment:
DateUtils MainAxisAlignment
.convertStringToDateFormat( .spaceBetween,
item.startDate, children: [
'dd-MMM-yyyy'), AppText(
fontWeight: FontWeight.bold, item.remarks ?? "",
)) ),
// (item.status == 1 ||
// item.status == 2)
// ? IconButton(
// icon: Image.asset(
// 'assets/images/edit.png'),
//
// // color: Colors.green, //Colors.black,
// onPressed: () => {
// if (item.status ==
// 1)
// {
// DrAppToastMsg.showErrorToast(
// TranslationBase.of(
// context)
// .sickleaveonhold)
// }
// else
// {
// openSickLeave(
// context,
// true,
// extendedData:
// item)
// }
// },
// )
// : SizedBox()
]),
], ],
), ),
Row( SizedBox(
mainAxisAlignment: width: 20,
MainAxisAlignment ),
.spaceBetween,
children: [
AppText(
item.remarks ?? "",
),
// (item.status == 1 ||
// item.status == 2)
// ? IconButton(
// icon: Image.asset(
// 'assets/images/edit.png'),
//
// // color: Colors.green, //Colors.black,
// onPressed: () => {
// if (item.status ==
// 1)
// {
// DrAppToastMsg.showErrorToast(
// TranslationBase.of(
// context)
// .sickleaveonhold)
// }
// else
// {
// openSickLeave(
// context,
// true,
// extendedData:
// item)
// }
// },
// )
// : SizedBox()
]),
], ],
), ),
SizedBox( ),
width: 20, ],
), )),
], ],
), ));
),
],
)),
],
));
}).toList(), }).toList(),
) )
: patient.patientStatusType != 43 : patient.patientStatusType != 43

@ -43,130 +43,139 @@ class ShowSickLeaveScreen extends StatelessWidget {
children: model.getAllSIckLeave children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) { .map<Widget>((GetAllSickLeaveResponse item) {
return RoundedContainer( return RoundedContainer(
margin: EdgeInsets.all(10),
child: Column( child: Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
left: BorderSide( left: BorderSide(
color: item.status == 1 color: item.status == 1
? Colors.yellow[800] ? Colors.yellow[800]
: item.status == 2 : item.status == 2
? Colors.green ? Colors.green
: Colors.black, : Colors.black,
width: 5.0, width: 5.0,
))), ))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
children: <Widget>[ MainAxisAlignment.start,
Expanded( children: <Widget>[
flex: 4, Expanded(
child: Wrap( flex: 4,
// mainAxisAlignment: child: Wrap(
// MainAxisAlignment.start, // mainAxisAlignment:
children: <Widget>[ // MainAxisAlignment.start,
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Column(
padding: EdgeInsets.all(3), crossAxisAlignment:
child: AppText( CrossAxisAlignment.start,
item.status == 1 children: <Widget>[
? TranslationBase.of( Container(
context) padding: EdgeInsets.all(3),
.hold child: AppText(
: item.status == 2 item.status == 1
? TranslationBase.of( ? TranslationBase.of(
context) context)
.active .hold
: TranslationBase.of( : item.status == 2
? TranslationBase
.of(
context)
.active
: TranslationBase
.of(context)
.all,
fontWeight:
FontWeight.bold,
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
),
),
Row(
children: [
AppText(
TranslationBase.of(
context) context)
.all, .daysSickleave),
fontWeight: FontWeight.bold, AppText(
color: item.status == 1 item.noOfDays
? Colors.yellow[800] .toString(),
: item.status == 2 fontWeight:
? Colors.green FontWeight.bold,
: Colors.black, ),
), ],
),
Row(
children: [
AppText(TranslationBase.of(
context)
.daysSickleave),
AppText(
item.noOfDays.toString(),
fontWeight: FontWeight.bold,
), ),
], Row(
), children: [
Row( AppText(
children: [ TranslationBase.of(
AppText( context)
TranslationBase.of(context) .startDate +
.startDate + ' ',
' ', ),
Flexible(
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight:
FontWeight.bold,
))
],
), ),
Flexible( Row(
child: AppText( mainAxisAlignment:
DateUtils MainAxisAlignment
.convertStringToDateFormat( .spaceBetween,
item.startDate, children: [
'dd-MMM-yyyy'), AppText(
fontWeight: FontWeight.bold, item.remarks ?? "",
)) ),
(item.status == 1)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () =>
{
if (item.status ==
1)
{
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.sickleaveonhold)
}
// else
// {
// openSickLeave(
// context,
// true,
// extendedData:
// item)
// }
},
)
: SizedBox()
]),
], ],
), ),
Row( SizedBox(
mainAxisAlignment: width: 20,
MainAxisAlignment ),
.spaceBetween,
children: [
AppText(
item.remarks ?? "",
),
(item.status == 1)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {
if (item.status ==
1)
{
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.sickleaveonhold)
}
// else
// {
// openSickLeave(
// context,
// true,
// extendedData:
// item)
// }
},
)
: SizedBox()
]),
], ],
), ),
SizedBox( ),
width: 20, ],
), )),
], ],
), ));
),
],
)),
],
));
}).toList(), }).toList(),
) )
: Center( : Center(

@ -267,19 +267,19 @@ class PatientCard extends StatelessWidget {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15)), fontSize: 15)),
]))), ]))),
if (isInpatient == true)
Row( Row(
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).numOfDays}: ", "${TranslationBase.of(context).numOfDays}: ",
fontSize: 15,
),
AppText(
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w700), ),
], AppText(
), "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
],
),
// Container( // Container(
// child: Row( // child: Row(
// crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,

Loading…
Cancel
Save