Simple app, which takes data from http:https://hapi.fhir.org/ API and parse them into list. The app uses the patients GET endpoint, to obtain the patient data.
For state management the app uses the flutter_bloc plugin. The UI is created based on the states evoked by events. Everything can be found in bloc_module. The parsing of the Json data is being done by autogenerated code from json_serializable and build_runner. Patient object is created by parsed data (id, name, birthDate, deceasedDateTime, gender and full url to the patient at the API). The data are used to fill the list view with examinations for CT. The date and type of examination are generated randomly for each patient. Only the patients for today's day are visible. The search bar also works and patients can be found by id or name. If there is no internet, the list is empty or error occurred, the error page with appropriate message is shown and button to retry.
- bloc_module
- bloc_module.dart - maps events and holds reference to client
- bloc_observer.dart - prints the events and states to console
- events.dart
- states.dart
- fhir - api related files
- json_types
- json_patient.dart - json template classes
- json_patient.g.dart - generated code for json parsing
- types
- examination.dart - object, with which the list view is filled
- patient.dart - holds all the patient's data
- api_client.dart - makes all the api calls and holds the data
- filtration.dart - functions, which filter the patients by conditions
- json_types
- res
- images.dart - paths to images
- strings.dart - all used strings
- widgets
- custom_widgets
- app_bar.dart
- search_bar.dart
- exams
- exam_list.dart - creation of the list for all the examinations
- exam_page.dart - merges the list, buttons and search bar
- exam_tab.dart - widget for examination
- error_page.dart - shows error and provides the button to retry
- main_page.dart
- custom_widgets
- main.dart
- theme.dart - custom theme + other constants used across the project
- stomach icon - iconfinder.com by Chanut-is
- Nunito Sans font - Google fonts
- build_runner - json code generation
- connectivity plus - for internet connection status
- flutter_bloc - for state management of the app
- flutter_lints - opinionated code conventions
- google_fonts - fonts theming
- http - HTTP requests for the fhir API
- intl - for time formatting
- json_serializable - json parsing
- sprintf - string formatting