afya_moja_core/afya_moja_core library

Classes

AudioContent
AudioPositionData
CarouselSlider
CheckBoxComponent
CommunityListItem
List items used within the coummunity page to show incoming messages.
Contact
Content
ContentCategory
ContentDetails
ContentDetailWidget
ContentItem
ContentItem Displays a feed item isNew renders the new tag
ContentMetadata
CreateNewPINWidget
CreateNewPINPage has two CustomTextField to create new user PIN
CustomConfirmDialog
CustomTextField
A wrapper for TextFormField that contains options for a field label.
DatePickerField
EditInformationDropDown
ExpandableQuestion
ExpandableQuestion
ExtraData
FAQContent
FAQsContentState
FeaturedMedia
FeedContent
FeedItems
GalleryImage
GalleryImageWidget
GenericErrorWidget
GenericErrorWidget is a generic used to purposefully communicate that the value of the data received from the API was null or it missed key properties that are of a valid response. Because of it;s generic natures, this widget handles the following types of error defined under GenericNoDataTypes enum
GroupMember
GroupMemberBadge
GroupMemberItem
HeroImage
IconDetails
InformationListCard
LeadingGraphicWidget
ListContentCategory
LoginCounterWidget
LoginErrorWidget
ManagedClient
ManagedClients
ManagedClientsResponse
Member
MemberListActionsDialog
MyAfyaHubCountryPicker
MyAfyaHubCountryPicker is used in MyAfyaHubPhoneLoginPage select Country Code
MyAfyaHubNoBorderButton
MyAfyaHubPhoneInput
MyAfyaHubPhoneInput is a shared widget to input user phone number and country code
MyAfyaHubPrimaryButton
Name
Name value object is a generic object that should be used to hold instances of names A use case would be firstName, or lastName or userName
NotificationActionInfo
NotificationActions
NotificationDetails
NotificationFilter
NotificationListItem
NotificationListItem Displays the notifications with Icons and a short description
OnboardingPathConfig
OnboardingScaffold
OnboardingScaffold a scaffold used during the onboarding process
OnboardingScaffoldHeader
OnboardingScaffoldHeader header on the onboarding scaffold
PhoneNumber
PINInputField
PINInputField is a shared widget to input authentication PIN
PINRequestScaffold
PlatformLoader
ProcessedResponse
A blueprint for the data returned after processing a response from an unauthenticated endpoint
ReactionItem
RecordSecurityQuestionResponse
RecordSecurityQuestionResponsesData
RespondedSecurityQuestionsData
ResponsiveWidget
Refer to https://gitlab.slade360emr.com/optimalhealth/healthcloud/-/merge_requests/355/diffs if you want to introduce medium screen in future Widget that draws depending on screen size as specified by the breakpoints.
Role
SearchWidget
SecurityQuestion
SecurityQuestionResponse
SecurityQuestionsData
SelectOptionField
SizeReportingWidget
UserProfileItem
UserProfileItem Displays the user profile item with Icons and a title
VerifyOTPInput
VerifyOTPInput is a shared widget to input authentication PIN
VerifySecurityQuestionData
WorkStationDetails

Properties

americanPhoneRegExp RegExp
final
current DateTime
final
currentDay int
final
currentMonth int
final
currentYear int
final
eligibleFutureYear int
final
eligibleYear DateTime
final
extremelyLargeVerticalSizedBox SizedBox
getter/setter pair
extremelySmallVerticalSizedBox SizedBox
vertical sized boxes
getter/setter pair
genericInternationalRegExp RegExp
final
kenyanPhoneRegExp RegExp
final
largeHorizontalSizedBox SizedBox
getter/setter pair
largeVerticalSizedBox SizedBox
getter/setter pair
mediumHorizontalSizedBox SizedBox
getter/setter pair
mediumVerticalSizedBox SizedBox
getter/setter pair
oldestYear int
final
size100VerticalSizedBox SizedBox
getter/setter pair
size120VerticalSizedBox SizedBox
getter/setter pair
size15HorizontalSizedBox SizedBox
getter/setter pair
size15VerticalSizedBox SizedBox
getter/setter pair
size40VerticalSizedBox SizedBox
getter/setter pair
size70VerticalSizedBox SizedBox
getter/setter pair
smallHorizontalSizedBox SizedBox
getter/setter pair
smallVerticalSizedBox SizedBox
getter/setter pair
unitedKingdomRegExp RegExp
final
validPrefixes List<String>
final
veryLargeHorizontalSizedBox SizedBox
getter/setter pair
veryLargeVerticalSizedBox SizedBox
getter/setter pair
verySmallHorizontalSizedBox SizedBox
getter/setter pair
verySmallVerticalSizedBox SizedBox
getter/setter pair

Functions

alignLabelWithHint(int? maxLines) bool
audioTime(int duration) String
Converts a duration in seconds to a formatted audio time representation.
boldSize12Text([Color? color]) TextStyle
boldSize13Text([Color? color]) TextStyle
boldSize14Text([Color? color]) TextStyle
boldSize15Text([Color? color]) TextStyle
boldSize16Text([Color? color]) TextStyle
boldSize18Text([Color? color]) TextStyle
boldSize20Text([Color? color]) TextStyle
boldSize22Text([Color? color]) TextStyle
boldSize24Text([Color? color]) TextStyle
boldSize26Title([Color? color]) TextStyle
boldSize30Text([Color? color]) TextStyle
boldSize45Text([Color? color]) TextStyle
cccNumberValidator(dynamic val) String?
Validates a user-entered CCC number.
consentStatusFromJson(String? consentString) ConsentStatus
Converts a consent status string to a ConsentStatus enumeration value.
consentStatusToJson(ConsentStatus? consentStatus) String
Converts a ConsentStatus enumeration value to a consent status string for JSON serialization.
contactTypeFromJson(String? contactString) ContactType
Converts a contact type string to a ContactType enumeration value.
contentAudioVideoDuration(int duration) String
contentReadDuration(int duration) String
customRoundedPinBoxDecoration(Color borderColor, Color pinBoxColor, {double borderWidth = 1.0, double? radius, bool showShadow = false}) BoxDecoration
dayOfWeekFromJson(String? dayOfWeek) DayOfWeek
dismissSnackBar(String text, Color color, BuildContext context) SnackBarAction
Dismiss snackbar
extractErrorCode(Map<String, dynamic>? body) int
Extracts an error code from a JSON response body.
extractNamesInitials({required String name}) String
extractNamesInitials => Extracts name initials from a name
formatDate(String date, {bool showTime = false}) String
Formats a given date/time string into a user-friendly date representation.
formatPhoneNumber({required String countryCode, required String phoneNumber}) String
Formats a phone number by adding the country code and applying specific rules.
genderFromJson(String? genderString) Gender
Converts a JSON gender string to a corresponding Gender enumeration.
genderToJson(Gender? gender) String
Converts a Gender enumeration to a JSON string representation.
genericFetchFunction({required StreamController streamController, required BuildContext context, required String queryString, required Map<String, dynamic> variables, required String logTitle, String? logDescription}) Future<void>
Generic Fetch Function a generic fetch function for fetching all the problems, allergies medications, tests and diagnoses for the current patient in an episode
getDeviceType(BuildContext context) DeviceScreensType
getDeviceType /// Determines the type of device screen based on its width and orientation.
getErrorMessage([String message = '']) String
Retrieves an error message based on an optional custom message.
getGreetingMessage(String? firstName, {int? currentHour}) String
getGreetingMessage gets the current time of day and determines which type of greetings to show to the user
getSentryEnvironment(AppConfig appConfig) String
getTokenExpiryTimestamp(String? expiresIn) DateTime
expiresIn is in seconds
getUserFriendlyMsg(int code) String
Retrieves a user-friendly error message based on an error code.
hasTokenExpired(DateTime expiresAt, DateTime now) bool
Checks if token has expired based on expiry date returns true if token expires in 10 minutes or less otherwise returns false
headsUpNotification(String? title, String? body) → OverlaySupportEntry
Displays a heads-up notification overlay.
heavySize10Text([Color? color]) TextStyle
heavySize11Text([Color? color]) TextStyle
heavySize12Text([Color? color]) TextStyle
heavySize13Text([Color? color]) TextStyle
heavySize14Text([Color? color]) TextStyle
heavySize16Text([Color? color]) TextStyle
heavySize18Text([Color? color]) TextStyle
heavySize20Text([Color? color]) TextStyle
heavySize24Text([Color? color]) TextStyle
heavySize26Text([Color? color]) TextStyle
heavySize28Text([Color? color]) TextStyle
heavySize50Text([Color? color]) TextStyle
humanizeDate({required TextStyle dateTextStyle, required String loadedDate, bool showTime = false, bool showYear = true}) Widget
isNumeric(String? s) bool
isValidPhoneNumber(String phone) bool
isValidPhoneNumber checks if a number is either a Kenyan , American, UK or Belgium phone number
lightSize16Text([Color? color]) TextStyle
mapDayOfWeek(int weekday) DayOfWeek
mediumSize14Text([Color? color]) TextStyle
mediumSize20Text([Color? color]) TextStyle
mediumSize22Text([Color? color]) TextStyle
mediumSize24Text([Color? color]) TextStyle
newChatMessageTitle(String? username, String? channelName) String
Generates a title for a new chat message notification.
normalSize10Text([Color? color]) TextStyle
normalSize11Text([Color? color]) TextStyle
normalSize12Text([Color? color]) TextStyle
normalSize13Text([Color? color]) TextStyle
normalSize14Text([Color? color]) TextStyle
normalSize15Text([Color? color]) TextStyle
normalSize16Text([Color? color]) TextStyle
normalSize17Text([Color? color]) TextStyle
normalSize18Text([Color? color]) TextStyle
normalSize20Text([Color? color]) TextStyle
normalSize22Text([Color? color]) TextStyle
normalSize24Text([Color? color]) TextStyle
normalSize26Text([Color? color]) TextStyle
normalSize28Text([Color? color]) TextStyle
normalSize32Text([Color? color]) TextStyle
normalSize34Text([Color? color]) TextStyle
normalSize9Text([Color? color]) TextStyle
parseError(Map<String, dynamic>? body) String?
Parses an error message from a JSON response body.
processHttpResponse(Response response) ProcessedResponse
Processes an HTTP response and returns a ProcessedResponse object.
removeUnderscores(String sentence) String
removeUnderscores removes underscores from a sentence
roleValueFromJson(String? roleString) RoleValue
Converts a JSON role string to a corresponding RoleValue enumeration.
snackbar({required dynamic content, int durationSeconds = 10, String? label, Function? callback}) SnackBar
snackbar
summarizeDate(String loadedDate) String
Summarizes a given date/time string into a human-readable format.
titleCase(String sentence) String
titleCase returns a title cased sentence
userPinValidator(dynamic val) String?
This function performs validation on a user-entered PIN value. It ensures that the PIN is not empty, consists of only digits, and has a minimum length of four. The function returns an error message string if the validation fails, otherwise it returns null to indicate a valid PIN.
validateKenyanNumber(String phone) bool
validateKenyanNumber checks if a number is either has either prefix of '+254111', '+254110', '+254100', '+2540101', '+254102' or '+2547xx'
validatePhoneNumber(String input) → Either<ValueObjectFailure<String>, String>
veryBoldSize14Text([Color? color]) TextStyle
veryBoldSize15Text([Color? color]) TextStyle
veryBoldSize16Text([Color? color]) TextStyle
veryBoldSize17Text([Color? color]) TextStyle
veryBoldSize18Text([Color? color]) TextStyle
veryBoldSize20Text([Color? color]) TextStyle
veryBoldSize22Text([Color? color]) TextStyle
veryBoldSize28Text([Color? color]) TextStyle
veryBoldSize32Text([Color? color]) TextStyle
veryHeavySize12Text([Color? color]) TextStyle
veryHeavySize14Text([Color? color]) TextStyle
veryHeavySize20Text([Color? color]) TextStyle

Exceptions / Errors

MyAfyaException
A custom exception class for application errors.