nokken/docs/docs/core/utilities.md
2025-04-20 11:17:03 -04:00

1.1 KiB

Utilities

Nokken includes several utility classes that provide shared functionality:

DateTimeFormatter

Provides methods for consistent date and time formatting throughout the app.

Features

  • Date formatting with special handling for today/yesterday/tomorrow
  • Time formatting and parsing between different formats
  • Day of week formatting
  • Medication-specific time-related formatting
  • Time icon selection based on time of day

GetIconsColors

Functions for returning appropriate Icon/Color for medication/appointment types.

Features

  • Icon selection based on medication type
  • Color selection based on medication type
  • Combined icon and color selection for consistent UI
  • Icon selection for appointment types

GetLabels

Functions for returning appropriate text labels for medication/appointment types.

Features

  • Text descriptions for medication types and subtypes
  • Text for injection subtypes
  • Formatted dosage text based on medication type
  • Text for medication status (taken/not taken)
  • Text for appointment types

List Extensions

Additional functionality for lists, currently only the firstWhereOrNull method.