Professional Documents
Culture Documents
BY
ODIRI EMMANUEL
PSC1707529
UNIVERSITY OF BENIN
BENIN CITY
NIGERIA.
DESIGN AND IMPLEMENTATION OF A MOBILE APPLICATION FOR
EMERGENCY MEDICAL, SERVICE
(A Case Study of the Department of Health Services,University of Benin)
BY
ODIRI EMMANUEL
PSC1707529
DECEMBER,2022
CERTIFICATION
This is to certify that this project work was carred out by Odiri Emmanuel with the matriculation
supervision and it is adequate in scope and content for the award of Bachelor of Science
Project
Supervisor
DR.(MRS.)V.I.OSUBOR
Date
APPROVAL.
This project is hereby approved by the department of computer science in partial fulfillment of
the requirement for the award of Bachelor of Science Degree(I1.Sc.)in Computer Science of the
University of Benin, Benin City, Nigeria
DEDICATION
This project is dedicated to God Almighty for His love and mercies throughout my study
period.Also to my dear parent for their great support and to my beloved siblings,close
friends and associates for your immense contributions during the courseof this project
work.
ACKNOWLEDGEMENTS
My profound gratitude to God Almighty for His abundant love,guidance and protection
supervisor Dr. (Mrs.) V.I.Osubor,for guiding and directing me during the cause of the project
execution.I also sincerely thank the Head of Department and all staffs of the Department of
All thanks to my lovely parents Mr.and Mrs.Ogheneovo Odiri for their support and words of
Director of Nursing,Mrs.Helene Obazenu and the nurses and medical staff of the Out Patient
Department for your immense contribution towards the successful research and execution of
TABLE OF CONTENT
Certification...
Approval...... .·.
Dedication...
Acknowledgement... ---
Table of Content......
List of Figures...
Abstract......
Chapter 1:Introduction......
1.2 Motivation......
182.4
Mobile Applications:An Overview...
2.4.1 Some Mobile Applications for Emergency Medical Serice.. 21
25Chapter
3:System Analysis and Design...
253.1
System Analysis.....
263.2
Analysis of Existing System..
273.3
Constraints of the Existing System...
283.4
Overview of the Proposed System...
4.3.1 Dart...... 37
4.4 Software Integrated Development Environment (IDE) and Tools Used
4.4.1 Visual Studio Code... ---38
Database Design..- 39
5.3 Recommendation... 47
References...
48
LIST OF FIGURES
ABSTRACT
Mobile application technology has radically transformd every aspect of the human cconomy.It
care delivery.There are several areas of health care delivery that utilizes mobile application
services is a system that provides urgent pre-hospital treatment and stabilization for serius
illness and injuries and transport to definitive care most likely an emergency department of a
hospital.
This project work attempts to design and implement a mobile application for emergency
medical service within tertiary institution of learning and serve as a means to provide timely and
coordinated response to medical emergencies thereby promoting a healthy and safe learning
environment.
CHAPTER ONE
INTRODUCTION
to run on a mobile device such as a smartphone or tablet computer. Mobile applications frequently
Computers.(Techopedia,2020).
Mobile application technology have radiclly transformed every aspect of human cconomy;
Services,Banking,Shopping and many more. It has greatly improved and provided solutions
The exploding popularity of smartphones and tablets has made mobile application
development an increasingly popular trend among business owners all over the world. The
mobile application development industry has grown leaps and bound ever since its inception.
According to the International Telecommunication Union (ITU),in 2015 there were more than
7 billion mobile telephone subscriptions across the world, over 70% of which were in low or
middle income countries.
Several medical resources are available on digital distribution platforms of mobile applications
(Google Playstore and Apple App Store) for Android and iOS operating system.(Alejandro et
al.,2020)
According to the World Health Organization,the development of mobile application for the health
There are several areas of health care delivery where mobile application technology has been
Emergency Medical Service, commonly known as EMS, is an integrated system that provides
emergency medical care.This sysem provides urgent pre-hospital treatment and stabilization for
serious illness and injuries and transport to definitive care,most likely an emergency department
of a hospital.
Emergency Medical Service provides emergency medical care for all types of emergencies
It is one of the most important health care services as it plays a vital role in saving
emergency medical services due to their ease of use, broad reach and timely response.
This project attempts to design and implement a mobile application for emergency medical service within
tertiary institution of learning thereby providing a platform that would hamess mobile application technology in
emergency medical service and ensure that those in need of urgent medical care are attended to from the
1.2 Motivation
Health care delivery is an important area of concern in our society.The need to save life and prevent
worsened health conditions due to delyed access to medical services is of core concem.
In today's world mobile applications are becoming an important resource for health service delivery
Employing mobile application technology in managing emergency medical service would provide a
timely and coordinated response thereby promoting a healthy and safe society.
Domestic accidents, fainting attack, cardiac arrest, asthmatic attacks, threatening injuries, severe
times have been cases of emergency medical care within tertiary institution of learning.
Although there are health centerswithin the learning environment,access and timely
There is need to create a system that ensures timely and coordinated response to these
emergencies thereby increasing chances of patient's survival and averting worsened health
conditions.This is a challenge this project seek to address.
The aim is to build a system that would haress mobile application technology in emergence
medical service within tertiary institution of learning following these objectives;
2
·To study existing systems for emergency medical service
This project work focuses on emergency medical service within tertiary institution of
This project adopted the cross-platform mobile application development method.It is a modern
approach to build mobile applications that can run on different platforms (Android,iOS and Web-
Applications) offering uniformity across all platforms,casy implementation and cost effective
production.
The digital design and prototyping of the user interfaces (ui) and user experience (ux) of the
proposed mobile application was modeled using Figma, a cloud based design tool for interface
design.
Thereafter the design was implemented. Implementation was done using the following set of
tools: Flutter framework, Dart programming language, Android Studio as its Integrated
·Implement mobile application technology in health care delivery and emergency medical
service.
Student in need of urgent medicalcare are offered timely response from the site of injury or
learning.
Create a system that offers closer health service delivery and prompt response to
This project has greatly motivated me in many ways. It has exposed me to a more
computational and technological approach in mobile application development.However there
were some few limitations encountered during the course of the project.
Getting the required System needed for the implementation of the mobile
application.
CHAPTER TWO
LITERATURE REVIEW
In this chapter,an overview of emergeney medical service was discussed.It went further to examine emergency m
service in tertiary institution,having a review of the Department of Health Services,University of Benin.Finally an overv
mobile applications and a review of some mobile applications for emergency medical service was discussed.
care. This system provides urgent pre-hospital treatment and stabilization for serious illness and in
and transport to definitive care, most likely an emergency department of a hospital.(Federal Mini
Health Abuja,2016).
5
A medical emergency is an injury or illness that is acute and poses an immediate risk to a
person's life or long-term health and it's extremely important to attend to these patients
immediately. The early identification ofa medical emergency and subsequent management will
be helpful to save a patient's life and prevent irreversible consequences. (Ramanayake et al.,
2014)
Emergency medical service provides emergency medical care for all types of
The objective of the emergency medical service is to reach those in need of urgent medical care
in order to satisfactorily treat the presenting conditions.from the scene of incidents to the point
of definitive care.
services.
The emergency medical service consists of the following components: Pre-hospital personnel
conditions, Equipped Accident and Emergency units,Emergency drugs and consumables, Side
laboratory, etc. and an informed public that knows what to do in emergency situations.
Modern Emergency Medical Service is considered to have started with Jean Dominique
Larrey,Napoleon's chief physician, who organized a system to treat and transport injured
French soldiers. During the Civil War, the Union Army developedan organized system to
7
evacuate soldiers from the field. Lessons learned during the Civil War were applied as civilian
emergency medical service systems formed duringthe late 1800s.By 1960,a patchwork of
unregulated systems had developed, with services sometimes being provided by hospitals, fire
others had minimally trainedor untrained personnel. Despite the major expansion in health care
specializationafter World War II,the emergency medical service system had not
The need to enhance health system responsiveness and create a health society has been a great
concemn.In recent time, there have been growing improvements in emergency medical services
In most developed nations, te emergency medical service can be summoned by members of the public
which puts them in contact with a control facility,which will then dispatch a suitable resource for the
situation. Examples of such emergency telephone number include: 999 emergency number in the
Ambulances are the primary vehicles for delivering emergency medical service,though some also use
Emergency medical service exists to accomplish the basic principles of first aid,which are to preserve
In Nigeria,access to medical cares for urgent or life threatening conditions is a key expectation in many
communities.The timely demand to enhance the health care delivery of the population and ensure an
improved utilization of emergency medical service to achieve a better outcome is imperative. (Adetoun
8
8
et al..2021).
Although efforts has been made in emergency medical service delivery in Nigeria through private and
establishment of call centres.There is need to coordinate all medical emergency services in Nigeria and
In March 2016,the Federal Ministry of Health,Abuja published a Policy on Emergency Medical Services
(EMS) in Nigeria.The Policy on emergency medical services would help to coordinate and integrate
emergency medical services in Nigeria and ensure timely and coordinated intervention to medical and
surgical emergencies, averting preventable deaths due to delayed access to emergency care (Federal
The Component of the Policy on Emergency Medical Service (EMS) in Nigeria entails the following:The
Federal Ministry of Health as Custodian of the health sector policies and lead agency. National
Emergency Management Agency (NEMA),hosting the National Call Centres 112 in collaboration with
National Communication Commission, the Federal Road Safety Commission,regulator and provider of
road sfety,Paramedics schools,Accidents and Emergency Units of all Hospitals (A&Es), Trauma centres
at National and State levels;Emergency service section in all Ministries,Department and Agencies.
Recognizing the immense benefits of an emergency medical service system,in April 2021,the
Nigerian Senate through the Senate Committee on Communications organized a one-day public
hearing on te Nigerian Postal Service Act (Repeal and Establishment) Bil1, 2021 and the
Nationwide Toll-Free Emergency Number (Establishment) Bill, 2021 where stakeholders gathered
to make valuable cntributions and observations on two bills.The aim was to have extensive
discussion towards making the bill more robust to ensure a more effective,uniform and well-
coordinated national emergency number 112. and will also help to establish the Nationwide Toll-
Free Number as a primary emergency number and contact point forall emergency services in the
country.(Punch,2021)
An emergency medical service must be available when needed,easily accessible, affordable and
There are certain challenges in Nigeria that hinders effective and efficient emergency medical
service system some of which include:poor funding of the health sector,a low substantial effort to
sensitive and mobilize the general public in the area of emergency medical service, poor
The need to address these challenges and create an effective emergency medical service system
across the nation would ensure a healthy and safe society thereby reducing morbidity and
mortality.
Emergency medical service plays a vital role in saving people's lives and reducing the rate of mortality and
morbidity.
In our world today,emergency medical service operates in different forms.These operations includes: focu
to save lives, protection of the environment,assist communities impacted by disasters and nid recover
during emergencies.Some forms of cmergency medical service are briefly explained as follows:
·Government Emergency Medical Service: This is a type of emergency medical service tha
is provided by the government of a state.They are funded by local, provincial or nationa
government. In some countries, these only tend to be found in large cities,whereas in
11
cuntries such as the United Kingdom, almost all emergency ambulances are part of a
national health system.In the United States, ambulance services provided by a local
government are often referred to as "third service" emergency medical service.
In April 2021,the Federal Government of Nigeria announced plans to introduce the National
Emergency Medical Service and Ambulance System.This system would reduce the number of
deaths caused by the delay in accessing health care services and provide prompt and efficient
emergency medical service to the people. This system would also initiate Govemment
providing emergency medical attention to the public and private sector of the
society(nigerianfinder,2022).
According to te World Bank (2021),Tertiary education refers to all formal post-secondary education,
including public and private universities, colleges, technical training and vocational schools.
Tertiary educational institutions in Nigeria are institutions offering hiher and advanced forms of
group of people is passed from one generation to generation.Without a doubt, our existene and
survival on the face of the planet as a specie has been helped in no small measure by the
discoveries, knowledge and learning that have,over the course of several centuries,been acquired
in the sciences, arts and other aspect of human learning (Aare 2022).
12
It is important for every learning community to have a ready and accessible health
care facility to cate for the health needs of its members.Every tertiary educational
healthy learning environment for students and staff around the university,colleges of
schools.
However as a result of the fact that these teaching hospitals offer health care delivery to the
general public and in most instances the proximity of these teaching hospitals to the university
campuses are distance apart, each tertiary educational institution is saddled with the responsibility
to provide health centers that would aid in primary health care delivery to students,staff and other
Quality and efficient health care delivery is paramount in any tertiary institution.These health
Recent happenings across the nation's tertiary institution reveal that some of these health centers
operate in dilapidated structures, lack sufficient ambulance system and insufficient medical
equiment.Hence quality and optimal health care services is needed through improved funding of
14
14
Fainting attack,cardiac arrest,domestic accidents,asthmatic attacks, threatening injuries, severe
Department of Health Services, University of Benin provides secondary health care delivery to
students,staff and their dependents in the university community.The department has a team of
dedicated and energetic medical and paramedical staff who are well trained and experienced in
The department is charged with the responsibility to promote positive health and vitality,
prevent infectious and non-infectious disease,organize and provide curative services,as well
Out-patient services are rendered in the two clinics located in Ugbowo and Ekehuan
There are several units in the health services department,which are explained briefly as
follows:
·Administrative Unit: This unit is headed by the Director of the Health Services
Department,assisted by the Deputy Director of Nursing and other heads of various units
in the facility.The administrative unit serves as the decision making unit and
15
15
ensure efficient service delivery.This unit also assists in the coondination of the
Recard Unit: This unit is charged with record keeping.They ensure proper doxumentation of
·Out Patient Department (OPD):The Out Patient Depatment consists of the consulting rooms that
Laboratory Unit:Various medical tests are carried out in the laboratory units. Some of
which are blood test,urine test,faeces test and more.This unit basically service to carry out
medical diagnosis.
Emergency Unit: This unit is also referred to accident and emergency unit (A&E). It
X-ray Unit: X-ray unit helps to carry out x-ray diagnosis for bones and soft tissues.It
Ward:It consists of male and female ward where patients are admitted and treated.
Dressing and Injection Unit: This unit helps in the treatment of patients wound. Dressing
is carried to stop bleeding, protect against infectin and ease pain. Injections are also
·Ambutance Unit: The Ambulance Unit provides ambulance service in cases of medical
emergencies.
17
·Laundry Unit:The laundry unit assists in washing,drying and ironing of patient's bed
sheets,hospital clothes and other textile materials there by ensuring a clean environment.
Services to students and other stakeholders in the university community in need of urgent
medical care. The department offers a 24-hour ambulance service.All cases that canno be
treated by the department are referred to the University of Benin Teaching Hospital (UBTH).
applications frequently serve to provide users with similar services to those accessed on
The mobile application industry is an ever growing industry that is now an integral part of any
Mohile applications allow users to have easy, functional access to information,products and
services and processes that they need in real-time and are optimized for hands on interaction.
The exploding popularity ofsmartphones and tablets has made mobile application development
an increasingly popular trend among business owners all over the world. Furthermore with the
growing number of people accessing the internet via smartphones and tablets,mobile
applications has the unique ability to access a large number of potential customers.
It is very evident that people consume digital media majorly on a mobile phone and mobile
applications take up 90% of the time spent on a mobile phone apart from using it for calls and
18
The mobile application industry market had its value as $106.27 Billion in 2018 and is expected
In Nigeria,the smartphone sector is among the fastest growing sector of the economy.
In the most recently measured period,there were almost 81 million mobile internet users in
Nigeria and mobile phone internet usage is particularly popular. The internet penetration
amounted to over 38% of the population in 2022 and is set to reach 48% in 2027(Statista,2022).
In today's world, mobile applications are essential as they provide functionalities that can serve
Mohile applications can be downloaded from various platforms such as Google Play Store and
A mohile application can also be referred to as an app,web app or iPhone app.There are free
apps as well as paid apps. Some apps can be used for free for a specific amount of time before
Mobile application development is the set of processes and procedures involved in wnting
software for small,wireless computing devices such as smartphones and other hand-held
devices.
There are several types of mobile application development technologies,some of which are
·Native Applications: These applications are basically platform specific that is they
are targeted towards a particular mobile platform therefore an appintended for Apple
device does not run in Android device. They built using integrated development
19
Apple iOS or Google Android.Native apps enables the developer to customize
weh technologies of HTML, CSS, and JavaScript. These mobile applications are
developed using web technologies.They are cheap and quick to develop however they
·Hybrid Applications: The concept of Hybrid Applications is a mistureof native and weh-hased
app.They are made to support web and native mobile development technologies acrons multiple
platforms. Theve apps are easier and faster to develop.This is because it involves a single codehase
which works in multiple mohile operating systems. Apps developed using Xamarin, React
Accarding to the world health organization,the development of apps for the health domain is
directly or indirectly intended to maintain or improve healthy behaviours, quality of life and
Mobile applications in the health sector are continually growing; several medical resources are
availahle on digital distribution platforms of mobile apps on the Google Play Store and Apple
App Store for Android and iOS operating systems. (Alejandro et al,2020).
contributed immensely in transforming health care delivery.An important the area of concern is
20
There are several mobile applications for emergency medical services available on
Google Play Store and Apple App Store,cach of them provides a common objective
·SOS Alert App:The SOS Alert is an emergency mpp which helps you out whenever your sa
at risk by reachingout to your emergency contacts and providing them with your current loca
case of an emergency,the user presses the SOS Widget or Button in the app;thereafter t
searches your current location on Google Maps and sends a link of your current location
SMS to the emergency contacts that registered on the app so they can locate you accurate
uniqueness of this app is that it offers the very basic user interface and ease of use by just o
of the SOS Widget.
·ICE (In Case of Emergency) App: This application creates a notification visible on your lock scree
notification contains all the necessary inforation about the registered app user.This information ca
be accessed by emergency medical services if the registered user is unable to tell them about
medical history or contacts.An amazing feature of this app is the Emergency SOS to allows u
Prime Alert App: Prime Alert App is an emergency alert app that helps to protec
save lives.It is user friendly and cost effective. The uniqueness of this app is
dependents location.
21
21
·Medical ID App: Medical ID App is an emergency alert app that allows users to create
medical profiles that are accesible from their lock screen.In case of emergency,the app
allows quick access to medical data from your lock screen.It also directs call from your
lock screen and contains an alert feature to send an SMS in one tap.
·HELP App: HELP (Health Emergency Linkage Portal) App offers swift access to
emergency care.It is one of the indigenous mobile applications for emergency medical
advance. Upon request,users not only get access to available ambulances within
proximity but they also get affordable options to choose from. Health Emergency
·DRO Health App: DRO Health App is another indigenous mobile application for health
care delivery and medical emergencies.It makes health care delivery casy, accessible
and affordable.This app also offers unlimited consultation with doctors online,proper
Most of the mobile applications available on the android and iOS operating systems;
function on a larger area metropolis and very few of these apps are available to offer
emergency medical service for leaming institution. Thus here is need to design a mobile
arplication system for emergency medical service in tertiary institutionof learning in ovder te
provide a closer health care delivery for students and other stakeholders in the leaming
community.The analysis and design are postulated in the next chapter.
CHAPTER THREE
23
3.1 System Analysis
System analysis is the process of collecting and interpreting facts,identifying problems, and
System analysis is conducted for the purpose of studying a system or its parts in order to identify its
objectives. It is a problem solving technique that improves the system and ensures that all the
There are various methodologies used in System Analysis and Design, these include:
that support the approach and a life cycle model to structure the development process.(Jeffery A.H.et
al.,2017)
For this project work, Object-Oriented System Analysis and Design (OOSAD)
Ohject-Oriented System Analysis and Design is a technical approach for analyzing and designing an
application or system,by applying object-onentedl concepts,as well as visual modeling throughout the
This methodology was chosen because the entire scope and features of this application is not yet
known and development will be carried out in an iterative format with incremental features as the need
arises unlike the structured system analysis and design methodology that insist that the entire
requirement and scope of the application must be provided before commencing the development
process.
25
In this project,the Department of Health Services,University of Benin was selected as the
system under study.The department has a team of dedicated medical and paramedical staff
who are well trained and experienced in health care delivery especially as it pertains to
Students and other stakeholders in need of emergency medical care place a phone call across
to the department through its existing emergency phone numbers. These emergency phone
numbers are available on designated signpost in some locations around the university learning
environment. Also there are other publications as well as the institution website that host these
Once a distress call is made,the personnel in charge of the OutPatient Department respond to the caller
quickly notify the ambulance unit.Thereafter the ambulance is sent to the scene of the distress call along
a medical staff.
There are cases of stable and unstable medical emergency conditions. For stable condition,the affected vi
in need of emergency medical care can still respond to treatment and give out vital information need
his/her medical proceeding.However for cases of unstable medical condition, an individual especially
close to the victim or at the scene of the incident can assist to render vital information that would help in the
Upon arrival at the health centre,the patients are immediately taken to the emergency unit of the Out Pa
Department (OPD)where they are admitted into the male or female ward and other medical treatm
continues. There is a team of standby medical doctor and nurses that are available to administer treatme
patients who are admitted to the emergency unit. All medical cases that cannot be treated by the departm
of health services are referred to the University of Benin Teaching Hospital (UBTH).
26
3.3 Constraints of the Existing System
Although the existing system uses voice communication through phone call to request
emergency medical care, there are still a few constraints that apply to the system;
the fact that the existing emergency lines are distributed on strategic locations and
are hosted on printed publications as well as on theinstitution website,in situations where victims in need of
emergency medical care are not in close proximity to these locations there is usually delayed access to
health care.
Single Channel of Communication:The existing system operates using voice communication through phone
call.However in the event of network downtime, this will pose a great threat to efficient emergency medical
service delivery.
Delayed update of emergency medical phone numbers:When there are changes on the existing
emergency lines,these changes will be effected only during the period of maintenance of the
The proposed system is called Unicare. It was coined using two keywords“University and"Health Care”.
Unicare is a mobile application which uses mobile phone voice communication as well as an
instant messaging web service technology to provide timely and coordinated response in
approach which consisted of flutter framework and dart programming language. Cross-
27
platform approach utilizes object-oriented system analysis anddesign methodology
effective production.
and prompt response to those in need of emergency medical service from the scene of the
incidents to the point of definitive care.Unicare is composed of the User App as well as the
Administrator App.The users of this platform consist of students, staffs (academic and non-
emergency unit,tasked with the responsibility of keeping records of daily registered users
28
28
The steps needed to reques for an emergency medical service are as follows:
The users which consist of students,staff and their dependents are required to register on the platform as first time
users.This registration is done on the signup page.Onlythe user's name and telephone number is required for this
process.As soon as registration is done, the user is directed immediately to the home page. Users on this platform
are not required to login their details again on the mobile application as their registered data are stored on the
Admin app using Google firebase database management system.They are automatically directed to the home
The home page displays the designated campus (Ugbowo and Ekenwan) of the University.Users are
required to just click on the call button of either of the campuses which automatically allows them to dial the
existing emergency number and place cellular phone call across to the department of health services.
Alternatively users can also use the instant messaging platform,by clicking on the
“Report Emergency Button" on the home page and fill in the required information and
click on send report. Thereafter an instant message is sent across from the administrator
health services communicating with the user and thereafter attending to the emergency
medical condition.
the proposed system is a mobile application for emergency medical service within the university
designed to ensure safety and prevent worsened health conditions due to delayed access to
30
ii. Alternative Channel of Communication: Outside the voice communication cell phone
provide a timely and efficient health care service delivery in cases of network downtime.
iii. Developing a Culture of Innovation: The exploding popularity of smartphones and tablets
has made mobile application an increasingly popular trend in every sector of the human
economy. The proposed system would help to harness mobile application technology in
emergency medical service and welcome new innovations and technological approach
System Design is the process of planning a new business system or replacing an existing
system by defining its components or modules to satisfy the specific requirements. System
A designer uses the design tools to express the information and knowledge in the
System design tools play an important role in system development.A few design tools used by so
designers include:
1. Data Flow Diagram (DFD): a data flow diagram is a graphical representation of flow of d
flow,outgoing data flow and stored data.It mentions nothing as to how data flows in a system
31
2. Unified Modelling Language (UML): is a general-purpose modeling language for systems
engineering applications. It was designed to provide a standard way to visualize the design of a
system. UML offers a way to visualize a systems architectural blueprint in a diagram including
elements such as:activities, individual components of the system and how they interact with other
software components,how entities interact with others, how the system will run,external user
interface.
The Unified Modeling Language was chosen as the tool for modeling the designs for
components of UML were used: class,diagrams,activity diagrams and use case diagrams.These
components were selected due to the fact that it is self-illustrative if pmopertly designed, it is simple
and suits the nature of the system. It is also easy for end usersto understand the model for the sofware
system.
A use cse is a list of actions or event steps typically defining the interactions between a role (an
actor) and a system, to achieve a goal. Simply put, it is a description of the systems behavior
from user's point of view with measurable result or value. Table 3.1 denotes use case notations
32
Actor
They are the systems users.The
actorcould a person, organization or
externalsystem. They perform a role
in thesystem.
Use Case
Use case is a lot of steps,
typicallydefining interactions
between an actorand a system to
achieve a goal.
System
System A system is a rectangle spanning all
not.
Relationship
<<include>> Illustrates the relationship
between anactor and a use case
<<Extend>> with a simpleline.It also illustrates
the relationshipbetween the use
cases (include &extend)
The use case for the actors on this platform are depicted in the following diagrams below
User:The users of this system consist of students, staff and their dependents are required to
register on the platform as first time users. This process is carried out on the Signup
33
Page.Once registration is complete, the user gains access to the home page and the Report
Emergency Page. Users can as well edit their information on the home page.
Admin:The admin of this system is the department of health services. The admin is in change of
keeping records of emergency reports sent by users of the system as well as monds of newly
registered users.
The implementation and documentation of the proposed system are postulated in the
next chapter.
CHAPTER FOUR
34
System Implementation is the development,integration and testing of system components and delivery
of that system into production. The chapter provides the user guide of the implementation of the system
All system needs certain components resources to function and execute effectively.There are
Hardware Requirement
Software Requirement
The hardware requirements for the mobile application to function and exccute effectively are:
64 bit based
The software requirement for the mobile application to function and execute effectively is:
36
These are the languages, tools, and technologies that has helped in the creation and/or modification
These are the programming languages used to achieve the goal of this project.
4.3.1.Dart
Dart is an open source, general purpose, object oriented programming language developed
by Google. The purpose of Dart programming language is to create frontend user interfaces
for mobile and web applications. It supports most of the common concepts of programming
languages like classes,functions.In recent times, dart programming language used on the
tools required to write and test software. The IDE integrate and manage these tools and
Visual Studio Code is a code editor and an Integrated Development Environment (IDE) that e
developers build and debug mobile,web and cloud application.It contains feature
37
Visual Studio Code was developed by Microsoft for Windows,Linux and Mac operating system.
development. It is the official IDE for Google's Android Operating System.It has a flexible
gradle-based build system, fast and feature-rich emulator for app testing, it has a
consolidated environment where application developers can develop for all android devices.
It also provides extensive testing tools and framework and build-in supports for Google
Cloud platform.
4.4.3 Flutter
Fluter is an Open-Souree User Interface Software Development Kit created by Google for
building and developing cross platform applications for Android, iOS, Linux, Mac, Windows and
Web from a single codebase, Flutter applications are coded in Dart Language.
Flutter features expressive and flexible UI, widgets that incorporates cross all application
platforms such as Stack Widget, Wrap Widgets, Scaffold Widgets, Basic Material
Widgets.
oogle Chrome is a cross platform web browser developed by Google. It is an open ource
application for accessing the world wide web and running web-based applications. t was first
released in 2008 for Microsoft Windows and was later ported to Linux, nacOS, iOS and Android.
he Database used for the mobile application development was Google Firebase
38
4.5.1 Google Firebase
irebase is acloud hosted database. It was developed by Google. It provides developers with a
variety of tools and services to help them deveop quality apps and grow their user base. It is built
on Google's infrastructure.
key features includle Authentication, Realime Database, Hosting, Test lab and
Notifications.
System testing is a level of testing which validates the complete and fully integrated
softwareproduct.The test carried out was an internal acceptance test which is based on olpha testing
in which the system developer used the systen as if'it was being used in the intended
4.7 Implementation
System Implementation is the process of defining how a system should be built, ensuring
39
39
4.7.1 Signup Page
Sign Up Now
Please bil the detals
Telephone Number
The Signup Page contains the Username Field and the Password field as the two input
fields.In this page the registration of new users of the mobile application is carried out.
40
EMERGENCY
The Home Page contains the call icon button for the two campuses that is Ugbowo and
Ekenwan Campus. In emergency medical situation, registered users simply click on the
call icon button and in the process place a phone call by dialing the emergency phone
number.
42
Phone Numbet(Optional)
HOME
41
Fig 6.0: A Snapshot of the Report Emergency Page
The Report Emergency Page provides an alternative medium over voice call communication for
reporting emergency medical cases. It is an instant messaging portal that consists of two main
fields that is the Emergency situation and Location.While the Phone number field is optional for
registered users. Once an emergency report is sent, it i received on the admin app. The admin
43
The Edit User Information Icon is located on the home page. It allows registered users to
admin,which the health services department to call reporters during emergency medical
situations.
43
Fig 8.0:A Snapshot of the User Reports Page
messaging portal on the user app. The Report page can only be accessed by the
that thedepartment of health services and reach out to the reporter requesting
44
omergency medical service.
Users Info
Odirl Emmanuel
The User information page contains the list of registered users on the platform. It is
43
CHAPTER FIVE
5.1 Summary
The project work covered all the basic processes involved in designing and implementing a mobile
application for emergency medical service within tertiary institution. It was designed to provide a
platform that would harness mobile application technology in emergency medical service and ensure
that students and other stakeholders within University in need of urgent medical care are attended to
The scope of the project focused on emergency medical service within tertiary institution of
learning using a case study of the Health Services Department, University of Benin.
Cross-platform mobile application development method was used. This approach utilizes
object-oriented system analysis and design. It consists of User App as well as the Admin App
working collaboratively and offering timely and prompt response to emergency medical
services.
5.2 CONCLUSION
This project work offers a mobile application that can address emergency medical service
within tertiary institution, providing a timely and coordinated response and promoting a health
RECOMMENDATION
46
Tertiary institutions especially univerities should embrace and implement the developedl
medical service.
Public and Private Hospitals can as well implement the developed system as it would
provide a greater awareness to sensitize the public and prevent worsened health
Further work can be done on the developed system by Govemment and other private stakcholders
to ensure a broader reach in managing emergency medical services especially in larger city
metropolis.
REFERENCE
Aare Afe Babalola, (2020) The Power of Education. The Journal of Sustainable Dorlopment
Law and Policy December 2020.
Alejandro P. R., Goncalo M., Beariz S. D., Francisco M. R., Carlos P. V, (2020) Mobile Halth
Apps for Medical Emergencies: Systenatic Review. JMIR Mhealth Uhealth 2020 vol.8 iss.12
Anitha Ashishdeep, Jitendra Bhatia, Krunal Varma (2015) Software Process Models for Mobile
Application Development:A Review.International Journal of Computer Science and
Communication 2015,Voume 7 March 2016 pp150-153.
Jeffrey A. H., Joey F. G., Joseph S. V. (2017). Modern System Analysis and Design, Eight
Edition.
Manish N.Shah (2006) The Formation of the Emergency Medical Services System. American
Journal of Public Health March 2006, Vol.96.No.3
Michelle Lin,Salim Rezaie (2014) Top 10 mobile apps in Emergency Medicine: Emergency Medicine
Journal February 2014
47
Olumide Abiodun, Faithman Ovat, Oluwatosin Olu-Abiodun (2019) Provider-Related
Predictors of Utilization of University Health Services in Nigeria. Ethiopian Journal of Health
Sciences March 2019 Volume 29 No.2
Peter Asaga Mac,Axel Kroeger, Philomena Ehi Airiohuodion (2019) Needs Assessment of
Emergency Medical and Rescue Services in Abuja/Nigeria and Environs.BMC Emergency
Medicine 2019
Palicy on Emergency Medical Services (EMS) In Nigeria March 2016. Federal Mimistry
Thomas C. G,and Jayanthila D. A. (2021) A Study and Overview of the Mobile App
Industry. International Journal of Applied Engineering and Management Letters
(EML),ISSN: 2581-7000, Vol. S, No.1,June 2021
https://nigerianfinder.com/ambulance-services-in-nigerial
https://www.premiumtimesng.com/news/top-news/454982-nigeria-to-introduce-
emergency-medical-ambulance-services-official.html.
https://punchng.com/nigeria-to-have-national-emergency-number/
https://www.scp-health.com/blog/top-10-emergency-medicine-mobile-apps/
https://www.statista.com/statistics/183849/internet-users-nigeria/
https://www.techopedia.com/definition/2953/mobile-application-mobile-app
https://www.worldbank.org/en/topic/tertiaryeducation
MAIN_PAGE
48
import hackage:firebase_core/firebase_core.darr;
final getX=GetStorage():
wid main()asyne{
WidgetsFlutterBinding.ensurelnitialized();
await Firebase.initializeAppO;
await GetStorage.init();
runApp(const MyApp());
Constants constants=Constants();
const MyApp({Key?key}):super(key:key);
@override
return MaterialApp(
title:'Unicare',
theme:ThemeData(
primarySwatch:Colors.orange,
debugShowCheckedModeBanner:false,
home:check());
Widget check(){
if(getX.read("is_first_time")!=nu
e")!=null)
else
return const SignUp();
sIGNUP_PAGE
import dart:io;
import package:cloud_firestore/eloud_firestore.dart;
import 'package:flutter/services.dart';
import'package:fluttertoast/fluttertoas.dart;
import 'package:unicare/main.dart';
import 'package:unicare/pages/bottomNavBar/bottomNavBar.dart';
@override
SignUpState createStatetate()=>_SignU
TextEditingController phoneNumberControlleller=TextEextEditingControlle();
bool isLoading=false;
@override
return Scaffold(
backgroundColor: Colors.white,
body:SafeArea(
child:ListView(
children:[
const SizedBox(
height:70,
).
const Align
alignment:Alignment.topCenter,
child:Text(
"Sign Up",
style:TextStyle(
color:Colors.black,
fontSize:35,
fontWeight:FontWeight.w700),
),
).
const SizedBox(
height:120,
Padding(
child:Card(
elevation:6,
shape:RoundedRectangleBorder(
borderRadius:BorderRadius.circular(10)),
child:TextField(
controller:nameController,
enabled:isLoading? false:true,
textCapitalization:TextCapitalization.words,
style:const TextStyle(
fontSize:18,fontWeight:FontWeight.w500),
decoration:const InputDecoration(
prefixlcon:Icon(Icons.person),
alignLabelWithHint:true,
labelText:'Name',
floatingLabelBehavior:FloatingLabelBehavior.never,
labelStyle:TextStyle(
fontSize:16,
fontWeight:FontWeight.w800,
color:Colors.grey).
border:InputBorder.none,
contentPadding: Edgelnsets.fromLTRB(10,0,10,15),
)).
).
).
const SizedBox(
height:30,
Padding(
padding:const Edgelnsets.symmetric(horizontal:20).
child:Card(
elevation:6,
shape:RoundedRectangleBorder(
borderRadius:BorderRadius.circular(10)).
child:TextField(
controller:phoneNumberController,
keyboardType:TextInputType.number,
inputFormatters:[LengthLimitingTextInputFormatter(11)].
enabled:isLoading?false:true,
style:const TextStyle(
fontSize:18,fontWeight:FontWeight.w500),
decoration:const InputDecoration(
alignLabelWithHint:true,
prefixlcon:Icon(Icons.call),
labelText:'Phone Number',
floatingLabelBehavior:FloatingLabelBchavior.never,
labelStyle:TextStyle(
fontSize:16,
fontWeight:FontWeight.w800,
color:Colors.grey).
bonder:InputBorder.none,
contentPadding:Edgelnsets.froLTRB(10,0,10,15),
)).
const SizedBox(
height:100,
).
Padding(
padding:const Edgelnsets.symmetric(horizontal:20).
child:SizedBox(
height:50,
//width:200,
child:ElevatedButton(
onPressed:isLoading
?null
:0(
if(nameController.text.isNotEmpty &&
phoneNumberController.text.isNotEmpty)
if(phoneNumberController.text.length!=11){
Fluttertoast.showToast(
gravity:ToastGravity.TOP,
backgroundColor: Colors.black87);
}else{
setState((){
isLoading=true;
1)
_signupO;
I else {
Fluttertoast.showToast(
textColor:Colors,white,
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
child:isLoading
?const SizedBox(
height:20,
width:20,
child:CircularProgressIndicator(
valueColor:AlwaysStoppedAnimation(Colors,white)))
:const Text(
"Sign Up",
style:TexStyle(
color:Colors.white,
fontSize:16,
fontWeight:FontWeight.w800),
).
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(
constants.primaryColor),
shape:MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius:BorderRadius.circular(10)))).
1.
signup0){
FirebascFirestore.instance
collection('users')
.doc(phoneNumberController.text)
set({
'name':nameController.text,
'phoneNumber':phoneNumberController.text,
).then((value){
getX.write("is_first_time",true);
getX.write("phone_number",phoneNumberController.tex1);
getX.write("name",nameController.text);
setState((){
nameController.clear();
phoneNumberController.clear();
isLoading=false;
ng=false;
Fluttertoast.showToast(
msg:"Registration completed",
textColor:Colors,white,
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
Navigator.push(
_)=>const
context, MaterialPageRoute(builder: (_) =>const BottomNavBar()));
)catchEmor((error)
setState((){
oading=false;
isLoading=false;
1)
if(error.erroris SocketException)(
Fluttertoast.showToast(
textColor:Colors,white,
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
//myWidgets.showToast(");
else{
Fluttertoast.showToast(
textColor:Colors.white,
backgroundColor:Colors.black87);
Fluttertoast.showToast(
textColor:Colors.white,
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
1);
HOME_PAGE
import package:flutter/material.dart';
import 'package:unicare/main.dart;
import 'package:unicare/pages/changeNumber/changeNumber.dart';
const HomePage((Key?key}):super(key:key):
@override
retum Scaffold(
backgroundColor:Colors,white,
appBar:AppBar(
backgroundColor:Colors.white,
elevation:0,
leading:IconButton(
onPressed:0{
Navigator.push(
context,MaterialPageRoute(builder:(=>const ChangeNumber()));
(=>const(
1,
icon:const Icon(Icons.person,size:30,)).
body:SafeArea(
child:ListView(
children:[
const SizedBox(
height:30,
Lottic.asset("assets/bellalert.json",height: 100,width:100),
const SizedBox(
height:20,
),
Column(
children:[
const Text(
"Medical Help",
style:TextStyle(
color:Colrs.black,
fontSize:35,
fontWeight:FontWeight.w700),
const Text(
"Needed?",
style: TextStyle(
color:Colors.black,
fontSize:35,
), fontWeight:FontWeight.w700),
const SizedBox(
height:30,
Text(
style:TextStyle(
color:constants.primaryColor,
fontSize:18,
fontWeight:FontWeight.w700),
1.
),
const SizedBox(
height:40,
Padding(
padding:const Edgelnsets.symmetric(horizontal:30),
child:Row(
mainAxisAlignment:MainAxisAlignment.spaceBetween,
children:[
Container(
height:40,
width:170,
decoration:BoxDecoration(
borderRadius: BorderRadius.circular(20),
color:constants.primaryColor),
child:const Center(
child:Text(
"Ugbowo Campus",
style:TextStyle(
color.Colors.white,
fontSize:18,
fontWeight:FontWeight.w700),
GestureDetector(
onTap:0
dialNumber(consants.ugbowoCampusNumber);
child;Container(
height:40,
width:40,
decoration:BoxDecoration(
shape:BoxShape.circle,
color:constants.primaryColor),
child:
const lcon(Icons.call,size:30,color:Colors.white),
),
1.
).
).
const SizedBox(
height:40,
).
Padding(
padding:const Edgelnsets.symmetric(horizontal:30).
child:Row(
mainAxisAlignment:MainAxisAlignment.spaceBetween,
children:[
Container(
height:40,
width:170,
decoration:BoxDecoration(
borderRadius: BorderRadius.circular(20),
color:constants.primaryColor),
child:const Center(
child:Text(
"Ekenwan Campus",
style:TextStyle(
color:Colors.white,
fontSize: 18,
), fontWeight:FontWeight.w700),
).
GestureDetector(
onTap:()(
dialNumber(constants,ckenwanCampusNumber);
child:Container(
height:40,
width:40,
decoration:BoxDecoration(
shape:BoxShape.circle,
color:constants.primaryColor),
child:
const Icon(Icons.call,size:30,color:Colors.white).
),
),
).
).
);
Future<void>dialNumber(String phoneNumber)asyne{
bool?res=await
FlutterPhoneDirectCaller.callNumber(phoneNumber);
REPORT_EMERGENCY PAGE
impuert package:fluttertoast/nuttertoast.darr';
ReportMessageState createState()c()=>_R_ReportMessageState();
TextEditingController reportController=TextEditingController();
e e ditingController phoneNumberController=TextEditingController();
TextEditingController locationController
TextEditingController();
bool isLoading=false;
g=false
@override
return Scaffold(
backgroundColor:Colors.white,
body:SafeArea(
child:ListView(
children:[
const SizedBox(
height:30,
),
Container(
height:70,
width:70,
decoration: BoxDecoration(
shape:BoxShape.circle,color;constants.primaryColor),
child:const lcon(Icons.message,size:45,color:Colors.white).
),
const SizedBox(
height:80,
),
Padding(
padding:const Edgelnsets.symmetricthorizontal:20).
child:Card(
elevation:6,
shape:RoundedRectangleBorder(
borderRadius:BorderRndius.circular(10)),
child:TextField(
controller:reportController,
maxLines:5,
enabled:isLoading ? false:true,
textCapitalization:TextCapitalization.sentences,
style:const TextStyle(
fontSize: 18,fontWeight:FontWeight.w500),
decoration:const InputDecoration(
alignLabelWithHint:true,
labelText:'What is the Emergency?.
floatingLabelBehavior:FloatingLabelBehavior.never,
labelStyle:TextStyle(
fontSize:16,
fontWeight:FontWeight.w800,
color:Colors.grey),
border:InputBorder.one,
contentPadding: Edgelnscts.fromLTRB(10,0,10,8),
)).
).
const SizedBox(
height:15,
Padding(
padding:const Edgelnsets.symmetric(horizontal:20),
child:Card(
elevation:6,
shape:RoundedRectangleBorder(
borderRadius:BorderRadius.circular(10)),
child:TextField(
maxLines:2,
controller:locationController,
enabled:isLoading? false:true,
style:const TextStyle(
fontSize:18,fontWeight:FontWeight.w500),
decoration:const InputDecoration(
alignLabelWithHint:true.
labelText:'Location',
nloatingLabelBehavior:FloatingLabelBchavior.never.
labelStyle:TxtStyle(
fontSize:16,
fontWeight:FontWeight.w800,
color.Colors.grey).
border:InputBorder.none,
contentPadding:EdgeInsets.fromLTRB(10,0,10,15),
)),
).
const SizedBox(
height:15,
Padding(
padding:const Edgelnsets.symmetric(horizontal:20),
child:Card(
elevation:6,
shape:RoundedRectangleBorder(
borderRadius:BorderRadius.circular(10)).
child:TextField(
//maxLines;5.
controller:phoneNumberController,
keyboardType:TextInputType.number,
inputFormatters:[LengthLimitingTextInputFormatter(11)],
enabled:isLoading?false:true,
style:const TextStyle(
decoration:const InputDecoration(
alignLabelWithHint:true,
labelText:'Phone Number(Optional),
nloatingLabelBehavior:FloatingLabelBehavior.never,
labelStyle:TextStyle(
fontSize:16,
fontWeight:FontWeight.w800,
color:Colors.grey),
border:InputBorder.none,
contentPadding: EdgeInsets.fromLTRB(10,0,10,15).
)),
).
).
const SizedBox(
height:30,
Center(
child:SizedBox(
height:40,
width:150,
child:ElevatedButton(
onPressed:isLoading
?null
:01
if(reportController.text.isNotEmpty &&
locationController.text.isNotEmpty)
iflphoneNumberController.text.isNoEmpty &&
phoneNumberController.text.length!=11)(
Fluttertoast.showToast(
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
Jelse{
setState(O){
isLoading=true;
));
submitReport();
)else(
Fluttertoast.show Toast(
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
child:isLoading
?const SizedBox(
height:20,
width:20.
child:CircularProgressIndicator
valueColor:AlwaysStoppedAnimation(Colors,white)))
:const Text(
"SEND REPORT",
style:TextStyle(
color.Colors.white,
fontSize: 16,
fom Weight:FontWeight.w800).
style:ButtonStylet
backgroundColor:MaterialStateProperty.all<Color>(
constants.primaryColor).
shape:MaterialStateProperty.all<RoundedRectangleBorder-(
RoundedRectangleBorder(
),
borderRadius:BorderRadius.circular(10))i).
1.
);
submitReport(){
FirebaseFirestore.instance.collection('reports').add(l
report_body:reportController.text,
'report_location':locationController.text,
'phoneNumber:
phoneNumberController.text.isNotEmpty?phoneNumberController.text:getX.read("ph
one_
'report_time':formatDateTime().
timestamp': FieldValue.serverTimestamp()
).then((value){
setState(0){
reportController.clear();
phoneNumberController.clear();
locationController.clear();
isLoading=false;
1);
showDialog(
context:context,
builder:(BuildContext context)(
return AlertDialog(
content:Column(
mainAxisSize:MainAxisSize.min,
children:[
const Texi(
style:TextStyle(
color:Colors.black87,
fontSize:16,
fontWeight:FontWeight.w400),
const Text(
style:TextStyle(
color: Colors.black87,
fontSize:16,
fontWeight:FontWeight.w400),
const SizedBox(height:20),
Container(
height:45,
width:45,
decoration:const BoxDecoration(
color:Colors,green,shape:BoxShape.circle),
child:const Center(
child:Icon(
lcons.check,
color:Colors.white,
)),
),
);
1);
)catchError((error)(
setState((){
isLoading=false;
1):
if(error.error is SocketException)(
Fluttertoast.showToast(
textColor:Colors.white,
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
//myWidgets.showToast(");
else{
Fluttertoast.show Toast(
textColor.Colors,white,
backgroundColor: Colors.black87);
Fluttertoast.show Toast(
msg:"Check your internet connection",
textColor.Colors,white,
gravity:TastGravity.TOP,
backgroundColor;Colors.black87);
String formatDateTime() (
//fomatting date
String dayday=DateTiateTime.now().day.toString();
String month=DateTime.now().month.toString();
gyear=DateateTime.now().year.toString();
//formatting time
ur24=DateTim「ime.now().hour;
String hour;
String minunute=DateteTime.now().minute.toString();
String noon;
f(hour24>12)(
hour=hour12.toString();
noon='PM';
else(
hour=hour24.toString();
print(hour24.toStriString());
noon='AM';
return('Sday/Smonth/Syear Shour.SminuteSnoon');
Botton_Navigation_Bar Page
import 'package:futter/material dart';
mpaut package:unicare/pages/message/messagef'age.darr;
@override
int currentnt_index=0;
eens=const[
HomePage().
ReportMessage()
setState((){
current_indexindex=value;
));
@override
return Scaffold(
body:screens[current_index],
bottomNavigationBar:BottomNavigationBar(
enableFeedback:false,
elevation:0,
backgroundColor:Colors.white,
type:BottomNavigationBarType.fixed,
currentIndex:current_index,
onTap:updateIndex,
unselectedltemColor:constants.secondaryColor,
selectedltemColor:constants.primaryColor,
items:[
BottomNavigationBarltem(
label:"",
icon:Container(
//height:40,
//width:120,
padding:const Edgelnsets.symmetric(horizontal:8,vertical:8).
decoration:BoxDecoration(
borderRadius:BorderRadius.circular(10),
color: current_index=0?constants.primaryColor:Colors.white
)。
child:Row(
mainAxisAlignment:MainAxisAlignment.center,
mainAxisSize:MainAxisSize.min,
children:[
Icon(Icons.home,color:current_index==0?Colors.white:constants.scco
const SizedBox(width:5.).
Text(
"HOME",
style:TextStyle(
fontSize:16,
color: current_index==0?Colors.white:constants.secondaryColor,
fontWeight:FontWeight.w800),
),
),
)),
BottomNavigationBarltem(
label:"",
icon:Container(
//height:45,
//width:140,
padding: const Edgelnsets.symmetric(horizontal: 8,vertical:8),
decoration:BoxDecoration(
borderRadius:BorderRadius.circular(10).
color:current_index==1?constants.primaryColor:Colors.white
child:Row(
mainAxisAlignment:MainAxisAlignment.center,
mainAxisSize:MainAxisSize.min,
children:[
Icon(lcons.message,color:current_index==
1?Colors.white:constants.secondaryColor),
Column(
crossAxisAlignment:CrossAxisAlignment.start,
mainAxisAlignment:MainAxisAlignment.center,
children:[
Text(
"REPORT",
style:TextStyle(
fontSize:16,
color:current_index==1?Colors,white:constants.secondaryColor,
), fontWeight:FontWeight.w800).
Text(
"EMERGENCY",
style:TextStyle(
fontSize:16,
color:current_index==1?Colors,white:constants.secondaryColor,
fontWeight:FontWeight.w800),
1.
import package:flutter/services.darr
mont yuckage:unicare/main.darr;
■overde
return Scaffold(
backgroundColor:Colors.white,
appBar:AppBar(
backgroundColor:Colors.white,
clevation:0,
).
body:SafeArea(
child:ListView(
children:[
const SizedBox(
height:40,
).
const Align(
alignment:Alignment.topCenter,
child:Text(
textAlign:TextAlign.center,
style:TextStyle(
color:Colors.black,
fontSize:35,
fontWeight:FontWeight.w700).
const SizedBox(
height:100,
Padding(
padding:const Edgelnsets.symmetric(horizontal:20),
child:Text(
"Current phone number:S(getX.read("phone_number")|",
style:const TextStyle(
//color:Colors.black,
fontSize:18,
fontWeight:FontWeight.w500),
),
),
const SizedBax(
height:10,
Padding(
padding:const Edgelnsets.symmetric(horizontal:20),
child:Card(
elevation:6,
shape:RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
child:TextField(
controller:phoneNumberController,
keyboardType:TextInputType.number,
inputFormatters:[LengthLimitingTextInputFormatter(11)],
enabled:isLoading?false:tue,
style:const TextStyle(
fontSize:18,fontWeight:FontWeight.w500),
decoration:const InputDecoration(
alignLabelWithHint:true,
prefixlcon:Icon(Icons.call),
labelText:'New Phone Number',
floatingLabelBehavior:FloatingLabelBehavior.never,
labelStyle:TextStyle(
fontSize:16,
fontWeight:FontWeight.w800,
color:Colors.grey),
border:InputBorder.none,
contentPadding:Edgelnsets.fromL.TRB(10,0,10,15).
)).
const SizedBox(
height:80,
Center(
child:SizedBox(
height:50,
width:150,
child:ElevatedButton(
onPressed:isLoading
?null
:01
if(phoneNumberController.text.isEmpty)
Fluttertoast.show Toast(
msg: "Phone number field must be filled",
textColor:Colors.white,
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
Jelse if(phoneNumberController.text.length!=11)(
Fluttertoast.showToast(
msg:"Phone number is incomplete",
textColor:Colors.white,
gravity:ToastGravity.TOP,
backgroundColor: Colors.black87);
Jelse if(phoneNumberController.textxt==getX.read.read("phone_numl
Fluttertoast.showToast(
msg:"New phone number is the same as the current one",
textColor:Colors.white,
gravity:ToastGravity.TOP,
backgroundColor: Colors.black87);
}else{
setState(()
isLoading-true;
1):
changeNumber();
child:isLoading
?const SizedBox(
height:20,
width:20,
child:CircularProgressIndicator(
valueColor:AlwaysStoppedAnimation(Colors.white)))
:const Text(
"Change Number",
style:TextStyle(
color:Colors.white,
fontSize:16,
fontWeight:FontWeight.w800),
),
style:ButtonStyle(
backgroundColor:MaterialStateProperty.all<Color>(
constants.primaryColor),
shape:MaterialStateProperty.all<RoundedRectangleBo
rder>(
RoundedRectangleBorder(
borderRadius:BorderRadius.circular(10)))),
),
),
),
);
changeNumber(){
FirebaseFirestore.instance
.collection('users')
.doc(phoneNumberController.text)
.set({
'name':getX.read("name"),
phoneNumber':phoneNumberController.text,
1).then((value)(
getX.write("phone_number",phoneNumberController.text);
setState((){
phoneNumberController.clear();
isLoading=false;
1)
Fluttertoast.showToast(
textColor:Colors.white,
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
Navigator.pop(context);
).catchError((error)(
setState((){
isLoading=false;
if(error.error is SocketException)(
Fluttertoast.showToast(
textColor: Colors,white,
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
//myWidgets.showToast(");
else{
Fluttertoast.showToast(
msg:"An Error Occured",
textColor:Colors.white,
backgroundColor: Colors.black87);
Fluttertoast.showToast(
gravity:ToastGravity.TOP,
backgroundColor:Colors.black87);
1);
CONSTANT_DECLARATION_PAGE
import package:flutter/material.dart;
class Constants {
String ekenwanCampusNumber=r="080