|
|
|
|
@ -1,4 +1,9 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/master_key_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/Text.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
|
|
|
|
@ -7,15 +12,16 @@ 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/divider_with_spaces_around.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
|
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
|
|
|
|
|
class ObjectivePage extends StatefulWidget {
|
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
|
final List<MasterKeyModel> myExaminationList;
|
|
|
|
|
|
|
|
|
|
ObjectivePage({Key key, this.changePageViewIndex});
|
|
|
|
|
ObjectivePage({Key key, this.changePageViewIndex, this.myExaminationList});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_ObjectivePageState createState() => _ObjectivePageState();
|
|
|
|
|
@ -117,115 +123,136 @@ class _ObjectivePageState extends State<ObjectivePage> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 15, right: 15, top: 15),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts('Abdomen'.toUpperCase(),
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: widget.myExaminationList.map((examination) {
|
|
|
|
|
return Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 15, right: 15, top: 15),
|
|
|
|
|
child: Column(children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
decoration: containerBorderDecoration(
|
|
|
|
|
Colors.white,Colors.grey
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
"Normal",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color:
|
|
|
|
|
Colors.black, //Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
Texts(examination.nameEn.toUpperCase(),
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height:
|
|
|
|
|
screenSize.height *
|
|
|
|
|
0.070,
|
|
|
|
|
decoration:
|
|
|
|
|
containerBorderDecoration(
|
|
|
|
|
Colors.white,
|
|
|
|
|
Colors.grey),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets
|
|
|
|
|
.all(8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
"Normal",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color:
|
|
|
|
|
Colors.black,
|
|
|
|
|
//Colors.black,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {}),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 12,
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
SizedBox(width: 12,),
|
|
|
|
|
InkWell(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
decoration: containerBorderDecoration(
|
|
|
|
|
Color(0xFF515A5D), Colors.black
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
"Abnormal",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color:
|
|
|
|
|
Colors.white, //Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
InkWell(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height:
|
|
|
|
|
screenSize.height *
|
|
|
|
|
0.070,
|
|
|
|
|
decoration:
|
|
|
|
|
containerBorderDecoration(
|
|
|
|
|
Color(0xFF515A5D),
|
|
|
|
|
Colors.black),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets
|
|
|
|
|
.all(8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
"Abnormal",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color:
|
|
|
|
|
Colors.white,
|
|
|
|
|
//Colors.black,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
|
|
|
|
|
child: Icon(
|
|
|
|
|
FontAwesomeIcons.trash,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
size: 20,
|
|
|
|
|
),
|
|
|
|
|
onTap: ()=>removeExamination(examination),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
FontAwesomeIcons.trash,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
size: 20,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: "Remarks",
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
maxLines: 25,
|
|
|
|
|
minLines: 13,
|
|
|
|
|
controller: remarksController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null)
|
|
|
|
|
return TranslationBase.of(context).emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 10, right: 10, top: 15),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: "Remarks",
|
|
|
|
|
fontSize: 13.5,
|
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
maxLines: 25,
|
|
|
|
|
minLines: 13,
|
|
|
|
|
controller: remarksController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
]));
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
@ -249,10 +276,23 @@ class _ObjectivePageState extends State<ObjectivePage> {
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
removeExamination(MasterKeyModel masterKey) {
|
|
|
|
|
Iterable<MasterKeyModel> history = widget.myExaminationList.where(
|
|
|
|
|
(element) =>
|
|
|
|
|
masterKey.id == element.id && masterKey.typeId == element.typeId);
|
|
|
|
|
|
|
|
|
|
if (history.length > 0)
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.myExaminationList.remove(history.first);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openExaminationList(BuildContext context) {
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown) {
|
|
|
|
|
final screenSize = MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size;
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(String hintText,
|
|
|
|
|
String selectedText, bool isDropDown) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
@ -275,228 +315,174 @@ class _ObjectivePageState extends State<ObjectivePage> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return FractionallySizedBox(
|
|
|
|
|
heightFactor: 0.7,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.9,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"Examinations",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.5,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 15),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: ListView(
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
return AddExaminationDailog(
|
|
|
|
|
myExaminationList: widget.myExaminationList,
|
|
|
|
|
addSelectedExamination: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
removeExamination: (masterKey) => removeExamination(masterKey),);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class AddExaminationDailog extends StatefulWidget {
|
|
|
|
|
final List<MasterKeyModel> myExaminationList;
|
|
|
|
|
final Function addSelectedExamination;
|
|
|
|
|
final Function (MasterKeyModel) removeExamination;
|
|
|
|
|
|
|
|
|
|
const AddExaminationDailog(
|
|
|
|
|
{Key key, this.myExaminationList, this.addSelectedExamination, this.removeExamination})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_AddExaminationDailogState createState() => _AddExaminationDailogState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _AddExaminationDailogState extends State<AddExaminationDailog> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return FractionallySizedBox(
|
|
|
|
|
heightFactor: 0.7,
|
|
|
|
|
child: BaseView<SOAPViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
if (model.physicalExaminationList.length == 0) {
|
|
|
|
|
await model.getMasterLookup(
|
|
|
|
|
MasterKeysService.PhysicalExamination);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) =>
|
|
|
|
|
AppScaffold(
|
|
|
|
|
// baseViewModel: model,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.9,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: true,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts('Examinations',
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: true,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts('Examinations',
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: true,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts('Examinations',
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: true,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts('Examinations',
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: true,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts('Examinations',
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
AppText(
|
|
|
|
|
"Examinations",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: true,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts('Examinations',
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: true,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts('Examinations',
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: Container(
|
|
|
|
|
height:
|
|
|
|
|
MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height * 0.5,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 15),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius
|
|
|
|
|
.circular(12),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: ListView(
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: model
|
|
|
|
|
.physicalExaminationList
|
|
|
|
|
.map((examinationInfo) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: isServiceSelected(
|
|
|
|
|
examinationInfo),
|
|
|
|
|
activeColor:
|
|
|
|
|
Colors.red[800],
|
|
|
|
|
onChanged:
|
|
|
|
|
(
|
|
|
|
|
bool newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (isServiceSelected(
|
|
|
|
|
examinationInfo
|
|
|
|
|
)) {
|
|
|
|
|
widget
|
|
|
|
|
.removeExamination(
|
|
|
|
|
examinationInfo
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
widget
|
|
|
|
|
.myExaminationList
|
|
|
|
|
.add(
|
|
|
|
|
examinationInfo);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets
|
|
|
|
|
.symmetric(
|
|
|
|
|
horizontal: 10,
|
|
|
|
|
vertical: 0),
|
|
|
|
|
child: Texts(
|
|
|
|
|
examinationInfo
|
|
|
|
|
.nameEn,
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color:
|
|
|
|
|
Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Checkbox(
|
|
|
|
|
value: true,
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 10, vertical: 0),
|
|
|
|
|
child: Texts('Examinations',
|
|
|
|
|
variant: "bodyText",
|
|
|
|
|
bold: true,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
AppButton(
|
|
|
|
|
title: "Add SELECTED Examinations".toUpperCase(),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
)),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
if (model.state == ViewState.Idle)
|
|
|
|
|
AppButton(
|
|
|
|
|
title: "Add SELECTED Examinations"
|
|
|
|
|
.toUpperCase(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
widget.addSelectedExamination();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
))),
|
|
|
|
|
)),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isServiceSelected(MasterKeyModel masterKey) {
|
|
|
|
|
Iterable<MasterKeyModel> history =
|
|
|
|
|
widget
|
|
|
|
|
.myExaminationList
|
|
|
|
|
.where((element) =>
|
|
|
|
|
masterKey.id == element.id && masterKey.typeId == element.typeId);
|
|
|
|
|
if (history.length > 0) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|