finish patient search form

merge-requests/1/merge
Elham Rababah 6 years ago
parent 688da88236
commit 3aeb84d790

@ -0,0 +1,13 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart"
}
]
}

@ -1,4 +1,6 @@
import './screens/patient_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patients_list_screen.dart';
import './screens/patients/patient_search_screen.dart';
import './screens/my_schedule_screen.dart';
@ -7,9 +9,11 @@ import './screens/home_screen.dart';
const String INIT_ROUTE = 'login';
const String HOME = '/';
const String LOGIN = 'login';
const String MY_SCHEDULE = 'my-schedule';
const String QR_READER = 'my-schedule';
const String PATIENT_SEARCH = 'patient-search';
const String PATIENT_SEARCH = 'patients/patient-search';
const String PATIENTS = 'patients/patients';
var routes = {
@ -17,4 +21,5 @@ var routes = {
INIT_ROUTE:(_)=>Loginsreen(),
MY_SCHEDULE:(_)=>MyScheduleScreen(),
PATIENT_SEARCH:(_)=>PatientSearch(),
PATIENTS:(_)=>PatientsList()
};

@ -1,19 +1,106 @@
import 'dart:convert';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/patients/patients_list_screen.dart';
import 'package:dson/dson.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class PatientModel {
int ProjectID;
int ClinicID;
int DoctorID;
String FirstName;
String MiddleName;
String LastName;
String PatientMobileNumber;
String PatientIdentificationID;
int PatientID;
String From;
String To;
int LanguageID;
String stamp;
String IPAdress;
double VersionID;
int Channel;
String TokenID;
String SessionID;
bool IsLoginForDoctorApp;
bool PatientOutSA;
PatientModel(
{this.ProjectID,
this.ClinicID,
this.DoctorID,
this.FirstName,
this.MiddleName,
this.LastName,
this.PatientMobileNumber,
this.PatientIdentificationID,
this.PatientID,
this.From,
this.To,
this.LanguageID,
this.stamp,
this.IPAdress,
this.VersionID,
this.Channel,
this.TokenID,
this.SessionID,
this.IsLoginForDoctorApp,
this.PatientOutSA});
}
class PatientSearch extends StatefulWidget {
@override
_PatientSearchState createState() => _PatientSearchState();
}
class _PatientSearchState extends State<PatientSearch> {
final List<Map<String, String>> _items = [
{"text": "outPatiant1", "val": "1"},
{"text": "outPatiant3", "val": "3"},
{"text": "outPatiant2", "val": "2"},
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 _selectedItem = '2';
String _selectedType = '1';
String _selectedLocation = '1';
final _patientSearchForm = GlobalKey<FormState>();
var _patientSearchFormValues = PatientModel(
ProjectID: 12,
ClinicID: 17,
DoctorID: 98129,
FirstName: "0",
MiddleName: "0",
LastName: "0",
PatientMobileNumber: "0",
PatientIdentificationID: "0",
PatientID: 0,
From: "0",
To: "0",
LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z",
IPAdress: "11.11.11.11",
VersionID: 1.2,
Channel: 9,
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
SessionID: "5G0yXn0Jnq",
IsLoginForDoctorApp: true,
PatientOutSA: false);
void _saveForm() {
_patientSearchForm.currentState.save();
// Navigator.pushNamed(context,routeName)
Navigator.of(context).pushNamed(PATIENTS);
}
@override
Widget build(BuildContext context) {
@ -29,49 +116,58 @@ class _PatientSearchState extends State<PatientSearch> {
padding: EdgeInsets.all(15),
width: constraints.maxWidth * 0.9,
child: Form(
key: _patientSearchForm,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Patiant Type',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 15,
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
border:
Border.all(color: Theme.of(context).primaryColor),
),
width: double.infinity,
child: DropdownButton(
value: _selectedItem,
value: _selectedType,
iconSize: 24,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return _items.map((item) {
return Text(item['text']);
return _patientType.map((item) {
return Text(item['text'], textAlign: TextAlign.end);
}).toList();
},
onChanged: (String newValue) => {
setState(() {
_selectedItem = newValue;
_selectedType = newValue;
})
},
items: _items.map((item) {
items: _patientType.map((item) {
return DropdownMenuItem(
child: Text('${item['text']}'),
child: Text(
'${item['text']}',
textAlign: TextAlign.end,
),
value: item['val'],
);
}).toList(),
),
),
SizedBox(
height: 15,
height: 10,
),
Text(
'First Name',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 15,
height: 10,
),
TextFormField(
decoration: InputDecoration(
@ -92,6 +188,9 @@ class _PatientSearchState extends State<PatientSearch> {
)
//BorderRadius.all(Radius.circular(20));
),
onSaved: (value) {
_patientSearchFormValues.FirstName = value;
},
validator: (value) {
if (value.isEmpty) {
return 'Please enter some text';
@ -100,14 +199,14 @@ class _PatientSearchState extends State<PatientSearch> {
},
),
SizedBox(
height: 15,
height: 10,
),
Text(
'Middle Name',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 15,
height: 10,
),
TextFormField(
decoration: InputDecoration(
@ -134,16 +233,19 @@ class _PatientSearchState extends State<PatientSearch> {
}
return null;
},
onSaved: (value) {
_patientSearchFormValues.MiddleName = value;
},
),
SizedBox(
height: 15,
height: 10,
),
Text(
'Last Name',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 15,
height: 10,
),
TextFormField(
decoration: InputDecoration(
@ -170,18 +272,22 @@ class _PatientSearchState extends State<PatientSearch> {
}
return null;
},
onSaved: (value) {
_patientSearchFormValues.LastName = value;
},
),
SizedBox(
height: 15,
height: 10,
),
Text(
'Phone Number',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 15,
height: 10,
),
TextFormField(
keyboardType: TextInputType.number,
decoration: InputDecoration(
hintText: 'Phone Number',
hintStyle: TextStyle(
@ -206,57 +312,65 @@ class _PatientSearchState extends State<PatientSearch> {
}
return null;
},
onSaved: (value) {
_patientSearchFormValues.PatientMobileNumber = value;
},
),
SizedBox(
height: 15,
height: 10,
),
// Container(child: GridView(gridDelegate: null,),)
SizedBox(
height: 15,
height: 10,
),
Text(
'Patiant ID',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 15,
height: 10,
),
TextFormField(
decoration: InputDecoration(
hintText: 'Patiant ID',
hintStyle: TextStyle(
fontSize: isSmallScreen
? 14
: constraints.maxWidth * 0.024),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(
color: Theme.of(context).primaryColor),
)
//BorderRadius.all(Radius.circular(20));
),
validator: (value) {
if (value.isEmpty) {
return 'Please enter some text';
}
return null;
},
),
keyboardType: TextInputType.number,
decoration: InputDecoration(
hintText: 'Patiant ID',
hintStyle: TextStyle(
fontSize: isSmallScreen
? 14
: constraints.maxWidth * 0.024),
enabledBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(20)),
borderSide:
BorderSide(color: Hexcolor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(
color: Theme.of(context).primaryColor),
)
//BorderRadius.all(Radius.circular(20));
),
validator: (value) {
if (value.isEmpty) {
return 'Please enter some text';
}
return null;
},
onSaved: (value) {
_patientSearchFormValues.PatientID = int.parse(value);
}),
SizedBox(
height: 15,
height: 10,
),
Text(
'Patiant File',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 15,
height: 10,
),
TextFormField(
decoration: InputDecoration(
@ -283,16 +397,19 @@ class _PatientSearchState extends State<PatientSearch> {
}
return null;
},
onSaved: (value) {
// _patientSearchFormValues. = value;
},
),
SizedBox(
height: 15,
height: 10,
),
Text(
'From',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 15,
height: 10,
),
TextFormField(
decoration: InputDecoration(
@ -319,15 +436,19 @@ class _PatientSearchState extends State<PatientSearch> {
}
return null;
},
onSaved: (value) {
_patientSearchFormValues.From = value;
},
),
SizedBox(
height: 15,
),Text(
height: 10,
),
Text(
'TO',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 15,
height: 10,
),
TextFormField(
decoration: InputDecoration(
@ -354,21 +475,110 @@ class _PatientSearchState extends State<PatientSearch> {
}
return null;
},
onSaved: (value) {
_patientSearchFormValues.To = value;
},
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
border:
Border.all(color: Theme.of(context).primaryColor),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Checkbox(
value: true,
activeColor: Theme.of(context).primaryColor,
onChanged: (bool newValue) {}),
Text('Only Arrived Patient',
style: TextStyle(
fontSize: isSmallScreen
? 18
: constraints.maxWidth * 0.018)),
],
),
),
SizedBox(
height: 10,
),
SizedBox(
height: 15,
Text(
'Patiant',
style: TextStyle(fontSize: 16),
),
SizedBox(
height: 10,
),
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Checkbox(
value: true,
activeColor: Theme.of(context).primaryColor,
onChanged: (bool newValue) {}),
Text("Remember me", style: TextStyle(fontSize:isSmallScreen?18:constraints.maxWidth*0.018)),
],
),)
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
border:
Border.all(color: Theme.of(context).primaryColor),
),
width: double.infinity,
child: DropdownButton(
value: _selectedType,
iconSize: 24,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return _locations.map((item) {
return Text(item['text']);
}).toList();
},
onChanged: (String newValue) => {
setState(() {
_selectedType = newValue;
})
},
items: _locations.map((item) {
return DropdownMenuItem(
child: Text('${item['text']}'),
value: item['val'],
);
}).toList(),
),
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
onPressed: () {
_saveForm();
},
textColor: Colors.white,
elevation: 0.0,
padding: const EdgeInsets.all(0.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(
width: 0.5, color: Hexcolor('#CCCCCC'))),
child: Container(
padding: const EdgeInsets.all(10.0),
height: 50,
width: 200,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Text('Search',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: isSmallScreen
? 20
: constraints.maxWidth * 0.020)),
Icon(Icons.search)
],
),
),
)
],
)
],
),
),

@ -0,0 +1,9 @@
import 'package:flutter/material.dart';
class PatientsList extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('PatientsList'),),
);
}
}

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/routes.dart';
import '../../routes.dart';
import 'package:flutter/material.dart';
class AppDrawer extends StatelessWidget {
@ -36,7 +36,7 @@ class AppDrawer extends StatelessWidget {
title: Text('Log Out'),
leading: Icon(Icons.exit_to_app),
onTap: () {
drawerNavigator(context, LOGIN);
},
)
],

@ -1,6 +1,20 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "0.39.4"
archive:
dependency: transitive
description:
@ -22,6 +36,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
bazel_worker:
dependency: transitive
description:
name: bazel_worker
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.23+1"
boolean_selector:
dependency: transitive
description:
@ -29,6 +50,83 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
build:
dependency: transitive
description:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.2"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
build_daemon:
dependency: transitive
description:
name: build_daemon
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
build_modules:
dependency: transitive
description:
name: build_modules
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.1"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "4.5.2"
build_web_compilers:
dependency: "direct dev"
description:
name: build_web_compilers
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.0"
built_collection:
dependency: transitive
description:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "4.3.2"
built_mirrors:
dependency: transitive
description:
name: built_mirrors
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.0"
built_value:
dependency: transitive
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "7.0.9"
charcode:
dependency: transitive
description:
@ -36,6 +134,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
code_builder:
dependency: transitive
description:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.1"
collection:
dependency: transitive
description:
@ -57,6 +169,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
cupertino_icons:
dependency: "direct main"
description:
@ -64,6 +183,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
dson:
dependency: "direct main"
description:
name: dson
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.0"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.11"
flutter:
dependency: "direct main"
description: flutter
@ -81,6 +221,20 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
glob:
dependency: transitive
description:
name: glob
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
graphs:
dependency: transitive
description:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
hexcolor:
dependency: "direct main"
description:
@ -88,6 +242,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
html:
dependency: transitive
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0+3"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.0+4"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.3"
image:
dependency: transitive
description:
@ -95,6 +277,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
io:
dependency: transitive
description:
name: io
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1+1"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.4"
matcher:
dependency: transitive
description:
@ -109,6 +319,41 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.6+3"
node_interop:
dependency: transitive
description:
name: node_interop
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
node_io:
dependency: transitive
description:
name: node_io
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1+2"
package_config:
dependency: transitive
description:
name: package_config
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.1"
package_resolver:
dependency: transitive
description:
name: package_resolver
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.10"
path:
dependency: transitive
description:
@ -130,6 +375,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
pool:
dependency: transitive
description:
name: pool
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
protobuf:
dependency: transitive
description:
name: protobuf
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
pub_semver:
dependency: transitive
description:
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.3"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
quiver:
dependency: transitive
description:
@ -137,11 +410,53 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
scratch_space:
dependency: transitive
description:
name: scratch_space
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+2"
serializable:
dependency: transitive
description:
name: serializable
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.0"
shelf:
dependency: transitive
description:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.5"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.3"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
description:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.5"
source_maps:
dependency: transitive
description:
name: source_maps
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.9"
source_span:
dependency: transitive
description:
@ -163,6 +478,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
stream_transform:
dependency: transitive
description:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
string_scanner:
dependency: transitive
description:
@ -184,6 +506,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.11"
timing:
dependency: transitive
description:
name: timing
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+2"
typed_data:
dependency: transitive
description:
@ -198,6 +527,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
watcher:
dependency: transitive
description:
name: watcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.7+14"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
xml:
dependency: transitive
description:
@ -205,5 +548,12 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
yaml:
dependency: transitive
description:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
sdks:
dart: ">=2.4.0 <3.0.0"
dart: ">=2.7.0 <3.0.0"

@ -21,6 +21,7 @@ dependencies:
sdk: flutter
hexcolor: ^1.0.1
flutter_device_type: ^0.2.0
dson: ^0.16.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
@ -28,6 +29,8 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: any
build_web_compilers: any
# For information on the generic Dart part of this file, see the

Loading…
Cancel
Save