Merge branch 'development' into medical-profile-services
commit
70d171a599
@ -0,0 +1,189 @@
|
||||
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart';
|
||||
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_request_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ExpansionProcedure extends StatefulWidget {
|
||||
final ProcedureTempleteModel procedureTempleteModel;
|
||||
final ProcedureViewModel model;
|
||||
final Function(ProcedureTempleteDetailsModel) removeFavProcedure;
|
||||
final Function(ProcedureTempleteDetailsModel) addFavProcedure;
|
||||
final Function(ProcedureTempleteDetailsModel) addProceduresRemarks;
|
||||
|
||||
final bool Function(ProcedureTempleteModel) isEntityListSelected;
|
||||
final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected;
|
||||
|
||||
const ExpansionProcedure(
|
||||
{Key key,
|
||||
this.procedureTempleteModel,
|
||||
this.model,
|
||||
this.removeFavProcedure,
|
||||
this.addFavProcedure,
|
||||
this.addProceduresRemarks,
|
||||
this.isEntityListSelected,
|
||||
this.isEntityFavListSelected})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_ExpansionProcedureState createState() => _ExpansionProcedureState();
|
||||
}
|
||||
|
||||
class _ExpansionProcedureState extends State<ExpansionProcedure> {
|
||||
bool _isShowMore = false;
|
||||
List<ProcedureTempleteDetailsModel> _templateDetailsList = List();
|
||||
BaseAppClient baseAppClient = BaseAppClient();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
if (!_isShowMore && _templateDetailsList.isEmpty) {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
await getProcedureTemplateDetails(widget.procedureTempleteModel.templateID);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
}
|
||||
setState(() {
|
||||
_isShowMore = !_isShowMore;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10.0),
|
||||
margin: EdgeInsets.only(left: 5, right: 5),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5.0),
|
||||
)),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.folder,
|
||||
size: 20,
|
||||
color: Color(0xff575757),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 0),
|
||||
child: AppText(
|
||||
"Procedures for " +
|
||||
widget.procedureTempleteModel.templateName,
|
||||
fontSize: 16.0,
|
||||
variant: "bodyText",
|
||||
bold: true,
|
||||
color: Color(0xff575757)),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
Container(
|
||||
width: 25,
|
||||
height: 25,
|
||||
child: Icon(
|
||||
_isShowMore
|
||||
? Icons.keyboard_arrow_up
|
||||
: Icons.keyboard_arrow_down,
|
||||
color: Colors.grey[800],
|
||||
size: 22,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (_isShowMore)
|
||||
AnimatedContainer(
|
||||
padding: EdgeInsets.all(10.0),
|
||||
margin: EdgeInsets.only(left: 5, right: 5),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(5.0),
|
||||
bottomRight: Radius.circular(5.0),
|
||||
)),
|
||||
duration: Duration(milliseconds: 7000),
|
||||
child: Column(
|
||||
children:
|
||||
_templateDetailsList.map((itemProcedure) {
|
||||
return Container(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 11),
|
||||
child: Checkbox(
|
||||
value: widget
|
||||
.isEntityFavListSelected(itemProcedure),
|
||||
activeColor: Color(0xffD02127),
|
||||
onChanged: (bool newValue) {
|
||||
setState(() {
|
||||
if (widget.isEntityFavListSelected(itemProcedure)) {
|
||||
widget.removeFavProcedure(itemProcedure);
|
||||
} else {
|
||||
widget.addFavProcedure(itemProcedure);
|
||||
}
|
||||
});
|
||||
}),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 0),
|
||||
child: AppText(itemProcedure.procedureName,
|
||||
fontSize: 14.0,
|
||||
variant: "bodyText",
|
||||
bold: true,
|
||||
color: Color(0xff575757)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
getProcedureTemplateDetails(templateId)async {
|
||||
ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0);
|
||||
_templateDetailsList.clear();
|
||||
await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
response['HIS_ProcedureTemplateDetailsList'].forEach((template) {
|
||||
setState(() {
|
||||
_templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template));
|
||||
});
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
DrAppToastMsg.showErrorToast(error);
|
||||
|
||||
}, body: _procedureTempleteDetailsRequestModel.toJson());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,227 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
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_texts_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/material.dart';
|
||||
|
||||
class ProcedureCheckOutScreen extends StatefulWidget {
|
||||
@override
|
||||
_ProcedureCheckOutScreenState createState() =>
|
||||
_ProcedureCheckOutScreenState();
|
||||
}
|
||||
|
||||
class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
|
||||
List<EntityList> items = List();
|
||||
List<String> remarksList = List();
|
||||
List<int> typeList = List();
|
||||
int selectedType = 0;
|
||||
setSelectedType(int val) {
|
||||
setState(() {
|
||||
selectedType = val;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<ProcedureViewModel>(
|
||||
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
|
||||
AppScaffold(
|
||||
backgroundColor: Color(0xffF8F8F8).withOpacity(0.9),
|
||||
isShowAppBar: false,
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height * 0.070,
|
||||
color: Colors.white,
|
||||
),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Row(
|
||||
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
child: Icon(
|
||||
Icons.arrow_back_ios_sharp,
|
||||
size: 24.0,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5.0,
|
||||
),
|
||||
AppText(
|
||||
'Add Procedure',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.022,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: 1,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(10.0))),
|
||||
child: ExpansionTile(
|
||||
initiallyExpanded: true,
|
||||
title: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check_box,
|
||||
color: Color(0xffD02127),
|
||||
size: 30.5,
|
||||
),
|
||||
SizedBox(
|
||||
width: 6.0,
|
||||
),
|
||||
AppText('Procedure Name'),
|
||||
],
|
||||
),
|
||||
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: selectedType,
|
||||
onChanged: (value) {
|
||||
// historyInfo.type =
|
||||
// setSelectedType(value).toString();
|
||||
//
|
||||
// historyInfo.type = value.toString();
|
||||
},
|
||||
),
|
||||
AppText(
|
||||
'routine',
|
||||
color: Color(0xff575757),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
Radio(
|
||||
activeColor: Color(0xFFD02127),
|
||||
groupValue: selectedType,
|
||||
value: 1,
|
||||
onChanged: (value) {
|
||||
// historyInfo.type =
|
||||
// setSelectedType(value).toString();
|
||||
//
|
||||
// historyInfo.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) {
|
||||
// historyInfo.remarks = value;
|
||||
},
|
||||
minLines: 3,
|
||||
maxLines: 5,
|
||||
borderWidth: 0.5,
|
||||
borderColor: Colors.grey[500],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 19.0,
|
||||
),
|
||||
//DividerWithSpacesAround(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
bottomSheet: Container(
|
||||
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
AppButton(
|
||||
title: TranslationBase.of(context).addSelectedProcedures,
|
||||
color: Color(0xff359846),
|
||||
fontWeight: FontWeight.w700,
|
||||
onPressed: () {
|
||||
//print(entityList.toString());
|
||||
onPressed:
|
||||
// if (entityList.isEmpty == true) {
|
||||
// DrAppToastMsg.showErrorToast(
|
||||
// TranslationBase.of(context)
|
||||
// .fillTheMandatoryProcedureDetails,
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
|
||||
Navigator.pop(context);
|
||||
// postProcedure(
|
||||
// orderType: selectedType.toString(),
|
||||
// entityList: entityList,
|
||||
// patient: patient,
|
||||
// model: widget.model,
|
||||
// remarks: remarksController.text);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue