Release Maintained Release

bewell_pro_core

# bewell_pro_core is a home for BeWell Professional's base package. It's one among many other open source libraries and applications that make up the wider ecosystem of software made and open sourced by Savannah Informatics Limited.

Installation Instructions

Use this package as a library by depending on it

Run this command:

  • With Flutter:
$flutter pub add bewell_pro_core

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  bewell_pro_core: ^1.1.21-nullsafety

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Lastly:

Import it like so:

import 'package:bewell_pro_core/landing_page.dart';

Dart & Flutter Version

  • Dart: 2 >= 2.12
  • Flutter: >=2.2.3

How to setup and run unit, widget and integration tests locally

Unit Tests

To run unit and widget tests, you will require to install lcov by running sudo apt-get install lcov in the terminal. Finally, run the following commands in the terminal:

  1. From the root folder, run flutter test --coverage test/

  2. Run genhtml -o coverage coverage/lcov.info

  3. To view the coverage, open the html file generated at coverage/index.html with your preferred browser.

Pull request commit messages convention

Our convention for a good commit message consists of a header, a body and a footer.

Message header

The message header is a single line that contains short and clear description of the change.

The following are message header examples that describe the kind of change that a commit is providing.

  • feat (feature)
  • fix (bug fix)
  • docs (documentation)
  • style (formatting, missing semi colons, …)
  • refactor
  • test (when adding missing tests)
  • chore (maintain)

Header subject

This is a very short description of the change.

  • use imperative, present tense: “change” not “changed” nor “changes”
  • don't capitalize first letter
  • no dot (.) at the end

Example of a good commit header

docs: healthcloud commit message convention

Message body

Separated with the Message Header by a line break, the message body contains paragraphs of changes. Follow below conventions.

  • use imperative, present tense: “change” not “changed” nor “changes”
  • includes motivation for the change and contrasts with previous behavior
  • don't capitalize first letter
  • no dot (.) at the end

The footer should contain any information about Breaking Changes which should start with the word BREAKING CHANGE: with a space or two newlines. The rest of the commit message is then the description of the change, justification and migration notes. It is also the place to reference GitLab issues that this commit Closes.

BREAKING CHANGE: isolate scope bindings definition has changed and
    the inject option for the directive controller injection was removed.

Closes #392

Example of a good commit message

docs: add healthcloud convention to readme

Couple of typos fixed:
- indentation
- syntax highlighting
- start periodic checking
- missing brace

Closes #03

NOTE

  1. The commit message header can be used in solitary with a clear subject on issues with elementary changes.
  2. To close an issue automatically include the footer with a reference to the GitLab issue as demonstrated above.

Packages import

Packages imported in every dart file follow this order;

1 . Dart imports
2 . Flutter imports
3 . Third-party packages
4 . Our own packages
5 . Relative files

All the imports MUST be separated by a blank line. See example below. A good example, using the lib/features/login/pages/login_page.dart file

// flutter package imports
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';

// third party imports
import 'package:redux/redux.dart';

// Be.Well Pro imports
import 'package:bewell_pro_core/presentation/login/redux/models/login_viewmodel.dart';
import 'package:bewell_pro_core/presentation/login/widgets/login_page_content.dart';
import 'package:bewell_pro_core/redux/models/core_state.dart';

Libraries

add_allergy_drawer
add_blood_pressure_drawer
add_bmi_reading_drawer
add_diagnosis_drawer
add_episode_action
add_medication_drawer
add_next_of_kin
add_next_of_kin_form_manager
add_oxygen_saturation_drawer
add_problem_drawer
add_pulse_reading_drawer
add_respiratory_rate_drawer
add_temperature_reading_drawer
add_test_drawer
address
address_type_enum
address_use_enum
allergy
allergy_intolerance_category
allergy_intolerance_criticality
allergy_intolerance_reaction
allergy_intolerance_reaction_severity_enum
allergy_intolerance_relay_connection
allergy_intolerance_relay_edge
allergy_intolerance_type
allergy_item
annotation
app_contexts
app_drawer
app_drawer_items
app_scaffold
app_string_constants
app_widget_keys
application_failures
asset_strings
attachment
basic_details
basic_details_form_manager
batch_update_misc_state_action
batch_update_user_state_action
bewell_custom_timeline_painter
bewell_patient_profile_connector
bewell_patient_profile_page
bewell_patient_profile_view_model_factory
bewell_patient_profile_widget
bewell_patient_timeline
bewell_patient_timeline_logic
bewell_patient_view_model
bewell_primary_patient_banner
bewell_secondary_patient_banner
bewell_secondary_patient_banner_logic
bewell_select_input
bewell_submit_dialog
bewell_table_header
bewell_table_header_value
bewell_table_title_action
bewell_vital_card
bottom_navigation_bar_items
bottom_navigation_item
break_glass_episode_creation_input
camera_selection_dialog
change_pin
change_pin_wrapper
change_user_pin_action
chief_complaint
chief_complaint_item_large
chief_complaint_item_small
chief_complaint_zero_state
circular_background_icons
clinical_state
codeable_concept
coding
colors
coming_soon_page
common_behavior_object
communication
communication_settings
communication_settings_viewmodel
complete_button
complete_registration_connector
complete_registration_page
complete_registration_view_model
complete_registration_view_model_factory
complete_registration_widget
composition_edge
composition_edge_relay
concepts
condition
condition_edge
condition_item
confirm_survey_page
connectivity_changed_action
connectivity_check_action
connectivity_state
contact_point
contact_point_system_enum
contact_point_use_enum
contact_view_model
continue_visit_action
core_errors_state
core_state
core_state_view_model
countdown_timer_widget
current_episode
decoded_system
default_error_route
document_camera_selector
domain_constants
dosage
drawer_app_bar
drawer_bottom_bar
drawer_header
drawer_help_widget
drawer_save_button
drawer_search_input
drawer_search_results
drawer_selected_item
drawer_utils
edit_profile_form
edit_profile_page
email_input
empty_tasks
end_exam_action
end_visit_dialogue_content
enter_signup_phone_number
enums
episode_of_care_status_enum
episodeofcare_diagnosis
episodeofcare_status_history
error_alert_box
event_object
event_state
events
exam_allergies_table
exam_composition
exam_item_add_button
exception_strings
extra_information
faq_card
faq_content
faq_detail_view_page
faq_list_action
faq_wrapper
feed_component_wrapper
feed_content_callbacks
fetch_user_feed_action
fhir
flags
form_styles
gender_picker
general_systems_exam_widget
generic_empty_data_widget
generic_exception
generic_timeout_widget
generic_zero_state
guide_box
help_center_channels
help_center_page
helpers
helpers
history_form_input
home_page
html_wrapper
human_name
human_name_use_enum
i_connectivity_facade
id_documents
identification_details
identifier
identifier_use_enum
image_source_icon
increment_user_visit_count_action
input_validators
ios_constants
landing_actions
landing_page
landing_page_image
large_device_divider
large_device_reading
load_more_timeline_records
loading_shimmer
login_constants
logout_action
medication
medication_edge
medication_item
medication_item_large_screen
medication_item_small_screen
medication_prescription_form
medication_request_dispense
medication_request_initial_fill
medication_request_substitution
medication_search_result_container
misc_state
misc_state_view_model
mutations
name_field
name_input
narrative
narrative_status
next_of_kin
next_of_kin_data_validator
next_of_kin_form_manager
next_of_kin_result_card
next_tile_button
nhif
no_next_of_kin_found
no_results_found
numbers_constants
observation_item
onboarding
onboarding_path_config
onboarding_scaffold
otp_box
otp_box_connector
otp_box_view_model
otp_box_view_model_factory
OTP_episode_creation_input
otp_response
outputs
page_info
patient
patient_allergy_summary_widget
patient_banner_bio_info
patient_banner_view_model
patient_connection
patient_contact
patient_diagnosis_table
patient_diagnosis_tabs
patient_exam
patient_exam_active_title_icon
patient_exam_card_title
patient_exam_column_title
patient_exam_diagnosis
patient_exam_done_title_icon
patient_exam_inactive_title_icon
patient_exam_item_large
patient_exam_medications
patient_exam_problems
patient_exam_review
patient_exam_row_data_text
patient_exam_selected
patient_exam_sub_title_card_title
patient_exam_summary
patient_exam_test_item_small
patient_exam_tests
patient_exam_tiles
patient_exam_titles
patient_exam_utils
patient_examination
patient_gender_enum
patient_history
patient_history_form
patient_history_wrapper
patient_payload
patient_payload_helper
patient_photo
patient_profile_view_model
patient_records_empty
patient_registration
patient_registration_container
patient_registration_helper
patient_registration_image_data
patient_registration_step_manager
patient_registration_steps
patient_search_action
patient_search_card_connector
patient_search_card_factory
patient_search_card_info
patient_search_card_viewModel
patient_search_card_widget
patient_search_connector
patient_search_factory
patient_search_page
patient_search_viewModel
patient_search_widget
patient_test_zero_state
patient_timeline_divider_widget
patient_timeline_record
patient_vital
payload_input
period
permissions_banner
phone_login
phone_login_action
phone_login_page
phone_number_field
phone_number_form_manager
phone_number_input
phone_signup
phone_signup_action
phone_signup_page
photo_input
pin_verification_page
post_visit_survey_page
previous_tile_button
problem_allergy_summary
processed_response
profile_contact_details
profile_detail
profile_drop_down
profile_item_builder
profile_master_detail
profile_page_items
profile_utils
queries
quick_access_item
quick_access_item_modal
quick_access_item_widget
range
rating
recover_pin
recover_pin_request_page
reference
refresh_token_action
request_pin_reset_action
resend_otp
resend_otp_action
reset_pin_page
result_not_found
retire_composition_button
retire_helper
review_of_system_definition
review_of_system_title_bar
review_of_systems
review_of_systems_form_builder
review_of_systems_item_widget
review_systems_base
router_generator
routes
save_event_action
save_patient_record_action
save_review_of_systems_button
save_user_feed_action
search_guide
search_result
search_suggestion
search_widget
secondary_banner_allergies
secondary_banner_conditions
secondary_banner_medication
secondary_banner_zero_experience
send_event_action
send_otp_action
service_request
service_request_item
session_timeout
set_and_confirm_pin_widget
set_pin_page
set_user_names_page
sign_off_exam
signup_with_phone_number_action
sil_app_bar
sil_bottom_navigation_bar
sil_custom_error_widget
sil_custom_exceptions
simple_next_of_kin_input
simple_patient_registration_input
start_cont_visit_factory
start_cont_visit_view_model
start_cont_visit_widget
start_continue_exam_banner
start_continue_visit_connector
start_or_continue_exam_wrapper
start_visit_connector
start_visit_dialog_widget
start_visit_emergency_action
start_visit_factory
start_visit_page
start_visit_request_access_action
start_visit_status
start_visit_type_enum
start_visit_viewModel
start_visit_widget
step_item
summary_action
summary_exam_button
summary_medications
summary_tests
summary_utils
symptom_widget
system_enums
text_field_label
text_or_html
timeline_widget
type_defs
unrecoverable_error_widget
update_navigation_action
update_patient_found_action
update_patient_search_action
update_search_param_action
update_start_visit_type_action
update_state_contacts_action
update_supplier_profile_action
update_user_names_action
update_user_pin_action
user_feed_state
user_names_form
user_profile_page
user_registration_action
user_registration_state
user_state
user_state_view_model
validator_mixin
verify_phone_dialog
verify_phone_dialog_status
verify_pin
verify_pin_action
verify_reset_pin_request_page
verity_phone_number
vertical_spacer
vital_constants
vital_legend_column
vital_not_recorded_indicator
vitals