amjad modified to expand list

merge-requests/72/head
Amjad Amireh 6 years ago
parent bb606e6a1d
commit 9aae4b8650

@ -1,3 +1,5 @@
import './screens/patients/profile/vital_sign/body_measurements_screen.dart';
import './screens/QR_reader_screen.dart';
@ -13,6 +15,7 @@ import './screens/doctor/services_screen.dart';
import './screens/medicine/medicine_search_screen.dart';
import './screens/medicine/pharmacies_list_screen.dart';
import './screens/patients/patient_search_screen.dart';
import './screens/patients/patients_referred_screen.dart';
import './screens/patients/patients_screen.dart';
import './screens/patients/profile/lab_result/lab_orders_screen.dart';
import './screens/patients/profile/patient_profile_screen.dart';
@ -36,6 +39,7 @@ const String QR_READER = 'qr-reader';
const String PATIENT_SEARCH = 'patients/patient-search';
const String PATIENTS = 'patients/patients';
const String PATIENTS_PROFILE = 'patients/patients-profile';
const String PATIENTS_REFERRED = 'patients/patients-referred';
const String BLOOD_BANK = 'blood-bank';
const String DOCTOR_REPLY = 'doctor-reply';
const String MEDICINE_SEARCH = 'medicine/medicine-search';
@ -56,6 +60,7 @@ var routes = {
PROFILE: (_) => ProfileScreen(),
MY_SCHEDULE: (_) => MyScheduleScreen(),
PATIENT_SEARCH: (_) => PatientSearchScreen(),
PATIENTS_REFERRED:(_)=>PatientReferredScreen(),
PATIENTS: (_) => PatientsScreen(),
QR_READER: (_) => QrReaderScreen(),
BLOOD_BANK: (_) => BloodBankScreen(),

@ -58,7 +58,16 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
PatientOutSA: false);
void _validateInputs() async {
if(_selectedType=='2')
{
try {
//====================
//_selectedType=='3'?
//=====================
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile);
@ -93,6 +102,15 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
} catch (err) {
handelCatchErrorCase(err);
}
}
else
{
Navigator.of(context).pushNamed(PATIENTS_REFERRED, arguments: {
"patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType
});
}
}
handelCatchErrorCase(err) {

@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
class PatientReferredScreen extends StatefulWidget {
PatientReferredScreen({Key key}) : super(key: key);
@override
_PatientReferredScreenState createState() => _PatientReferredScreenState();
}
class _PatientReferredScreenState extends State<PatientReferredScreen> {
String patientType;
String patientTypetitle;
@override
Widget build(BuildContext context) {
return Container(
child: Text("Refferrd Patiant"),//child,
);
}
}

@ -374,8 +374,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
.start,
children: [
Image.network(
"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png",
"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png",
height: 100,
width: 100),
],
@ -472,8 +471,9 @@ class _PatientsScreenState extends State<PatientsScreen> {
),
),
SizedBox(
width:60,
),
width:
60,
),
Container(
child:
AppText(

@ -0,0 +1,87 @@
/*
*@author: Amjad Amireh
*@Date:27/5/2020
*@param:
*@return:Create Expand list with snakebar notification
*@desc:
*/
import 'package:flutter/material.dart';
class ListItem extends StatefulWidget{
List<String>listItems;
String headerTitle;
ListItem(this.headerTitle,this.listItems);
@override
State<StatefulWidget>createState()
{
return ListItemState();
}
}
class ListItemState extends State<ListItem>
{
bool isExpand=false;
@override
void initState() {
// TODO: implement initState
super.initState();
isExpand=false;
}
@override
Widget build(BuildContext context) {
List<String>listItem=this.widget.listItems;
return Padding(
padding: (isExpand==true)?const EdgeInsets.all(8.0):const EdgeInsets.all(12.0),
child: Container(
decoration:BoxDecoration(
color: Colors.white,
borderRadius: (isExpand!=true)?BorderRadius.all(Radius.circular(8)):BorderRadius.all(Radius.circular(22)),
border: Border.all(color: Colors.white)
),
child: ExpansionTile(
key: PageStorageKey<String>(this.widget.headerTitle),
title: Container(
width: double.infinity,
child: Text(this.widget.headerTitle,style: TextStyle(fontSize: (isExpand!=true)?18:22),)),
trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,size: 32,color: Colors.black,):Icon(Icons.keyboard_arrow_down,size: 32,color: Colors.black),
onExpansionChanged: (value){
setState(() {
isExpand=value;
});
},
children: [
for(final item in listItem)
Padding(
padding: const EdgeInsets.all(8.0),
child: InkWell(
onTap: (){
Scaffold.of(context).showSnackBar(SnackBar(backgroundColor: Colors.black,duration:Duration(microseconds: 500),content: Text("Selected Item $item "+this.widget.headerTitle )));
},
child: Container(
width: double.infinity,
decoration:BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.all(Radius.circular(4)),
border: Border.all(color: Colors.grey)
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(item,style: TextStyle(color: Colors.white),),
)),
),
)
],
),
),
);
}
}
Loading…
Cancel
Save