Fix issues on the add procedure

merge-requests/687/head
Mohammad Aljammal 5 years ago
parent ef175ea224
commit 5d5f9f6928

@ -7,7 +7,7 @@ class DoctorProfileModel {
Null clinicDescriptionN; Null clinicDescriptionN;
Null licenseExpiry; Null licenseExpiry;
int employmentType; int employmentType;
Null setupID; dynamic setupID;
int projectID; int projectID;
String projectName; String projectName;
String nationalityID; String nationalityID;

@ -76,7 +76,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
}); });
}, },
onCallNotRespond: (SessionStatusModel sessionStatusModel) { onCallNotRespond: (SessionStatusModel sessionStatusModel) {
//TODO handling onCalcallNotRespondlEnd //TODO handling onCalNotRespondEnd
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
changeRoute(context); changeRoute(context);
}); });

@ -13,13 +13,11 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.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 'entity_list_checkbox_search_widget.dart'; import 'entity_list_checkbox_search_widget.dart';
import 'entity_list_procedure_widget.dart';
valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, valdateProcedure(ProcedureViewModel model, PatiantInformtion patient,
List<EntityList> entityList) async { List<EntityList> entityList) async {
@ -139,9 +137,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
//onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
@ -218,21 +214,23 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width *
0.02, 0.02,
), ),
InkWell( Expanded(
onTap: () { child: InkWell(
if (procedureName.text.isNotEmpty && onTap: () {
procedureName.text.length >= 3) if (procedureName.text.isNotEmpty &&
model.getProcedureCategory( procedureName.text.length >= 3)
categoryName: procedureName.text); model.getProcedureCategory(
else categoryName: procedureName.text);
DrAppToastMsg.showErrorToast( else
TranslationBase.of(context) DrAppToastMsg.showErrorToast(
.atLeastThreeCharacters, TranslationBase.of(context)
); .atLeastThreeCharacters,
}, );
child: Icon( },
Icons.search, child: Icon(
size: 25.0, Icons.search,
size: 25.0,
),
), ),
), ),
], ],
@ -429,8 +427,6 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
color: Color(0xff359846), color: Color(0xff359846),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () { onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) { if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context)

@ -10,7 +10,6 @@ import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -37,164 +36,159 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
AppScaffold( AppScaffold(
backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), backgroundColor: Color(0xffF8F8F8).withOpacity(0.9),
isShowAppBar: false, isShowAppBar: false,
body: Column( body: SingleChildScrollView(
children: [ child: Column(
Container( children: [
height: MediaQuery.of(context).size.height * 0.070, Container(
color: Colors.white, height: MediaQuery.of(context).size.height * 0.070,
), color: Colors.white,
Container( ),
color: Colors.white, Container(
child: Padding( color: Colors.white,
padding: EdgeInsets.all(12.0), child: Padding(
child: Row( padding: EdgeInsets.all(12.0),
//mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: [ //mainAxisAlignment: MainAxisAlignment.spaceBetween,
InkWell( children: [
child: Icon( InkWell(
Icons.arrow_back_ios_sharp, child: Icon(
size: 24.0, Icons.arrow_back_ios_sharp,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
), ),
onTap: () { SizedBox(
Navigator.pop(context); width: 5.0,
}, ),
), AppText(
SizedBox( 'Add Procedure',
width: 5.0, fontWeight: FontWeight.w700,
), fontSize: 20,
AppText( ),
'Add Procedure', ],
fontWeight: FontWeight.w700, ),
fontSize: 20,
),
],
), ),
), ),
), SizedBox(height: 30,),
Padding( ...List.generate(widget.items.length, (index) => Container(
padding: const EdgeInsets.only( margin: EdgeInsets.only(bottom: 15.0),
left: 12.0, right: 12.0, bottom: 26.0, top: 10), decoration: BoxDecoration(
child: ListView.builder( color: Colors.white,
scrollDirection: Axis.vertical, borderRadius:
physics: AlwaysScrollableScrollPhysics(), BorderRadius.all(Radius.circular(10.0))),
shrinkWrap: true, child: ExpansionTile(
itemCount: widget.items.length, initiallyExpanded: true,
itemBuilder: (BuildContext context, int index) { title: Row(
return Container( children: [
margin: EdgeInsets.only(bottom: 15.0), Icon(
decoration: BoxDecoration( Icons.check_box,
color: Colors.white, color: Color(0xffD02127),
borderRadius: size: 30.5,
BorderRadius.all(Radius.circular(10.0))), ),
child: ExpansionTile( SizedBox(
initiallyExpanded: true, width: 6.0,
title: Row( ),
Expanded(
child:
AppText(widget.items[index].procedureName)),
],
),
children: [
Container(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Icon( Row(
Icons.check_box, children: [
color: Color(0xffD02127), Padding(
size: 30.5, padding: const EdgeInsets.symmetric(
horizontal: 11),
child: AppText(
TranslationBase.of(context).orderType,
fontWeight: FontWeight.w700,
color: Color(0xff2B353E),
),
),
],
), ),
SizedBox( Row(
width: 6.0, children: [
Radio(
activeColor: Color(0xFFD02127),
value: 0,
groupValue:
widget.items[index].selectedType,
onChanged: (value) {
widget.items[index].selectedType = 0;
setState(() {
widget.items[index].type =
value.toString();
});
},
),
AppText(
'routine',
color: Color(0xff575757),
fontWeight: FontWeight.w600,
),
Radio(
activeColor: Color(0xFFD02127),
groupValue:
widget.items[index].selectedType,
value: 1,
onChanged: (value) {
widget.items[index].selectedType = 1;
setState(() {
widget.items[index].type =
value.toString();
});
},
),
AppText(
TranslationBase.of(context).urgent,
color: Color(0xff575757),
fontWeight: FontWeight.w600,
),
],
), ),
Expanded(
child:
AppText(widget.items[index].procedureName)),
], ],
), ),
children: [
Container(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 11),
child: AppText(
TranslationBase.of(context).orderType,
fontWeight: FontWeight.w700,
color: Color(0xff2B353E),
),
),
],
),
Row(
children: [
Radio(
activeColor: Color(0xFFD02127),
value: 0,
groupValue:
widget.items[index].selectedType,
onChanged: (value) {
widget.items[index].selectedType = 0;
setState(() {
widget.items[index].type =
value.toString();
});
},
),
AppText(
'routine',
color: Color(0xff575757),
fontWeight: FontWeight.w600,
),
Radio(
activeColor: Color(0xFFD02127),
groupValue:
widget.items[index].selectedType,
value: 1,
onChanged: (value) {
widget.items[index].selectedType = 1;
setState(() {
widget.items[index].type =
value.toString();
});
},
),
AppText(
TranslationBase.of(context).urgent,
color: Color(0xff575757),
fontWeight: FontWeight.w600,
),
],
),
],
),
),
),
SizedBox(
height: 2.0,
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 12, vertical: 15.0),
child: TextFields(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
onChanged: (value) {
widget.items[index].remarks = value;
},
minLines: 3,
maxLines: 5,
borderWidth: 0.5,
borderColor: Colors.grey[500],
),
),
SizedBox(
height: 19.0,
),
//DividerWithSpacesAround(),
],
), ),
); ),
}), SizedBox(
), height: 2.0,
], ),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 12, vertical: 15.0),
child: TextFields(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
onChanged: (value) {
widget.items[index].remarks = value;
},
minLines: 3,
maxLines: 5,
borderWidth: 0.5,
borderColor: Colors.grey[500],
),
),
SizedBox(
height: 19.0,
),
//DividerWithSpacesAround(),
],
),
)),
SizedBox(height: 90,),
],
),
), ),
bottomSheet: Container( bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
@ -206,15 +200,6 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
color: Color(0xff359846), color: Color(0xff359846),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () async { onPressed: () async {
//print(entityList.toString());
onPressed:
// if (entityList.isEmpty == true) {
// DrAppToastMsg.showErrorToast(
// TranslationBase.of(context)
// .fillTheMandatoryProcedureDetails,
// );
// return;
// }
List<EntityList> entityList = List(); List<EntityList> entityList = List();
widget.items.forEach((element) { widget.items.forEach((element) {
entityList.add( entityList.add(

Loading…
Cancel
Save