add patient lookup

merge-requests/1/merge
Elham Rababah 6 years ago
parent 046ef17b21
commit 79055145c6

@ -0,0 +1,15 @@
const PATIENT_TYPE = const [
{"text": "outPatiant", "val": "1"},
{"text": "Tomorrow Patient", "val": "2"},
{"text": "Referral", "val": "3"},
{"text": "Discharge", "val": "4"},
{"text": "InPatiant", "val": "5"},
{"text": "Referral Discharge", "val": "6"},
];
const LOCATIONS = const[
{"text": "In Sudia Arabia", "val": "1"},
{"text": "Out Sudia Arabia", "val": "2"},
];

@ -28,6 +28,27 @@ class HomeScreen extends StatelessWidget {
title: 'Patient Search',
image: 'assets/images/user_id_icon.png',
),
Category(
id: 'c1',
title: 'My Schedule',
image: 'assets/images/user_id_icon.png',
),
Category(
id: 'c2',
title: 'Patient Search',
image: 'assets/images/user_id_icon.png',
),
Category(
id: 'c1',
title: 'My Schedule',
image: 'assets/images/user_id_icon.png',
),
Category(
id: 'c2',
title: 'Patient Search',
image: 'assets/images/user_id_icon.png',
),
];
return Scaffold(
appBar: AppBar(

@ -4,26 +4,22 @@ import '../../models/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../lookups/patient_lookup.dart';
// const PATIENT_TYPE = [
// {"text": "outPatiant", "val": "1"},
// {"text": "Tomorrow Patient", "val": "2"},
// {"text": "Referral", "val": "3"},
// {"text": "Discharge", "val": "4"},
// {"text": "InPatiant", "val": "5"},
// {"text": "Referral Discharge", "val": "6"},
// ];
class PatientSearch extends StatefulWidget {
@override
_PatientSearchState createState() => _PatientSearchState();
}
class _PatientSearchState extends State<PatientSearch> {
final List<Map<String, String>> _patientType = [
{"text": "outPatiant", "val": "1"},
{"text": "Tomorrow Patient", "val": "2"},
{"text": "Referral", "val": "3"},
{"text": "Discharge", "val": "4"},
{"text": "InPatiant", "val": "5"},
{"text": "Referral Discharge", "val": "6"},
];
final List<Map<String, String>> _locations = [
{"text": "In Sudia Arabia", "val": "1"},
{"text": "Out Sudia Arabia", "val": "2"},
];
String _selectedType = '1';
String _selectedLocation = '1';
TextEditingController _toDateController = new TextEditingController();
@ -59,7 +55,10 @@ class _PatientSearchState extends State<PatientSearch> {
print(_patientSearchFormValues.From);
print(_patientSearchFormValues.To);
Navigator.of(context).pushNamed(PATIENTS, arguments: {'patientSearchForm':_patientSearchFormValues,'selectedType':_selectedType});
Navigator.of(context).pushNamed(PATIENTS, arguments: {
'patientSearchForm': _patientSearchFormValues,
'selectedType': _selectedType
});
}
@override
@ -99,7 +98,7 @@ class _PatientSearchState extends State<PatientSearch> {
iconSize: 24,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return _patientType.map((item) {
return PATIENT_TYPE.map((item) {
return Text(item['text'], textAlign: TextAlign.end);
}).toList();
},
@ -108,7 +107,7 @@ class _PatientSearchState extends State<PatientSearch> {
_selectedType = newValue;
})
},
items: _patientType.map((item) {
items: PATIENT_TYPE.map((item) {
return DropdownMenuItem(
child: Text(
'${item['text']}',
@ -496,7 +495,7 @@ class _PatientSearchState extends State<PatientSearch> {
iconSize: 24,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return _locations.map((item) {
return LOCATIONS.map((item) {
return Text(item['text']);
}).toList();
},
@ -505,7 +504,7 @@ class _PatientSearchState extends State<PatientSearch> {
_selectedLocation = newValue;
})
},
items: _locations.map((item) {
items: LOCATIONS.map((item) {
return DropdownMenuItem(
child: Text('${item['text']}'),
value: item['val'],

@ -9,30 +9,35 @@ class HomeItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () => selectItem(context,id),
onTap: () => selectItem(context, id),
splashColor: Colors.red,
child: Container(
child: Column(
children: <Widget>[
Container(
child: CircleAvatar(
backgroundColor: Colors.white,
child: Image.asset(
image,
color: Theme.of(context).primaryColor,
child: CircleAvatar(
backgroundColor: Colors.white,
child: Container(
child: Image.asset(
image,
color: Theme.of(context).primaryColor,
),
),
)),
Text(title,style: TextStyle(fontSize: 20),)
Text(
title,
style: TextStyle(fontSize: 16),
)
],
),
),
);
}
void selectItem(BuildContext ctx, id ) {
void selectItem(BuildContext ctx, id) {
String route;
if (id =='c2') {
if (id == 'c2') {
route = PATIENT_SEARCH;
}
Navigator.of(ctx).pushNamed(route, arguments: {

Loading…
Cancel
Save