diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart new file mode 100644 index 00000000..d13aeb1f --- /dev/null +++ b/lib/lookups/patient_lookup.dart @@ -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"}, + ]; \ No newline at end of file diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index d82cfcaf..351fc2fd 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -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( diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 72650e96..1dc40c2e 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -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 { - final List> _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> _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 { 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 { 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 { _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 { 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 { _selectedLocation = newValue; }) }, - items: _locations.map((item) { + items: LOCATIONS.map((item) { return DropdownMenuItem( child: Text('${item['text']}'), value: item['val'], diff --git a/lib/widgets/home/home_item.dart b/lib/widgets/home/home_item.dart index 8223f733..0cc39faf 100644 --- a/lib/widgets/home/home_item.dart +++ b/lib/widgets/home/home_item.dart @@ -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: [ 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: {