merge-requests/47/head
Elham Rababah 6 years ago
commit d09ba4632e

@ -20,14 +20,12 @@ class MyApp extends StatelessWidget {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
return MultiProvider( return MultiProvider(
providers: [ providers: [
ChangeNotifierProvider.value(value: PatientsProvider()), ChangeNotifierProvider<PatientsProvider>(create: (context) => PatientsProvider()),
ChangeNotifierProvider.value(value: AuthProvider()), ChangeNotifierProvider<AuthProvider>(create: (context) => AuthProvider()),
ChangeNotifierProvider.value(value: ProjectsProvider()), ChangeNotifierProvider<ProjectsProvider>(create: (context) => ProjectsProvider()),
], ],
child: MaterialApp( child: MaterialApp(
//******amjad*****To remove debug app*******************
showSemanticsDebugger: false, showSemanticsDebugger: false,
//********************************
title: 'Flutter Demo', title: 'Flutter Demo',
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.blue, primarySwatch: Colors.blue,

@ -18,21 +18,7 @@ class ScheduleProvider with ChangeNotifier {
bool isLoading = true; bool isLoading = true;
bool isError = false; bool isError = false;
String error = ''; String error = '';
RequestSchedule requestSchedule = RequestSchedule( RequestSchedule requestSchedule = RequestSchedule(15, 1, 70907, 7, 2, '2020-04-22T11:25:57.640Z', '11.11.11.11', 1.2, 9, '2lMDFT8U+Uy5jxRzCO8n2w==', 'vV6tg9yyVJ222', true, false, 1);
15,
1,
70907,
7,
2,
'2020-04-22T11:25:57.640Z',
'11.11.11.11',
1.2,
9,
'2lMDFT8U+Uy5jxRzCO8n2w==',
'vV6tg9yyVJ222',
true,
false,
1);
ScheduleProvider() { ScheduleProvider() {
getDoctorSchedule(); getDoctorSchedule();
@ -62,7 +48,7 @@ class ScheduleProvider with ChangeNotifier {
isError = true; isError = true;
error = 'Please Check The Internet Connection'; error = 'Please Check The Internet Connection';
} }
print('Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeer');
notifyListeners(); notifyListeners();
} catch (error) { } catch (error) {
throw error; throw error;

@ -243,7 +243,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
//_patientSearchFormValues. = value; //_patientSearchFormValues. = value;
}, },
), ),
(!(_selectedType == '3' || _selectedType == '5')) (!(_selectedType == '2' || _selectedType == '4'))
? DynamicElements(_patientSearchFormValues) ? DynamicElements(_patientSearchFormValues)
: SizedBox( : SizedBox(
height: 0, height: 0,

@ -33,8 +33,19 @@ class PatientsScreen extends StatefulWidget {
class _PatientsScreenState extends State<PatientsScreen> { class _PatientsScreenState extends State<PatientsScreen> {
List<dynamic> litems; List<dynamic> litems;
// final List parsed;
List parsed;
//**********
List date;
List unfilterDate;
//***********
List<PatiantInformtion> responseModelList; List<PatiantInformtion> responseModelList;
List<PatiantInformtion> responseModelList2;
List<String> _locations = ['Today', 'Tomorrow', 'Next Week']; List<String> _locations = ['Today', 'Tomorrow', 'Next Week'];
int _activeLocation = 0; int _activeLocation = 0;
@ -60,7 +71,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
patientType = routeArgs['selectedType']; patientType = routeArgs['selectedType'];
patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
print("**************patiant Type**************");
print(patientType); print(patientType);
if (_isInit) { if (_isInit) {
@ -71,9 +82,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
int val2 = int.parse(patientType); int val2 = int.parse(patientType);
litems = res[SERVICES_PATIANT2[val2]]; litems = res[SERVICES_PATIANT2[val2]];
final List parsed = litems; parsed = litems;
responseModelList = new ModelResponse.fromJson(parsed).list; responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2=responseModelList;
//******************** //********************
_isLoading = false; _isLoading = false;
_hasError = res['ErrorEndUserMessage']; _hasError = res['ErrorEndUserMessage'];
@ -86,6 +98,40 @@ class _PatientsScreenState extends State<PatientsScreen> {
_isInit = false; _isInit = false;
super.didChangeDependencies(); super.didChangeDependencies();
} }
/*
*@author: Amjad Amireh
*@Date:2/5/2020
*@param:
*@return:PatientsScreen Search textbox
*@desc:
*/
searchData(String str) {
var strExist = str.length > 0 ? true : false;
if (strExist) {
List<PatiantInformtion> filterData=[] ;
for (var i = 0; i < responseModelList2.length; i++) {
String firstName = responseModelList[i].firstName.toUpperCase();
String lastName = responseModelList[i].lastName.toUpperCase();
if (firstName.contains(str.toUpperCase())||lastName.contains(str.toUpperCase())) {
print("==========data done===========");
filterData.add(responseModelList[i]);
}
}
setState(() {
print("==========data good===========");
this.responseModelList = filterData;
});
} else {
setState(() {
print("==========no data===========");
this.responseModelList =this.responseModelList2;
});
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -95,11 +141,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
appBarTitle: patientTypetitle, appBarTitle: patientTypetitle,
//***********Modify by amjad (create List view to insert all new data webservise in scroll )************* //***********Modify by amjad (create List view to insert all new data webservise in scroll )*************
body: Container( body: Container(
// margin: EdgeInsets.all(20),
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[ child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container( Container(
child: litems == null child: litems == null
? Column() ? Column()
: Column( :
Column(
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -111,50 +159,56 @@ class _PatientsScreenState extends State<PatientsScreen> {
width: SizeConfig.screenWidth * 0.80, width: SizeConfig.screenWidth * 0.80,
child: TextField( child: TextField(
controller: _controller, controller: _controller,
onSubmitted: (value) {
// fetch all the news related to the keyword onChanged: (String str){
if (value.isNotEmpty) { // print(str);
// vm.search(value); this.searchData(str);
}
}, },
decoration: decoration:
buildInputDecoration(context, 'Search patiant'), buildInputDecoration(context, 'Search patiant'),
), ),
), ),
Column( Container(
children: margin: EdgeInsets.fromLTRB(15, 0, 15, 0),
responseModelList.map((PatiantInformtion item) { child: Column(
return InkWell(
child: CardWithBgWidget( children:
widget: Column( responseModelList.map((PatiantInformtion item) {
crossAxisAlignment: CrossAxisAlignment.start, return InkWell(
children: <Widget>[ child: CardWithBgWidget(
AppText(
item.nationalityName, widget: Column(
fontSize: 2.5 * SizeConfig.textMultiplier,
), crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: <Widget>[
height: 8, AppText(
), item.firstName,
AppText(item.lastName, fontSize: 2.5 * SizeConfig.textMultiplier,
fontSize: ),
2.5 * SizeConfig.textMultiplier), SizedBox(
SizedBox( height: 8,
height: 8, ),
), AppText(item.lastName,
AppText(item.middleName, fontSize:
fontSize: 2.5 * SizeConfig.textMultiplier),
2.5 * SizeConfig.textMultiplier), SizedBox(
], height: 8,
),
AppText(item.middleName,
fontSize:
2.5 * SizeConfig.textMultiplier),
],
),
), ),
), onTap: () {
onTap: () { Navigator.of(context).pushNamed(
Navigator.of(context).pushNamed( PATIENTS_PROFILE,
PATIENTS_PROFILE, arguments: {"patient": item});
arguments: {"patient": item}); },
}, );
); }).toList(),
}).toList(), ),
), ),
], ],
)) ))

@ -35,7 +35,7 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.0" version: "2.4.1"
bazel_worker: bazel_worker:
dependency: transitive dependency: transitive
description: description:
@ -49,7 +49,7 @@ packages:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.5" version: "2.0.0"
build: build:
dependency: transitive dependency: transitive
description: description:
@ -126,7 +126,7 @@ packages:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.2" version: "1.1.3"
checked_yaml: checked_yaml:
dependency: transitive dependency: transitive
description: description:
@ -134,6 +134,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.2" version: "1.0.2"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
code_builder: code_builder:
dependency: transitive dependency: transitive
description: description:
@ -147,7 +154,7 @@ packages:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.14.11" version: "1.14.12"
connectivity: connectivity:
dependency: "direct main" dependency: "direct main"
description: description:
@ -203,7 +210,14 @@ packages:
name: dart_style name: dart_style
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.6" version: "1.3.4"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
@ -310,13 +324,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.9.10" version: "0.9.10"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
imei_plugin: imei_plugin:
dependency: "direct main" dependency: "direct main"
description: description:
@ -387,6 +394,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.9.6+3" version: "0.9.6+3"
nested:
dependency: transitive
description:
name: nested
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4"
node_interop: node_interop:
dependency: transitive dependency: transitive
description: description:
@ -414,7 +428,7 @@ packages:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.6.4" version: "1.7.0"
pedantic: pedantic:
dependency: transitive dependency: transitive
description: description:
@ -428,14 +442,7 @@ packages:
name: percent_indicator name: percent_indicator
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.3" version: "2.1.1+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
platform: platform:
dependency: transitive dependency: transitive
description: description:
@ -477,7 +484,7 @@ packages:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.2.0" version: "4.0.5+1"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -580,7 +587,7 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.5" version: "1.7.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -622,7 +629,7 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.11" version: "0.2.15"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@ -658,13 +665,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
yaml: yaml:
dependency: transitive dependency: transitive
description: description:

@ -23,7 +23,7 @@ dependencies:
flutter_device_type: ^0.2.0 flutter_device_type: ^0.2.0
intl: ^0.16.1 intl: ^0.16.1
http: ^0.12.0+4 http: ^0.12.0+4
provider: ^3.0.0 provider: ^4.0.5+1
i18n: any i18n: any
shared_preferences: ^0.5.6+3 shared_preferences: ^0.5.6+3
imei_plugin: ^1.1.6 imei_plugin: ^1.1.6

Loading…
Cancel
Save