SERVICES
AstroApiService 13 methods astro_api_service.dart
Service for communicating with AstroMatrix API Now fully uses NetworkService for consistency.
Uses Models
Methods
fetchCityLocations()
Future<List<LocationSuggestion>>
Fetch city location suggestions from AstroMatrix or Google Places API. Summary: Retrieves a list of possible birth location suggestions matching the provided query string. Uses Google Places Autocomplete API when useGoogleAPI is true, otherwise uses AstroMatrix API.
Returns
Future<List<LocationSuggestion>> A Future that completes with a list of LocationSuggestion objects.
Returns: LocationSuggestion
API Endpoints
https://astromatrix.org/API/Utility/GetBirthLocationshttps://maps.googleapis.com/maps/api/place/autocomplete/json
Throws
- Exception when NetworkService returns a non-success result (result.success == false).
Side Effects
Performs network I/O via NetworkService.get.
_fetchCityLocationsFromAstroMatrix()
Future<List<LocationSuggestion>>
Fetch city locations from AstroMatrix API (default implementation)
_fetchCityLocationsFromGoogle()
Future<List<LocationSuggestion>>
Fetch city locations from Google Places Autocomplete API
fetchCityInfo()
Future<Map<String, dynamic>>
Fetch detailed city information from AstroMatrix or Google Places Details API. Summary: Requests detailed metadata for a given town name (e.g., coordinates, timezone hints). Uses Google Places Details API when useGoogleAPI is true, otherwise uses AstroMatrix API.
Parameters
| Name | Type | Description |
|---|---|---|
town |
String | The town name to fetch details for (should be URL-encoded). |
Returns
Future<Map<String, dynamic>> A Future that completes with the raw JSON map containing at least lat/lng.
API Endpoints
https://astromatrix.org/API/Utility/GetBirthCityInfohttps://maps.googleapis.com/maps/api/geocode/json
Throws
- Exception when NetworkService returns a non-success result (result.success == false).
Side Effects
Performs network I/O via NetworkService.get.
_fetchCityInfoFromAstroMatrix()
Future<Map<String, dynamic>>
Fetch city info from AstroMatrix API (default implementation)
_fetchCityInfoFromGoogle()
Future<Map<String, dynamic>>
Fetch city info from Google Geocoding API
Parameters
| Name | Type | Description |
|---|---|---|
town |
String |
fetchTimezone()
Future<Map<String, dynamic>>
Fetch timezone data from Google Timezone API or TimeZoneDB. Summary: Retrieves timezone information for a given geographic coordinate and timestamp. The implementation selects between Google Timezone API and TimeZoneDB based on the `useGoogleAPI` flag.
Returns
Future<Map<String, dynamic>> A Future that completes with the timezone details returned by the chosen service.
API Endpoints
https://maps.googleapis.com/maps/api/timezone/jsonhttps://vip.timezonedb.com/v2/get-time-zone
Throws
- Exception when NetworkService returns a non-success result (result.success == false).
Side Effects
Performs network I/O via NetworkService.get; constructs absolute URL strings.
getPlanetPositions()
Future<List<Map<String, dynamic>>>
Get planet positions for ephemeris table (month view). Summary: Fetches daily planet positions for a given month and year. Returns positions for all planets (inner and outer) at midnight UTC for each day of the month.
Returns
Future<List<Map<String, dynamic>>> A Future that completes with a list of planet position objects.
API Endpoints
https://astromatrix.org/API/Astrology/GetPlanetPositions
Throws
- Exception when NetworkService returns a non-success result (result.success == false).
Side Effects
Performs network I/O via NetworkService.get.
calculateChart()
Future<Map<String, dynamic>>
Calculate chart positions by sending chart payload to the CalcPositions endpoint. Summary: Sends a ChartPayload to the astrology calculation endpoint and returns the computed chart data.
Parameters
| Name | Type | Description |
|---|---|---|
payload |
ChartPayload | ChartPayload model containing birth data and calculation options. It will be serialized via payload.toJson(). |
Returns
Future<Map<String, dynamic>> A Future that completes with computed chart positions, including planets, houses, and other computation results.
API Endpoints
https://astromatrix.org/API/Astrology/CalcPositions
Throws
- Exception when NetworkService returns a non-success result (result.success == false).
Side Effects
Performs network I/O via NetworkService.post; serializes payload via toJson().
reverseGeocode()
Future<String>
Reverse geocode coordinates to get formatted address/town name
Parameters
| Name | Type | Description |
|---|---|---|
lat |
double | |
lng |
double |
calculateHoroscopes()
Future<List<Map<String, dynamic>>>
Calculate horoscopes based on provided chart data. Summary: Sends computed chart data to the horoscope calculation endpoint to generate horoscope text/entries.
Returns
Future<Map<String, dynamic>> A Future that completes with horoscope data (sections, texts, localized strings).
API Endpoints
https://astromatrix.org/API/Astrology/CalculateHoroscopes
Throws
- Exception when NetworkService returns a non-success result (result.success == false).
Side Effects
Performs network I/O via NetworkService.post.
generateReport()
Future<Map<String, dynamic>>
Generate AI-based report for a given chart. Summary: Sends a chart payload and desired report type to the AI report endpoint and returns the generated report content.
Returns
Future<Map<String, dynamic>> A Future that completes with the AI-generated report data (likely includes sections, summary text, and metadata).
API Endpoints
https://club.astromatrix.org/ai/calculatereport
Throws
- Exception when NetworkService returns a non-success result (result.success == false).
Side Effects
Performs network I/O via NetworkService.post; may return large textual content.
dispose()
void
Dispose resources used by the AstroApiService. Summary: Placeholder for cleanup logic. Currently a no-op but provided for lifecycle parity.
Returns
void
Side Effects
Intended to release resources, cancel subscriptions, or dispose controllers if added in future.
Used By Services
- HoroscopeService.ensureInitialized() horoscope_service.dart
DeepLinkService 5 methods deep_link_service_stub.dart
Web stub for DeepLinkService - Deep linking handled differently on web Web uses standard URLs, no need for app-specific deep link handling
Methods
initialize()
Future<void>
Initialize deep link service (no-op on web)
isInitial()
Future<void>
Handle deep link (no-op on web)
Parameters
| Name | Type | Description |
|---|---|---|
url |
String | |
isInitial |
bool |
removeAffiliateCode()
Future<void>
Remove affiliate code
updateUserInfo()
void
Update user info
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String? | |
deviceInfoId |
String? |
dispose()
void
Dispose (no-op on web)
DeviceService 7 methods device_service_mobile.dart
Singleton service that provides device identifier, platform, and timezone information.
Methods
_instance()
factory
Returns the singleton instance of [DeviceService].
Returns
The shared [DeviceService] instance.
initialize()
Future<void>
Initialize device information by fetching the device ID and platform.
Returns
A [Future] that completes when initialization finishes.
Side Effects
Sets [_deviceId] and [_platform].
_getDeviceId()
Future<String?>
Determines and caches the device ID based on the current platform.
Returns
A [Future] that completes with the device ID or null.
Side Effects
Updates [_deviceId].
_getIosVendorId()
Future<String>
Retrieves the iOS vendor identifier using device_info_plus. Returns a fallback string on failure.
Returns
A [Future] resolving to the iOS vendor ID or a fallback message.
_getAndroidId()
Future<String>
Retrieves the Android ID using the android_id plugin. Returns a fallback string on failure.
Returns
A [Future] resolving to the Android ID or a fallback message.
_getPlatform()
String
Returns a normalized platform name for the current OS.
Returns
One of: "android", "ios", "fuchsia", "linux", "macos", "windows", or "unknown".
getTimezoneInfo()
Map<String, dynamic>
Returns timezone information containing the timezone name and offset in minutes. The `timeZoneOffset` value is the negated offset in minutes from UTC.
Returns
A map with keys 'timeZoneName' and 'timeZoneOffset' (int minutes).
DeviceService 5 methods device_service_stub.dart
Singleton service that provides device identifier, platform, and timezone information. WEB VERSION: Provides web-compatible implementations.
Methods
_instance()
factory
Returns the singleton instance of [DeviceService].
Returns
The shared [DeviceService] instance.
initialize()
Future<void>
Initialize device information by setting platform and generating device ID.
Returns
A [Future] that completes when initialization finishes.
Side Effects
Sets [_deviceId] and [_platform].
_getDeviceId()
String
Generates a web-compatible device identifier. Uses a simple random ID for web sessions.
Returns
A generated device ID string.
_getPlatform()
String
Returns "web" as the platform name.
Returns
The string "web".
getTimezoneInfo()
Map<String, dynamic>
Returns timezone information containing the timezone name and offset in minutes. The `timeZoneOffset` value is the negated offset in minutes from UTC.
Returns
A map with keys 'timeZoneName' and 'timeZoneOffset' (int minutes).
GPTBackend 6 methods gpt_service.dart
=============================================================== BACKEND PROVIDER INTERFACE ===============================================================
Uses Models
Uses Services
Methods
use()
static void
Allow backend override for testing or alternative implementations
Parameters
| Name | Type | Description |
|---|---|---|
backend |
GPTBackend |
prompt()
static Future<GPTResult>
Generate a completion from a simple text prompt
ask()
static Future<GPTResult>
Helper method for quick questions with default settings
Parameters
| Name | Type | Description |
|---|---|---|
question |
String |
temperature()
static Future<GPTResult>
Helper method for creative content generation
Parameters
| Name | Type | Description |
|---|---|---|
prompt |
String | |
temperature |
double |
analyze()
static Future<GPTResult>
Helper method for analytical/factual responses
Parameters
| Name | Type | Description |
|---|---|---|
prompt |
String |
translate()
static Future<GPTResult>
Translate text from one language to another If fromLanguage is null, auto-detects source language
Used By Services
- GPTBackend.use() gpt_service.dart
- RemoteGPTBackend.use() gpt_service.dart
- GPTService.use() gpt_service.dart
RemoteGPTBackend 6 methods gpt_service.dart
=============================================================== REMOTE BACKEND – calls Node.js GPT endpoint ===============================================================
Uses Models
Uses Services
Methods
use()
static void
Allow backend override for testing or alternative implementations
Parameters
| Name | Type | Description |
|---|---|---|
backend |
GPTBackend |
prompt()
static Future<GPTResult>
Generate a completion from a simple text prompt
ask()
static Future<GPTResult>
Helper method for quick questions with default settings
Parameters
| Name | Type | Description |
|---|---|---|
question |
String |
temperature()
static Future<GPTResult>
Helper method for creative content generation
Parameters
| Name | Type | Description |
|---|---|---|
prompt |
String | |
temperature |
double |
analyze()
static Future<GPTResult>
Helper method for analytical/factual responses
Parameters
| Name | Type | Description |
|---|---|---|
prompt |
String |
translate()
static Future<GPTResult>
Translate text from one language to another If fromLanguage is null, auto-detects source language
GPTService 6 methods gpt_service.dart
=============================================================== GPT SERVICE – Main service interface ===============================================================
Uses Models
Uses Services
Methods
use()
static void
Allow backend override for testing or alternative implementations
Parameters
| Name | Type | Description |
|---|---|---|
backend |
GPTBackend |
prompt()
static Future<GPTResult>
Generate a completion from a simple text prompt
ask()
static Future<GPTResult>
Helper method for quick questions with default settings
Parameters
| Name | Type | Description |
|---|---|---|
question |
String |
temperature()
static Future<GPTResult>
Helper method for creative content generation
Parameters
| Name | Type | Description |
|---|---|---|
prompt |
String | |
temperature |
double |
analyze()
static Future<GPTResult>
Helper method for analytical/factual responses
Parameters
| Name | Type | Description |
|---|---|---|
prompt |
String |
translate()
static Future<GPTResult>
Translate text from one language to another If fromLanguage is null, auto-detects source language
JsonStorageService 29 methods json_storage_service_mobile.dart
=============================================================== JSON STORAGE SERVICE - Generic local storage with invalidation ===============================================================
Fields
| Name | Type |
|---|---|
defaultExpiry |
Duration? |
Methods
file-level()
static int?
=============================================================== CACHE EXPIRY HELPERS ===============================================================
Parameters
| Name | Type | Description |
|---|---|---|
expiresIn |
Duration |
file-level()
static int?
Calculate expiry timestamp from duration Returns null if duration is null (no expiry)
Parameters
| Name | Type | Description |
|---|---|---|
expiresIn |
Duration |
_isExpired()
static bool
Check if a record is expired
Parameters
| Name | Type | Description |
|---|---|---|
expiresAt |
int? |
createRecordWithExpiry()
Future<void>
=============================================================== ADVANCED EXPIRY METHODS (for granular control) ===============================================================
createRecordWithExpiry()
Future<void>
Create record with specific expiry (bypasses defaultExpiry)
updateRecordAndRefreshExpiry()
Future<void>
Update record and refresh its expiry time
getRecords()
Future<List<Map<String, dynamic>>>
=============================================================== STANDARD CRUD METHODS ===============================================================
getRecords()
Future<List<Map<String, dynamic>>>
Get all records for a parent key
getRecord()
Future<Map<String, dynamic>?>
Get single record by ID
createRecord()
Future<void>
Create a new record Uses JsonStorageService.defaultExpiry for cache expiry (null = never expires)
updateRecord()
Future<void>
Update existing record Keeps existing expiry unless record is new/recreated
deleteRecord()
Future<void>
Delete record (soft delete - marks as deleted)
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String | |
recordId |
String |
invalidateParent()
Future<void>
=============================================================== INVALIDATION METHODS ===============================================================
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String | |
parentKey |
String |
invalidateParent()
Future<void>
Invalidate all records for a specific parent key Example: When user's birth data changes, invalidate all their charts
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String | |
parentKey |
String |
invalidateRecord()
Future<void>
Invalidate specific record by ID Example: Invalidate a single chart
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String | |
recordId |
String |
invalidateNamespace()
Future<void>
Invalidate all records in a namespace Use sparingly! Only for logout or complete refresh
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String |
invalidateOlderThan()
Future<void>
Invalidate records older than a certain age Example: Delete transits older than 30 days
invalidateExpired()
Future<int>
Invalidate (soft delete) expired records Returns the count of records invalidated
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String? |
getUnsyncedRecords()
Future<List<Map<String, dynamic>>>
=============================================================== SYNC METHODS ===============================================================
getUnsyncedRecords()
Future<List<Map<String, dynamic>>>
Get unsynced records for background sync
markSynced()
Future<void>
Mark record as synced (optionally replace local ID with server ID)
syncFromServer()
Future<void>
OPTIMIZED: Sync records from server using batch operations This prevents database locks by using transactions Uses JsonStorageService.defaultExpiry for cache expiry
cleanupSyncedDeletions()
Future<void>
=============================================================== CLEANUP METHODS ===============================================================
cleanupSyncedDeletions()
Future<void>
Hard delete synced deletions (cleanup after successful sync)
cleanupExpired()
Future<int>
Hard delete expired records (cleanup) Returns the count of records deleted
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String? |
clearNamespace()
Future<void>
Clear all records for a namespace (hard delete)
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String |
clearAll()
Future<void>
Clear all data (for testing or logout)
getStats()
Future<Map<String, dynamic>>
=============================================================== STATISTICS & DEBUGGING ===============================================================
getStats()
Future<Map<String, dynamic>>
Get statistics for debugging
JsonStorageService 3 methods json_storage_service_stub.dart
=============================================================== JSON STORAGE SERVICE - WEB STUB (Using SharedPreferences) ===============================================================
Fields
| Name | Type |
|---|---|
defaultExpiry |
Duration? |
Methods
file-level()
static int?
=============================================================== CACHE EXPIRY HELPERS ===============================================================
Parameters
| Name | Type | Description |
|---|---|---|
expiresIn |
Duration |
_buildKey()
String
=============================================================== STANDARD CRUD METHODS ===============================================================
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String | |
recordId |
String |
count()
Future<int>
Deletes the oldest records in a namespace based on created_at timestamp
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String? | |
count |
int |
LanguageService 26 methods language_service.dart
Singleton service that manages the app's current language, persists the preference, and loads remote translation tables for runtime lookups. **Caching Strategy:** - Translations are cached in memory (_languageItems) for fast synchronous lookups - Translations are also persisted to local storage for offline access and faster app startup - Cache is checked first, API is only called if cache is missing or stale (>7 days old) - getLang() never calls the API - it only reads from cached memory map This service is reactive - widgets can listen to language changes using: 1. **ListenableBuilder** (recommended): ```dart ListenableBuilder( listenable: LanguageService(), builder: (context, child) => Text(getLang('Settings')), ) ``` 2. **ReactiveLanguage widget** (convenience wrapper): ```dart ReactiveLanguage( builder: (context) => Text(getLang('Settings')), ) ``` 3. **AnimatedBuilder**: ```dart AnimatedBuilder( animation: LanguageService(), builder: (context, child) => Text(getLang('Settings')), ) ``` **Important**: Without a listener, widgets using getLang() won't update automatically when language changes. The user would need to restart the app.
Fields
| Name | Type |
|---|---|
_gptTranslationCache |
Map<String, Map<String, String>> |
_translatingKeys |
Map<String, Set<String>> |
_skipTranslationSet |
Set<String> |
translationUpdated |
ValueNotifier<int> |
Methods
_instance()
factory
Returns the singleton instance of [LanguageService].
init()
Future<void>
Initializes the service by loading the saved language from persistent storage and ensuring the corresponding translation table is available.
Throws
- Never throws - all errors are caught and logged, service continues with defaults.
Side Effects
Reads from PreferenceService (which syncs with server) and may trigger network fetch.
setLanguage()
Future<void>
Sets the active language, persists it, and reloads the translation table.
Parameters
| Name | Type | Description |
|---|---|---|
language |
String | language code to switch to. |
Side Effects
Updates PreferenceService (which syncs to server/WebView), resets cached state, fetches translations from the network, and notifies all listeners to rebuild UI.
_ensureLanguageLoaded()
Future<void>
Ensures the translation table for the current language is loaded; no-op if already available.
Side Effects
May call [updateLanguageTable] which alters internal state. First checks local cache, only fetches from API if cache is missing or stale.
updateLanguageTable()
Future<void>
Fetches the language table for the current language from the remote API and caches it for synchronous lookups; does nothing for English.
Returns
Future that completes when the fetch and caching finish.
Side Effects
Updates internal cache [_languageItems] and [_downloadedLanguage], and persists to local storage for future use.
_loadFromCache()
Future<Map<String, String>?>
Loads translation table from local storage cache.
Returns
Map of translations or null if cache is missing/expired.
_saveToCache()
Future<void>
Saves translation table to local storage cache.
clearCache()
Future<void>
Clears the cache for a specific language or all languages.
_loadSkipList()
Future<void>
Loads the skip list from persistent storage. Called during initialization to restore previously saved skip list.
_saveSkipList()
Future<void>
Saves the skip list to persistent storage. Called automatically whenever the skip list is modified.
_shouldSkipTranslation()
bool
Checks if a text should be skipped from translation. Returns true if the text matches patterns that indicate it shouldn't be translated (e.g., dates, numbers, URLs, emails, names, etc.)
Parameters
| Name | Type | Description |
|---|---|---|
text |
String |
addToSkipList()
Future<void>
Adds a string to the skip list so it will never be translated. Useful for names, proper nouns, or other content that should remain unchanged. The skip list is automatically persisted to storage.
Parameters
| Name | Type | Description |
|---|---|---|
text |
String |
addToSkipListBatch()
Future<void>
Adds multiple strings to the skip list. The skip list is automatically persisted to storage.
Parameters
| Name | Type | Description |
|---|---|---|
texts |
List<String> |
removeFromSkipList()
Future<void>
Removes a string from the skip list. The skip list is automatically persisted to storage.
Parameters
| Name | Type | Description |
|---|---|---|
text |
String |
clearSkipList()
Future<void>
Clears the entire skip list. The skip list is automatically persisted to storage.
getLang()
String
Returns a translated string for [name] using the cached language table or the original text if no translation exists. If translation is missing, triggers a background GPT translation that will be available on next call. Supports simple transformation modes via [type] ('split' to translate each space-separated token, 'time' to translate only the first token). **Performance Note:** This method NEVER calls the API. It only reads from the in-memory cache (_languageItems). The cache is: - Loaded from local storage on app startup (fast) - Fetched from API only if cache is missing or stale (>7 days) - Updated in memory and persisted to storage after API fetch You can call getLang() thousands of times per second with zero API calls.
Parameters
| Name | Type | Description |
|---|---|---|
name |
String | the source text key to translate. |
Returns
translated string or original [name] when translation not found.
_translateInBackground()
void
Triggers a background GPT translation without blocking. Uses debouncing and batching to optimize API calls.
Parameters
| Name | Type | Description |
|---|---|---|
text |
String |
_processTranslationQueue()
Future<void>
Processes the translation queue by batching all pending strings into one API call. Respects rate limiting to prevent API overload.
_performBatchGPTTranslation()
Future<void>
Performs batch GPT translation for multiple strings in one API call. This is much more efficient than individual calls.
Parameters
| Name | Type | Description |
|---|---|---|
texts |
List<String> |
_createBatchTranslationPrompt()
String
Creates a batch translation prompt that GPT can process. Format: "Translate these English strings to [Language]. Return JSON format: {\"string1\": \"translation1\", \"string2\": \"translation2\"}"
_parseBatchTranslationResponse()
List<String?>
Parses the batch translation response from GPT. Expects JSON format: {"original": "translation", ...} Handles various response formats GPT might return.
_fallbackIndividualTranslations()
Future<void>
Fallback: Translate strings individually if batch fails. Only used as last resort.
_performGPTTranslation()
Future<void>
Performs the actual GPT translation and caches the result. @deprecated Use _performBatchGPTTranslation instead for better performance.
Parameters
| Name | Type | Description |
|---|---|---|
text |
String |
clearGPTCache()
void
Clears the GPT translation cache for the current language
cancelPendingTranslations()
void
Cancels any pending translation requests and clears the queue. Useful when language changes to prevent stale translations.
getLang()
String
Global convenience that delegates to the singleton [LanguageService] for a synchronous translation lookup. Automatically triggers background GPT translation for missing keys.
Parameters
| Name | Type | Description |
|---|---|---|
text |
String | source text key to translate. |
Returns
translated text or original when not available (yet).
LoggingService 10 methods logging_service.dart
Service responsible for sending logs and metrics to the backend systems. This is a singleton logging layer for AstroMatrix that centralizes sending error/info/debug logs and metric events to configured backend endpoints.
Fields
| Name | Type |
|---|---|
_instance |
final LoggingService |
Uses Models
Uses Services
Methods
_instance()
factory
Factory that returns the singleton [LoggingService] instance.
Returns
The shared [LoggingService] singleton.
logError()
Future<void>
Sends an error or info log to the Node API or base API depending on `useNode`. Short summary: constructs a payload with uid, message, info, platform and timestamp and POSTs it to the logging endpoint.
Returns
Future<void> Completes when the network request finishes.
Throws
- May throw exceptions from [NetworkService.post] or JSON encoding operations.
Side Effects
Performs network I/O and may print debug logs.
logInfo()
Future<void>
Convenience helper that logs an informational message. Calls [logError] with "INFO: " prefixed to the message.
Returns
Future<void> Completes after delegating to [logError].
Throws
- Same exceptions as [logError]
Side Effects
Performs network I/O via [logError].
logDebug()
void
Prints a debug-only message to the console when in debug mode. Short summary: outputs a debug-only message using `debugPrint` when `kDebugMode` is true. Does not perform network I/O.
Parameters
| Name | Type | Description |
|---|---|---|
message |
String | The debug message to print |
Returns
void
Side Effects
Prints to console via `debugPrint` when `kDebugMode` is enabled.
logAdError()
static Future<void>
Static helper to log ad-specific errors under the 'ads' user/category.
Parameters
| Name | Type | Description |
|---|---|---|
message |
String | The ad-related error message to send |
data |
Map<String, dynamic>? | Optional map of additional contextual data to include |
Returns
Future<void> Completes when the log has been posted.
Throws
- Exceptions from underlying [logError] / [NetworkService.post]
Side Effects
Network I/O via [logError].
logAdInfo()
static Future<void>
Static helper to log ad-specific informational messages under the 'ads' category.
Parameters
| Name | Type | Description |
|---|---|---|
message |
String | The ad-related informational message |
data |
Map<String, dynamic>? | Optional contextual data to include |
Returns
Future<void> Completes when the log has been posted.
Throws
- Exceptions from underlying [logInfo] / [NetworkService.post]
Side Effects
Network I/O via [logInfo].
logAdDebug()
static void
Debug-only ad logging that prints JSON-encoded data when in debug mode.
Parameters
| Name | Type | Description |
|---|---|---|
message |
String | The debug message to print |
data |
Map<String, dynamic>? | Optional map of contextual data that will be JSON-encoded for printing |
Returns
void
Side Effects
Prints to console via `debugPrint` when `kDebugMode` is enabled.
logEvent()
Future<void>
Logs a metric event with name, type, value, and optional labels to the metrics endpoint. Short summary: builds an event payload and POSTs it to the metrics update endpoint.
Returns
Future<void> Completes after the network request finishes.
Throws
- May throw exceptions from [NetworkService.post] or encoding operations.
Side Effects
Performs network I/O and may print debug logs.
logCounter()
Future<void>
Convenience method for logging counter metrics (delegates to [logEvent]).
Returns
Future<void> Completes after delegating to [logEvent].
Throws
- Exceptions from [logEvent]
Side Effects
Network I/O via [logEvent].
logGauge()
Future<void>
Convenience method for logging gauge metrics (delegates to [logEvent]).
Returns
Future<void> Completes after delegating to [logEvent].
Throws
- Exceptions from [logEvent]
Side Effects
Network I/O via [logEvent].
Used By Services
- LoggingService logging_service.dart
- AdsService ads_service.dart
PayloadService 13 methods payload_service.dart
Service responsible for building chart payloads from various data sources. Centralizes all payload construction logic that was previously scattered across HoroscopeService. Converts user profiles, forms, and dates into properly formatted ChartPayload objects for API calls. This is a stateless utility service - all methods are static.
Uses Models
Methods
_getHouseSystemName()
static String
Get house system display name from code
Parameters
| Name | Type | Description |
|---|---|---|
code |
String |
buildFromUser()
static ChartPayload
Build payload from UserProfile(s) for self or relationship charts Parameters: - user1: Primary user (required) - prefs: Chart calculation preferences (house system, orbs, etc.) - chartType: Type of chart ('self', 'relationship', 'birthchart', etc.) - user2: Secondary user for relationship charts (optional) - transitDate: Date for transit calculations (optional) - transitLocation: Location for transit calculations (optional) - relocationLat, relocationLng, relocationTown: For relocation charts (optional) Returns: ChartPayload ready for API submission
_buildRelocationDate2()
static ChartDate
Build date2 for relocation charts: location-only (lat, lng, town). The API uses date1 for birth moment (planets) and date2 for relocation location (houses/angles).
buildFromForm()
static ChartPayload
Build payload from BirthForm for chart creation/preview Used when creating a new user or previewing a chart from form data before saving the user profile. Parameters: - form: Birth form data (name, date, time) - location: Birth location data - prefs: Chart calculation preferences - transitDate: Optional transit date - transitLocation: Optional transit location Returns: ChartPayload ready for API submission
buildCurrentPlanets()
static ChartPayload
Build payload for current planets (no birth data required) Shows current planetary positions without reference to a birth chart. Parameters: - prefs: Chart calculation preferences - date: Date/time for planet positions (defaults to now) - location: Location for calculations (optional) Returns: ChartPayload for current planets
userToChartDate()
static ChartDate
Convert UserProfile to ChartDate format for API payload Extracts all necessary birth data from user profile and formats it according to API requirements. Uses web-compatible format for fullDateStr. Optional location overrides allow changing location without modifying the user profile (useful for relocation charts).
_userToChartDateForDate2()
static ChartDate
Convert UserProfile to ChartDate format for date2 (minimal fields like web) Web's date2 doesn't include: type, timeHour, timeMinute, timePM, dst, mainUser, selectedTown
Parameters
| Name | Type | Description |
|---|---|---|
user |
UserProfile |
_buildFullDateStr()
static String
Build fullDateStr in web-compatible format Format: "January 11th 2000 5:00 PM" (note: double space before year)
Parameters
| Name | Type | Description |
|---|---|---|
month |
int | |
day |
int | |
year |
int | |
time |
String |
_formToChartDate()
static ChartDate
Convert BirthForm + Location to ChartDate format for API payload Parses form data (YYYY-MM-DD date format, various time formats) and combines with location data to create complete ChartDate.
buildTransitDate()
static ChartDate
Build transit date ChartDate from DateTime and optional Location Used for transit charts, current planets, progressed charts, etc. Uses 24-hour time format for transit dates.
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | |
location |
Location |
_buildFullDateStrForTransit()
static String
Build fullDateStr for transit date in web-compatible format Format: "December 24th 2025 12:09" (note: double space before year, 24h time)
Parameters
| Name | Type | Description |
|---|---|---|
month |
int | |
day |
int | |
year |
int | |
time |
String |
_getTypeName()
static String
Get human-readable type name for chart type
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
String |
_getPath()
static String
Get API path for chart type
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
String |
ChartPreferences 13 methods payload_service.dart
Holds chart calculation preferences loaded from PreferenceService. The orb value is pre-selected based on chart type. This is a simple data class used by PayloadService to configure chart calculations (house system, sidereal mode, orbs, etc.)
Uses Models
Methods
_getHouseSystemName()
static String
Get house system display name from code
Parameters
| Name | Type | Description |
|---|---|---|
code |
String |
buildFromUser()
static ChartPayload
Build payload from UserProfile(s) for self or relationship charts Parameters: - user1: Primary user (required) - prefs: Chart calculation preferences (house system, orbs, etc.) - chartType: Type of chart ('self', 'relationship', 'birthchart', etc.) - user2: Secondary user for relationship charts (optional) - transitDate: Date for transit calculations (optional) - transitLocation: Location for transit calculations (optional) - relocationLat, relocationLng, relocationTown: For relocation charts (optional) Returns: ChartPayload ready for API submission
_buildRelocationDate2()
static ChartDate
Build date2 for relocation charts: location-only (lat, lng, town). The API uses date1 for birth moment (planets) and date2 for relocation location (houses/angles).
buildFromForm()
static ChartPayload
Build payload from BirthForm for chart creation/preview Used when creating a new user or previewing a chart from form data before saving the user profile. Parameters: - form: Birth form data (name, date, time) - location: Birth location data - prefs: Chart calculation preferences - transitDate: Optional transit date - transitLocation: Optional transit location Returns: ChartPayload ready for API submission
buildCurrentPlanets()
static ChartPayload
Build payload for current planets (no birth data required) Shows current planetary positions without reference to a birth chart. Parameters: - prefs: Chart calculation preferences - date: Date/time for planet positions (defaults to now) - location: Location for calculations (optional) Returns: ChartPayload for current planets
userToChartDate()
static ChartDate
Convert UserProfile to ChartDate format for API payload Extracts all necessary birth data from user profile and formats it according to API requirements. Uses web-compatible format for fullDateStr. Optional location overrides allow changing location without modifying the user profile (useful for relocation charts).
_userToChartDateForDate2()
static ChartDate
Convert UserProfile to ChartDate format for date2 (minimal fields like web) Web's date2 doesn't include: type, timeHour, timeMinute, timePM, dst, mainUser, selectedTown
Parameters
| Name | Type | Description |
|---|---|---|
user |
UserProfile |
_buildFullDateStr()
static String
Build fullDateStr in web-compatible format Format: "January 11th 2000 5:00 PM" (note: double space before year)
Parameters
| Name | Type | Description |
|---|---|---|
month |
int | |
day |
int | |
year |
int | |
time |
String |
_formToChartDate()
static ChartDate
Convert BirthForm + Location to ChartDate format for API payload Parses form data (YYYY-MM-DD date format, various time formats) and combines with location data to create complete ChartDate.
buildTransitDate()
static ChartDate
Build transit date ChartDate from DateTime and optional Location Used for transit charts, current planets, progressed charts, etc. Uses 24-hour time format for transit dates.
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | |
location |
Location |
_buildFullDateStrForTransit()
static String
Build fullDateStr for transit date in web-compatible format Format: "December 24th 2025 12:09" (note: double space before year, 24h time)
Parameters
| Name | Type | Description |
|---|---|---|
month |
int | |
day |
int | |
year |
int | |
time |
String |
_getTypeName()
static String
Get human-readable type name for chart type
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
String |
_getPath()
static String
Get API path for chart type
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
String |
Used By Services
- HoroscopeService._loadPreferences() horoscope_service.dart
PreferenceService 18 methods preferences_service.dart
=============================================================== PREFERENCE SYNC SERVICE - FIXED WITH TYPE NORMALIZATION ===============================================================
Methods
file-level()
static String?
Get the active user's profile ID. Uses HoroscopeService.user1 (currently selected user) if available, falls back to the main user's profileID from storage.
initializeDefaults()
static Future<void>
Initialize all preferences with defaults on first app start
_upsertPreferences()
static Future<void>
Upsert preferences (merge incoming with existing)
setPreferenceLanguage()
static Future<void>
Set preference that works even when not logged in (mainly for language)
setPreference()
static Future<void>
Save preference locally and sync to server
_syncToWebView()
static Future<void>
Sync preference to WebView
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
value |
dynamic |
_notifyListeners()
static void
Notify listeners that a preference changed Replaces aggressive cache invalidation
Parameters
| Name | Type | Description |
|---|---|---|
key |
String |
_invalidateCacheIfNeeded()
static Future<void>
Invalidate chart cache if preference affects chart calculations DEPRECATED: Now handled via preferenceChanges stream and constraint-based keys
Parameters
| Name | Type | Description |
|---|---|---|
key |
String |
getSyncablePreferences()
static Future<Map<String, dynamic>>
Get all preferences for current user
_getAllPreferences()
static Future<Map<String, dynamic>>
Get all preferences for current user
deletePreference()
static Future<void>
Delete a specific preference
Parameters
| Name | Type | Description |
|---|---|---|
key |
String |
syncFromServer()
static Future<void>
Sync from server FIXED: Uses ApiResult properties
syncUnsynced()
static Future<void>
Force sync unsynced preferences to server
setPreferences()
static Future<void>
Bulk update multiple preferences
clearAllPreferences()
static Future<void>
Clear all preferences for current user
exportPreferencesAsJson()
static Future<String>
Export all preferences as JSON
importPreferencesFromJson()
static Future<void>
Import preferences from JSON
Parameters
| Name | Type | Description |
|---|---|---|
json |
String |
_normalizeToType()
static dynamic
Normalize raw value to expected type Handles legacy cases where server has "true", "6.0", "1" as strings
Parameters
| Name | Type | Description |
|---|---|---|
raw |
dynamic | |
t |
Type |
SocketService 4 methods socket_service.dart
Provides a Socket.IO client connection to the backend and helpers to send and receive chat-related events.
Methods
initSocket()
void
Initializes and connects the socket to the server and registers the given user.
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String | The identifier for the current user that will be sent to the server. |
Side Effects
Opens a network connection, sets up connect/disconnect/error handlers, and emits a register event.
sendMessage()
void
Emits a `new_message` event with the provided payload to the server.
Parameters
| Name | Type | Description |
|---|---|---|
message |
Map<String, dynamic> | The message payload to send. |
Side Effects
Sends a network event to the socket server.
onMessageReceived()
void
Registers a callback for incoming `message_received` events from the server.
dispose()
void
Disconnects the socket and releases network resources.
Side Effects
Closes the socket connection.
StorageService 0 methods storage_service_mobile.dart
====================================================================== STORAGE SERVICE (SINGLETON) ======================================================================
Methods
StorageService 0 methods storage_service_stub.dart
====================================================================== STORAGE SERVICE (SINGLETON) - WEB VERSION ======================================================================
Methods
AdsService 19 methods ads_service.dart
Singleton service that manages loading, displaying, retry logic, and error logging for ads.
Fields
| Name | Type |
|---|---|
_loggingService |
LoggingService |
maxRetries |
const int |
retryDelay |
const Duration |
Uses Models
Uses Services
Methods
_instance()
factory
Factory constructor returning the singleton AdsService instance.
initialize()
Future<void>
Initialize the ads service This should be called before any ads are displayed. For paid users, ads are disabled immediately without any flicker.
refreshAdStatus()
Future<void>
Refreshes ad status based on comprehensive subscription info
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
_loadAdsState()
Future<void>
Load ads state from SharedPreferences
setForceHide()
void
Temporarily force hide or show ads (e.g., during splash screen).
Parameters
| Name | Type | Description |
|---|---|---|
value |
bool |
setAdsEnabled()
Future<void>
Enable or disable ads
Parameters
| Name | Type | Description |
|---|---|---|
enabled |
bool | Whether ads should be enabled; persists the choice. |
Side Effects
Updates persistence and disposes ads when disabling.
hideAds()
Future<void>
Hide all ads (called when user subscribes)
Side Effects
Disposes all ad objects, disables ads, and ungates content.
_disposeAllAds()
void
Dispose all ad objects
loadPersistentBannerAd()
Future<void>
Load persistent global banner ad
loadBannerAd()
Future<void>
Load and show banner ad (Legacy/Local)
Side Effects
Creates a BannerAd instance and updates internal state; may retry on failure.
loadAndShowInterstitialAd()
Future<void>
Load and show interstitial ad
Side Effects
Loads an interstitial and shows it immediately on success; retries on failure.
loadRewardedInterstitialAd()
Future<void>
Load rewarded interstitial ad
Side Effects
Loads a rewarded interstitial, handles frequency caps, and retries on failure.
showRewardedInterstitialAd()
Future<void>
Show rewarded interstitial ad
Side Effects
Displays the rewarded ad, handles full-screen callbacks, and grants reward callbacks.
shouldShowAd()
bool
Check if ads should be shown based on web app request
Parameters
| Name | Type | Description |
|---|---|---|
webAppRequest |
bool |
Returns
true if the caller requested an ad and ads are enabled.
updateUserInfo()
void
Update user info
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String? | Optional user identifier for logging. |
deviceInfoId |
String? | Optional device identifier for logging. |
handleLoadAdError()
Future<void>
Log error to server
handleLoadAdError()
Future<void>
Handle load ad error
Side Effects
Sends a JSON-encoded error payload to the logging service.
handleShowAdError()
Future<void>
Handle show ad error
Side Effects
Sends a JSON-encoded error payload to the logging service.
dispose()
void
Dispose all resources
Side Effects
Disposes current ad instances and clears callback references.
AnalyticsService 5 methods analytics_service.dart
Service that provides helpers for logging events to Firebase Analytics.
Methods
logScreenView()
Future<void>
Logs a screen view safely.
Parameters
| Name | Type | Description |
|---|---|---|
screenName |
required String |
logMainUserMissing()
Future<void>
Logs when main user (profileID) is missing but users exist
logMainUserInvalid()
Future<void>
Logs when main user (profileID) is invalid (doesn't match any user)
logMainUserAutoSet()
Future<void>
Logs when main user is successfully auto-set
logMainUserValidation()
Future<void>
Logs main user validation check results
AppReviewService 7 methods app_review_service.dart
Service to manage app review prompts with session-based logic Logic: - Shows after 3 sessions, 1 minute after app start - "Remind me later" resets counter, shows again after 3 more sessions - "Already reviewed" never shows again - Disabled on Flutter web Testing: - Set `forceShowForTesting = true` to bypass all conditions
Fields
| Name | Type |
|---|---|
forceShowForTesting |
bool |
Methods
incrementSessionCount()
Future<void>
Call this on app start to increment session count
shouldShowReviewPrompt()
Future<bool>
Check if we should show the review prompt Returns true if conditions are met
scheduleReviewPrompt()
Future<void>
Schedule the review prompt to show after delay
handleRateNow()
Future<void>
User chose to rate now - open the store
handleRemindLater()
Future<void>
User chose "Remind me later" - reset counter
handleAlreadyReviewed()
Future<void>
User chose "Already reviewed" - never show again
resetReviewState()
Future<void>
Reset all review state (for testing)
Used By Widgets
- MyApp main.dart
BirthValidationService 5 methods birth_validation_service.dart
Service for validating birth information and orchestrating chart calculations.
Uses Models
Methods
validateBirthInfo()
Future<BirthValidationResult>
Validates birth information by calculating a chart and extracting the Big Three. Uses ChartService.calculatePositionsForForm() which doesn't require a UserProfile.
Returns
A [BirthValidationResult] containing success state and extracted data or an error message.
Returns: BirthValidationResult
isFormComplete()
bool
Quickly checks whether the provided form and location appear complete for submission.
validateBirthDate()
bool
Validates an ISO-8601 date string for birth date constraints.
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String |
validateBirthTime()
bool
Validates a time string in HH:mm format.
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String |
validateForm()
bool
Validates the overall birth form for required fields.
Parameters
| Name | Type | Description |
|---|---|---|
form |
BirthForm |
CategoryItemsService 4 methods category_items_service.dart
Service for fetching category items Generic service used by tarot, houses, and other category-based views
Uses Models
Uses Services
Methods
useCache()
Future<List<CategoryItem>>
Get items for a category Used by ItemCategoryCtrl equivalent in Flutter Now with 14-day caching for improved performance
Parameters
| Name | Type | Description |
|---|---|---|
category |
String | |
useCache |
bool |
_getFromCache()
Future<List<CategoryItem>?>
Get items from cache
Parameters
| Name | Type | Description |
|---|---|---|
key |
String |
_addToCache()
Future<void>
Add items to cache with 14-day expiry
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
items |
CategoryItem |
clearCache()
Future<void>
Clear all cached category items
CategoryItem 4 methods category_items_service.dart
Category item model
Uses Models
Uses Services
Methods
useCache()
Future<List<CategoryItem>>
Get items for a category Used by ItemCategoryCtrl equivalent in Flutter Now with 14-day caching for improved performance
Parameters
| Name | Type | Description |
|---|---|---|
category |
String | |
useCache |
bool |
_getFromCache()
Future<List<CategoryItem>?>
Get items from cache
Parameters
| Name | Type | Description |
|---|---|---|
key |
String |
_addToCache()
Future<void>
Add items to cache with 14-day expiry
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
items |
CategoryItem |
clearCache()
Future<void>
Clear all cached category items
Used By Services
- CategoryItemsService.useCache() category_items_service.dart
- CategoryItemsService._getFromCache() category_items_service.dart
- CategoryItemsService._addToCache() category_items_service.dart
- CategoryItem.useCache() category_items_service.dart
- CategoryItem._getFromCache() category_items_service.dart
- CategoryItem._addToCache() category_items_service.dart
ChartRenderingService 6 methods chart_rendering_service.dart
Persistent chart rendering service
Uses Models
Methods
initialize()
static Future<void>
Initialize once on app start
renderChart()
static Future<Uint8List>
Render a single chart
renderPatterns()
static Future<Map<int, Uint8List>>
Render multiple pattern charts
_buildPatternConfig()
static ChartRenderConfig
Build pattern config - MATCHES NORMAL CHARTS
_buildPatternData()
static Map<String, dynamic>
Build pattern astro data
Parameters
| Name | Type | Description |
|---|---|---|
formation |
Map<String, dynamic> |
_generateDefaultHouses()
static List<Map<String, dynamic>>
Generate default houses
ChartService 29 methods chart_service.dart
Service for transforming raw chart data into display-ready format. This is a PURE transformation layer - no calculations, no API calls. Just takes ChartResult and formats it for widgets.
Uses Models
Methods
getChartTypeLabel()
static String
Get display label for a chart type Uses the displayName getter from ChartType enum
Parameters
| Name | Type | Description |
|---|---|---|
type |
ChartType |
buildRenderConfig()
static ChartRenderConfig
Build chart render config from chart type and screen size
getDisplayPlanets()
static List<Map<String, dynamic>>
Transform raw chart result into display-ready planet data [coordDisplayFormat] 'decimals' (e.g. 15.5°) or 'degrees_minutes' (e.g. 15°30')
getTransitPlanets()
static List<Map<String, dynamic>>
Transform transit planets with display data [coordDisplayFormat] 'decimals' or 'degrees_minutes'
getDisplayHouses()
static List<Map<String, dynamic>>
Transform houses with display data
Parameters
| Name | Type | Description |
|---|---|---|
result |
ChartResult |
getAspectGrid()
static List<List<Map<String, dynamic>>>
Build aspect grid for display (full matrix) Builds from transitData array to match Angular structure: planets[i].aspects[j] = { Aspect, Orb, Item }
getAspectGrid10()
static List<List<Map<String, dynamic>>>
Get aspect grid for first 10 planets only (for compact display)
getAsteroidAspectGrid()
static List<List<Map<String, dynamic>>>
Get aspect grid for asteroids with specific horizontal/vertical layout Columns (horizontal): Asteroids only (Lilith through Psyche) Rows (vertical): All planets + asteroids (Sun through Psyche) This allows asteroid-to-planet aspects (e.g. Chiron conjunct Sun) to appear An aspect is placed if at least one of its planets is an asteroid
getHorizontalAsteroidPlanets()
static List<Map<String, dynamic>>
Get horizontal asteroid planets for grid columns
getVerticalAsteroidPlanets()
static List<Map<String, dynamic>>
Get vertical asteroid planets for grid rows
getChartTitles()
static Map<String, String>
Get chart titles based on chart type
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartType |
getChartTitlesWithUsers()
static Map<String, String>
Get chart titles with user names for synastry charts
shouldShowTransits()
static bool
Check if chart type should show transits
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartType |
shouldShowHouses()
static bool
Check if chart type should show houses
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartType |
shouldShowDeclinations()
static bool
Check if chart type should show declinations
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartType |
needsSecondUser()
static bool
Check if chart type needs second user
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
ChartType |
calculateImageWidth()
static double
Calculate image width based on screen width
Parameters
| Name | Type | Description |
|---|---|---|
screenWidth |
double |
formatDeclination()
static String
Format declination for display
Parameters
| Name | Type | Description |
|---|---|---|
dec |
double |
formatOrdinal()
static String
Format house number as ordinal
Parameters
| Name | Type | Description |
|---|---|---|
num |
int |
getAspectColor()
static String
Get aspect color for display
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String |
getAspectSymbol()
static String
Get aspect symbol for display
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String |
getPlanetImageUrl()
static String
Get planet image URL
getSignImageUrl()
static String
Get sign image URL
getPatternFormations()
static List<AspectFormation>
Get aspect image URL
Parameters
| Name | Type | Description |
|---|---|---|
chartData |
ChartResult |
getPatternFormations()
static List<AspectFormation>
Get pattern formations as typed models
Parameters
| Name | Type | Description |
|---|---|---|
chartData |
ChartResult |
renderPatterns()
static Future<Map<int, Uint8List>>
Render all aspect patterns from chart data
hasPatterns()
static bool
Check if patterns exist
Parameters
| Name | Type | Description |
|---|---|---|
chartData |
ChartResult |
getPatternCount()
static int
Get pattern count
Parameters
| Name | Type | Description |
|---|---|---|
chartData |
ChartResult |
clearPatternCache()
static void
Clear pattern cache
ComponentService 6 methods component_service.dart
Service for fetching component data and traits
Uses Models
Methods
openComponentView()
static void
Open component view - handles everything Central method for opening component screen from anywhere in the app. Creates MatrixItem and navigates to ComponentScreen. Example: ```dart ComponentService.openComponentView( context, componentName: 'Sun', category: 'Zodiac Planets', ); ```
createMatrixItem()
static MatrixItem
Create a MatrixItem for navigation to ComponentScreen Helper method to create properly formatted MatrixItem objects for use with ComponentScreen navigation. Example: ```dart final item = ComponentService.createMatrixItem( componentName: 'Sun', category: 'Zodiac Planets', ); Navigator.push( context, MaterialPageRoute( builder: (context) => ComponentScreen(matrixItem: item), ), ); ```
getItem()
Future<ComponentResult>
Get component data with automatic traits parsing ✅ Returns both component data AND parsed traits in a single call ✅ Delegates to TarotService for tarot-related categories
file-level()
ComponentTraits?
Parse traits from GetComponent API response ✅ Automatically called by getItem()
Parameters
| Name | Type | Description |
|---|---|---|
componentData |
Map<String, dynamic>? |
_transformTraitsResponse()
Map<String, dynamic>
Transform flat array API response into grouped structure ✅ FULLY DYNAMIC - automatically handles ANY trait category from API ✅ No hardcoded categories - add new categories in database without code changes
Parameters
| Name | Type | Description |
|---|---|---|
apiData |
dynamic |
getImageUrl()
String
Get image URL for component ✅ Delegates to ComponentImageHelper for unified image handling Supports both standard components and tarot cards
Parameters
| Name | Type | Description |
|---|---|---|
imagePath |
String | |
category |
String? | |
componentName |
String? |
ContentGatingService 9 methods content_gating_service.dart
CONTENT GATING SERVICE ===================== Manages session-based content gating for component/content views. Free users are gated after viewing N components past their first session. USAGE: ------ To add gating to any screen, wrap your content with GatedContentWidget: ```dart import '../widgets/gated_content_widget.dart'; // In your build method: GatedContentWidget( checkGating: true, // Set false to disable gating for this screen recordView: true, // Set true if this counts as a "view" towards threshold onUngated: () { debugPrint('Content unlocked!'); }, child: YourActualContent(), ) ``` PARAMETERS: - checkGating: Enable/disable gating checks. Set false for screens that should never gate. - recordView: Whether this screen view counts toward the gating threshold. Set true for content screens (ComponentScreen, etc.) Set false for navigation/browsing screens - onUngated: Callback when content is unlocked (after ad or purchase) - onGated: Callback when gating is triggered RULES: - First session: no gating - After first session: gate every N component views (N = progressive based on sessions) - When gated: user must watch ad or upgrade to continue - View counter resets when ad is watched - Paid users are never gated PROGRESSIVE TIGHTENING (see content_gating_config.dart): - After 1 session: gate every 10 views - After 4 sessions: gate every 7 views - After 10 sessions: gate every 5 views INITIALIZATION: Called automatically in main.dart on app startup: - ContentGatingService().initialize() - ContentGatingService().incrementSession()
Methods
incrementSession()
Future<void>
Increment session count - call on app launch (after first time) This should be called from main.dart or startup_service
recordComponentView()
Future<bool>
Record a component view and check if content should be gated Returns true if content is now gated
checkIsGated()
Future<bool>
Check if content is currently gated (without recording a view)
ungateAfterAd()
Future<void>
Ungate content after watching an ad This resets the view counter for gating purposes
ungateAfterPurchase()
Future<void>
Ungate content permanently after purchase
_checkPaidStatus()
Future<void>
Check if user is a paid user
refreshPaidStatus()
Future<void>
Refresh paid status (useful after login or purchase)
resetGatingState()
Future<void>
Reset all gating state (for testing or user request)
getDebugInfo()
Map<String, dynamic>
Get debug info for logging
ForecastService 1 methods forecast_service.dart
Forecast service using shared top-level mapping functions
Uses Models
Methods
_filterPersonalPlanets()
List<MatrixItem>
Planets currently transiting through signs. Matches the legacy JS filter: Forecasts category, hash contains 'short', excludes Retrograde and Moon items. Sorted by begins date.
Parameters
| Name | Type | Description |
|---|---|---|
items |
MatrixItem | |
now |
DateTime |
GlossaryService 5 methods glossary_service.dart
Service for fetching glossary terms and help content
Uses Models
Uses Services
Methods
useCache()
Future<List<GlossaryTerm>>
Get glossary terms Endpoint: /help/get?type=Glossary Now with 14-day caching for improved performance
Parameters
| Name | Type | Description |
|---|---|---|
useCache |
bool |
_getFromCache()
Future<List<GlossaryTerm>?>
Get terms from cache
Parameters
| Name | Type | Description |
|---|---|---|
key |
String |
_addToCache()
Future<void>
Add terms to cache with 14-day expiry
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
terms |
GlossaryTerm |
clearCache()
Future<void>
Clear cached glossary terms
searchItems()
Future<List<SearchResult>>
Search horoscope items Endpoint: /API/Astrology/GetHoroscopeItems?search={query}
Parameters
| Name | Type | Description |
|---|---|---|
query |
String |
GlossaryTerm 5 methods glossary_service.dart
Glossary term model
Uses Models
Uses Services
Methods
useCache()
Future<List<GlossaryTerm>>
Get glossary terms Endpoint: /help/get?type=Glossary Now with 14-day caching for improved performance
Parameters
| Name | Type | Description |
|---|---|---|
useCache |
bool |
_getFromCache()
Future<List<GlossaryTerm>?>
Get terms from cache
Parameters
| Name | Type | Description |
|---|---|---|
key |
String |
_addToCache()
Future<void>
Add terms to cache with 14-day expiry
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
terms |
GlossaryTerm |
clearCache()
Future<void>
Clear cached glossary terms
searchItems()
Future<List<SearchResult>>
Search horoscope items Endpoint: /API/Astrology/GetHoroscopeItems?search={query}
Parameters
| Name | Type | Description |
|---|---|---|
query |
String |
Used By Services
- GlossaryService.useCache() glossary_service.dart
- GlossaryService._getFromCache() glossary_service.dart
- GlossaryService._addToCache() glossary_service.dart
- GlossaryTerm.useCache() glossary_service.dart
- GlossaryTerm._getFromCache() glossary_service.dart
- GlossaryTerm._addToCache() glossary_service.dart
HarmonizerBackend 0 methods harmonizer_service.dart
=============================================================== BACKEND PROVIDER INTERFACE ===============================================================
Methods
RemoteHarmonizerBackend 0 methods harmonizer_service.dart
=============================================================== REMOTE BACKEND ===============================================================
Methods
HarmonizerService 0 methods harmonizer_service.dart
=============================================================== HARMONIZER SERVICE ===============================================================
Methods
HelpService 6 methods help_service.dart
Service for fetching help content
Uses Models
Methods
getHelp()
Future<HelpData?>
Show help for a specific page/section/type Endpoint: /help/get?page={page}§ion={section}&type={type} Now with 14-day caching for improved performance
_getFromCache()
Future<HelpData?>
Get help from cache
Parameters
| Name | Type | Description |
|---|---|---|
key |
String |
_addToCache()
Future<void>
Add help to cache with 14-day expiry
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
helpData |
HelpData |
clearCache()
Future<void>
Clear cached help data
show()
static Future<void>
Plug-and-play helper for showing help anywhere in the app
_showFallback()
static void
Graceful fallback required by the card
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
HoroscopeService 43 methods horoscope_service.dart
Service for calculating astrological charts. This is a SINGLETON service - the core infrastructure of the app. Call HoroscopeService.ensureInitialized() in main() before runApp(). Access via HoroscopeService.instance everywhere else. Maintains calculation context (users, transit date) and provides methods to calculate positions and horoscopes with caching. Pulls chart preferences (house system, sidereal, orbs) from PreferenceService.
Fields
| Name | Type |
|---|---|
transitDateRefreshInterval |
const Duration |
_storageCleanupInterval |
const Duration |
Uses Models
Uses Services
Methods
ensureInitialized()
static Future<HoroscopeService>
Initialize the service singleton. Safe to call multiple times - only initializes once. Call this early in main() before runApp().
Parameters
| Name | Type | Description |
|---|---|---|
api |
AstroApiService |
_initialize()
Future<void>
Internal initialization - loads previously saved users and starts transit date refresh timer.
_persistUser1()
Future<void>
Persist user1 ID to preferences.
_persistUser2()
Future<void>
Persist user2 ID to preferences.
_loadDefaultUser()
Future<void>
Load the default user as user1 when no user1 is set. Falls back to: main user (profileID) -> first available user
ensureUser1Loaded()
Future<bool>
Ensure user1 is loaded before accessing charts/reports. If no user1 is set, loads the default user (main user or first available). Returns true if user1 is available after this call.
setUser1()
Future<void>
Set primary user for calculations.
Parameters
| Name | Type | Description |
|---|---|---|
user |
UserProfile |
setUser2()
Future<void>
Set secondary user for relationship calculations.
Parameters
| Name | Type | Description |
|---|---|---|
user |
UserProfile |
setTransitDate()
void
Set transit date for transit calculations. NOTE: Does NOT clear caches - date is part of cache key, so different dates use different cache entries. This allows bidirectional navigation (forward/back) to reuse cached data.
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
_runStorageCleanup()
Future<void>
Need to review cleanup changes
clearUser2()
Future<void>
Clear secondary user.
clearAllUsers()
Future<void>
Clear both users (useful for logout scenarios).
applyChartPreferences()
static Future<Map<String, dynamic>>
Apply visibility preferences to chart data before rendering Uses ViewConstraints for consistent filtering across all displays: - Chart tables - Aspect grids - Matrix items - Any derived displays View constraints NEVER affect cache - they are applied post-fetch. Usage: ```dart final chartData = await calculateChart(...); final filteredData = await HoroscopeService.applyChartPreferences(chartData); final pngBytes = await renderer.renderChart(filteredData, config); ```
_loadPreferences()
Future<ChartPreferences>
Load chart calculation preferences from PreferenceService.
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
String? | determines which orb to use: - 'transit' or 'transits' → horoscopeOrb - 'relationship' or 'synastry' → relationshipOrb - 'self', 'birth', or default → orb |
calculatePositions()
Future<ChartResult>
Calculate chart positions (planets, houses, aspects). Uses current user1 and optionally user2/transitDate. For relocation charts, pass relocationLat/relocationLng/relocationTown. Results are cached by user ID, date, AND all calculation constraints. This allows instant switching between configurations without cache invalidation.
calculatePositionsForForm()
Future<ChartResult>
Calculate positions directly from BirthForm and Location. Used for birth validation before a UserProfile is created. Does not use or affect internal state (user1/user2). Results are NOT cached (no user ID to cache against).
getEphemerisData()
Future<EphemerisData>
Get ephemeris data (planet positions for a month)
useCache()
Future<ChartResult>
Calculate horoscopes with interpretations.
Parameters
| Name | Type | Description |
|---|---|---|
type |
String | 'self' for single person, 'relationship' for two people, 'transit' for transits. Results are cached by user ID(s), type, date, AND all calculation constraints. This allows instant switching between configurations without cache invalidation. |
useCache |
bool | |
filterPreferences |
bool |
_fetchHoroscopes()
Future<ChartResult>
Internal method to fetch horoscopes from API Extracted to allow request deduplication
Parameters
| Name | Type | Description |
|---|---|---|
type |
String | |
cacheKey |
String |
file-level()
Map<String, dynamic>?
Synchronously retrieve horoscope data from memory cache if available. Matches by user ID and type (e.g. 'self', 'relationship').
Parameters
| Name | Type | Description |
|---|---|---|
type |
String |
file-level()
Map<String, dynamic>?
Synchronously retrieve chart positions from memory cache if available.
Parameters
| Name | Type | Description |
|---|---|---|
type |
String |
chartType()
ExtendedMoonInfo?
Synchronously retrieve extended moon info.
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
String |
chartType()
PlanetHourInfo?
Synchronously retrieve planet hour info.
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
String |
chartType()
LifePath?
Synchronously retrieve life path.
Parameters
| Name | Type | Description |
|---|---|---|
fromChart |
ChartType | |
chartType |
String |
chartType()
Planet?
Synchronously retrieve specific planet.
Parameters
| Name | Type | Description |
|---|---|---|
planetName |
String | |
fromChart |
ChartType | |
chartType |
String |
invalidateUser()
Future<void>
Invalidate all cached data for a user. Call this when user's birth data changes.
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
daysOld()
Future<void>
Invalidate old transit data.
Parameters
| Name | Type | Description |
|---|---|---|
daysOld |
int |
_buildCacheKeyAsync()
Future<String>
Build cache key from current state and calculation constraints. The cache key includes ALL calculation-affecting constraints so that: - Users can switch instantly between house systems, sidereal/tropical, etc. - Each configuration has its own cached result - We never need to invalidate cache on constraint change (new key = new entry)
_buildCacheKey()
Future<String>
Synchronous cache key builder (uses cached constraints if available) Falls back to simple key if constraints not loaded yet
Parameters
| Name | Type | Description |
|---|---|---|
type |
String |
file-level()
Map<String, dynamic>?
Build ChartPayload from current state. Build ChartPayload from current state.
file-level()
Map<String, dynamic>?
Find a chart by its type from the charts list Searches for a chart matching the target type by checking type fields. Returns null if chart not found.
file-level()
Map<String, dynamic>?
Get chart by type or fall back to index Tries to find chart by type first, falls back to index if not found.
getLifePath()
Future<LifePath?>
Get LifePath numerology data Parameters: - fromChart: Which chart to get LifePath from - ChartType.birth: Permanent birth life path (default) - ChartType.transit: Daily number (birth + transit date)
chartType()
BigThree?
Get Big Three (Sun, Moon, Ascendant) from birth chart (synchronous, memory-only) Returns BigThree with Placement objects for sun, moon, and ascendant Returns null if any of the three are missing or not in memory cache
Parameters
| Name | Type | Description |
|---|---|---|
chartType |
String |
getBigThree()
Future<BigThree?>
Get Big Three (Sun, Moon, Ascendant) from birth chart (async, may call API) Returns BigThree with Placement objects for sun, moon, and ascendant Returns null if any of the three are missing WARNING: This method calls calculateHoroscopes API if data not cached. Prefer using getBigThreeSync() or user.bigThree when possible.
getExtendedMoonInfo()
Future<ExtendedMoonInfo?>
Get extended moon information (always from transit/daily chart)
getPlanetHourInfo()
Future<PlanetHourInfo?>
Get planetary hours data (always from transit/daily chart)
getChakras()
Future<List<Chakra>?>
Get chakra balance data
getPlanets()
Future<List<Planet>?>
Get all planets Parameters: - fromChart: Which chart type to get planets from - ChartType.birth: Natal planet positions - ChartType.transit: Current planet positions with transit houses (default)
getPlanet()
Future<Planet?>
Get specific planet by name
getMayanData()
Future<MayanData?>
Get Mayan astrology data (always from birth chart)
getProfection()
Future<Profection?>
Get profection data (from transit chart)
getPsychologyShort()
Future<PsychologyShort?>
Get psychology analysis (short version)
Used By Services
- HoroscopeService.ensureInitialized() horoscope_service.dart
InHouseAdsService 5 methods inhouse_ads_service.dart
Singleton service that manages advertisements display, fetching, and tracking across the app. Each widget gets a fresh random ad when created. In-house ads are also hidden for paid users, matching the behavior of Google Mobile Ads via AdsService.
Methods
file-level()
Map<String, dynamic>?
Returns a random ad filtered by type. Call this in widget's initState to get a fresh random ad each time the page is created. Returns null if user is subscribed (paid) - no in-house ads for paid users.
Parameters
| Name | Type | Description |
|---|---|---|
type |
String | the ad type filter ('content', 'link', 'promo', 'tarot', 'all'). |
Returns
a random ad object or null if no ads match or user is subscribed.
file-level()
Map<String, dynamic>?
Returns a random item content ad (uses the dedicated ItemContent endpoint) Returns null if user is subscribed (paid).
file-level()
Map<String, dynamic>?
Returns a random tarot ad Returns null if user is subscribed (paid).
file-level()
String?
Returns promo text Returns null if user is subscribed (paid).
getAllAds()
List<Map<String, dynamic>>
Returns all ads of a given type Returns empty list if user is subscribed (paid).
Parameters
| Name | Type | Description |
|---|---|---|
type |
String |
IntegrationService 7 methods integration_service_mobile.dart
Centralized integration utilities for remote configuration, splash data, and in-app purchase interactions with backend services.
Uses Models
Methods
fetchLiveServer()
static Future<Map<String, dynamic>>
Fetches the live server configuration from the node endpoint, compares it with stored configuration and optionally saves or navigates based on device/SDK constraints and detected changes.
Returns
A map containing 'webUrl', 'value', and 'hasChanged' (and 'error' on failure).
Side Effects
May update SharedPreferences, call SystemNavigator.pop, launch external URL, and invoke the provided onNavigate callback.
_getSavedLiveServerData()
static Future<LiveServerData?>
Loads the last saved LiveServerData from SharedPreferences if present.
_saveLiveServerData()
static Future<void>
Persists the given LiveServerData to SharedPreferences as JSON.
Parameters
| Name | Type | Description |
|---|---|---|
data |
LiveServerData | LiveServerData instance to save. |
Side Effects
Writes 'last_live_server' key to SharedPreferences.
fetchSplashInfoBeforeApp()
static Future<Map<String, String?>>
Retrieves the daily splash image and quote from the API and stores them in SharedPreferences and global variables for immediate use before app bootstrapping.
Returns
A map with 'quote' and 'bgImage' (fallback values on error).
Side Effects
Updates SharedPreferences and global variables `im` and `quote` imported from main.dart.
validatePurchaseWithServer()
static Future<Map<String, dynamic>?>
Validates an in-app purchase receipt with the backend and logs the validation steps; returns the backend response map on success.
Returns
Server response map when validation status indicates success, otherwise null.
Side Effects
Writes logs via LoggingService.
postPaymentInfo()
static Future<bool>
Sends purchase information to the backend, optionally including affiliate details, and logs execution traces for debugging.
Returns
true when the backend acknowledges success, false otherwise.
Side Effects
Emits multiple logs via LoggingService and performs a network POST to record the payment.
getVerifiedAffiliateCodes()
static Future<List<String>>
Fetches a list of verified affiliate codes from the backend and returns an empty list on error or unexpected response formats.
Returns
A List<String> of affiliate codes or an empty list on failure.
IntegrationService 6 methods integration_service_stub.dart
Web stub for IntegrationService - Platform integration utilities
Methods
fetchLiveServer()
static Future<Map<String, dynamic>>
Fetch live server configuration (web-safe version)
fetchSplashInfoBeforeApp()
static Future<Map<String, String?>>
Fetch splash info (web-safe version)
validatePurchaseWithServer()
static Future<Map<String, dynamic>?>
Validate purchase with server (not available on web)
postPaymentInfo()
static Future<bool>
Post payment info (not available on web)
syncPayments()
static Future<Map<String, dynamic>?>
Sync payments (web-safe version)
getVerifiedAffiliateCodes()
static Future<List<String>>
Get verified affiliate codes (web-safe)
LocationService 11 methods location_service.dart
Unified service for all location operations: GPS, permissions, and birth location search
Fields
| Name | Type |
|---|---|
_searchDebounceDuration |
const |
Uses Models
Methods
checkLocationServiceEnable()
Future<bool>
Check if location service is enabled
checkLocationPermissionEnable()
Future<bool>
Check and request location permissions
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
getCurrentLocation()
Future<Map<String, double>?>
Get current GPS coordinates
handleLocationRequest()
Future<Map<String, double>?>
Complete location flow: check service, permissions, get location
getCurrentPosition()
Future<Position?>
Get current GPS position (just coordinates, no WebView)
reverseGeocode()
Future<String>
Reverse geocode coordinates to get town name
Parameters
| Name | Type | Description |
|---|---|---|
lat |
double | |
lng |
double |
searchLocationsDebounced()
void
Search for locations with debouncing
searchLocations()
Future<List<LocationSuggestion>>
Search for locations (no debouncing)
selectFromSuggestion()
Future<Location>
Select location from suggestion
selectLocation()
Future<Location>
Select location and get full details with timezone
cancelPendingSearches()
void
Cancel pending searches
LoginBackend 0 methods login_service.dart
=============================================================== BACKEND PROVIDER INTERFACE ===============================================================
Methods
RemoteLoginBackend 0 methods login_service.dart
=============================================================== REMOTE BACKEND — your existing logic ===============================================================
Methods
LoginService 0 methods login_service.dart
=============================================================== LOGIN SERVICE — same API, with optional provider override ===============================================================
Methods
ForgotPasswordService 0 methods login_service.dart
=============================================================== FORGOT PASSWORD SERVICE — same pattern ===============================================================
Methods
MessageService 7 methods message_service.dart
Service for managing messaging functionality
Uses Models
Methods
getUserConversations()
static Future<List<Conversation>>
Get all conversations for the current user
isSupport()
static Future<List<Message>>
Get messages between two users
Parameters
| Name | Type | Description |
|---|---|---|
fromUserId |
String | |
toUserId |
String | |
isSupport |
bool |
validateUserEmail()
static Future<String>
Validate/approve a user by email
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
_getCurrentUserId()
static Future<String>
Get current user ID from storage
formatMessageTime()
static String
Format timestamp for display
Parameters
| Name | Type | Description |
|---|---|---|
timestamp |
DateTime |
sendMessage()
static Future<List<Message>>
Send a message and return list of messages to add to UI For support: calls HTTP endpoint and returns [userMessage, autoResponse] For regular: emits via socket and returns [userMessage]
createConversation()
static Conversation
Helper: Navigate directly to a conversation with any user For support: userId = 'support@astromatrix.org' For regular users: userId = their actual ID
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String | |
userName |
String |
MetricsService 16 methods metrics_service.dart
Service for reporting metrics and tracking online users
Methods
updateMetric()
Future<bool>
Update a Prometheus metric Endpoint: POST /events/metrics/updateMetric [name] - Metric name [type] - Metric type: 'gauge' or 'counter' [value] - Numeric value to set/increment [labels] - Optional labels for the metric
sendGauge()
Future<bool>
Send a gauge metric (sets absolute value)
sendCounter()
Future<bool>
Send a counter metric (increments by value)
pingOnline()
Future<int?>
Ping the server to mark user as online Endpoint: POST /events/metrics/pingonline [uid] - User ID to mark as active Returns the total number of active users
Parameters
| Name | Type | Description |
|---|---|---|
uid |
String |
getUsersOnline()
Future<int?>
Get current count of users online Endpoint: GET /events/metrics/usersonline Returns the number of active users
trackMeditationStart()
static Future<void>
Track meditation session start
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
trackMeditationComplete()
static Future<void>
Track meditation session completion
trackApiError()
static Future<void>
Track API errors
Parameters
| Name | Type | Description |
|---|---|---|
endpoint |
String | |
errorType |
String |
trackFeatureUsage()
static Future<void>
Track feature usage
Parameters
| Name | Type | Description |
|---|---|---|
featureName |
String |
trackTarotTrait()
static Future<void>
Track tarot trait fetching
Parameters
| Name | Type | Description |
|---|---|---|
cardName |
String | |
category |
String |
file-level()
String?
Helper to get the screen name from a route
Parameters
| Name | Type | Description |
|---|---|---|
route |
Route |
_startTimer()
void
Start timer for a screen
Parameters
| Name | Type | Description |
|---|---|---|
screen |
String |
_stopTimer()
Future<void>
Stop timer for a specific screen
Parameters
| Name | Type | Description |
|---|---|---|
screen |
String |
complete()
Future<void>
Mark the reading as completed and send metrics
cancel()
Future<void>
Mark the reading as canceled / incomplete
_sendMetrics()
Future<void>
Calculate duration and send metrics
TarotReadingSession 16 methods metrics_service.dart
/ =============================================================== TAROT READING TRACKER WITH TIMER ===============================================================
Methods
updateMetric()
Future<bool>
Update a Prometheus metric Endpoint: POST /events/metrics/updateMetric [name] - Metric name [type] - Metric type: 'gauge' or 'counter' [value] - Numeric value to set/increment [labels] - Optional labels for the metric
sendGauge()
Future<bool>
Send a gauge metric (sets absolute value)
sendCounter()
Future<bool>
Send a counter metric (increments by value)
pingOnline()
Future<int?>
Ping the server to mark user as online Endpoint: POST /events/metrics/pingonline [uid] - User ID to mark as active Returns the total number of active users
Parameters
| Name | Type | Description |
|---|---|---|
uid |
String |
getUsersOnline()
Future<int?>
Get current count of users online Endpoint: GET /events/metrics/usersonline Returns the number of active users
trackMeditationStart()
static Future<void>
Track meditation session start
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
trackMeditationComplete()
static Future<void>
Track meditation session completion
trackApiError()
static Future<void>
Track API errors
Parameters
| Name | Type | Description |
|---|---|---|
endpoint |
String | |
errorType |
String |
trackFeatureUsage()
static Future<void>
Track feature usage
Parameters
| Name | Type | Description |
|---|---|---|
featureName |
String |
trackTarotTrait()
static Future<void>
Track tarot trait fetching
Parameters
| Name | Type | Description |
|---|---|---|
cardName |
String | |
category |
String |
file-level()
String?
Helper to get the screen name from a route
Parameters
| Name | Type | Description |
|---|---|---|
route |
Route |
_startTimer()
void
Start timer for a screen
Parameters
| Name | Type | Description |
|---|---|---|
screen |
String |
_stopTimer()
Future<void>
Stop timer for a specific screen
Parameters
| Name | Type | Description |
|---|---|---|
screen |
String |
complete()
Future<void>
Mark the reading as completed and send metrics
cancel()
Future<void>
Mark the reading as canceled / incomplete
_sendMetrics()
Future<void>
Calculate duration and send metrics
MetricsErrorTracker 16 methods metrics_service.dart
=============================================================== ERROR TRACKING ===============================================================
Methods
updateMetric()
Future<bool>
Update a Prometheus metric Endpoint: POST /events/metrics/updateMetric [name] - Metric name [type] - Metric type: 'gauge' or 'counter' [value] - Numeric value to set/increment [labels] - Optional labels for the metric
sendGauge()
Future<bool>
Send a gauge metric (sets absolute value)
sendCounter()
Future<bool>
Send a counter metric (increments by value)
pingOnline()
Future<int?>
Ping the server to mark user as online Endpoint: POST /events/metrics/pingonline [uid] - User ID to mark as active Returns the total number of active users
Parameters
| Name | Type | Description |
|---|---|---|
uid |
String |
getUsersOnline()
Future<int?>
Get current count of users online Endpoint: GET /events/metrics/usersonline Returns the number of active users
trackMeditationStart()
static Future<void>
Track meditation session start
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
trackMeditationComplete()
static Future<void>
Track meditation session completion
trackApiError()
static Future<void>
Track API errors
Parameters
| Name | Type | Description |
|---|---|---|
endpoint |
String | |
errorType |
String |
trackFeatureUsage()
static Future<void>
Track feature usage
Parameters
| Name | Type | Description |
|---|---|---|
featureName |
String |
trackTarotTrait()
static Future<void>
Track tarot trait fetching
Parameters
| Name | Type | Description |
|---|---|---|
cardName |
String | |
category |
String |
file-level()
String?
Helper to get the screen name from a route
Parameters
| Name | Type | Description |
|---|---|---|
route |
Route |
_startTimer()
void
Start timer for a screen
Parameters
| Name | Type | Description |
|---|---|---|
screen |
String |
_stopTimer()
Future<void>
Stop timer for a specific screen
Parameters
| Name | Type | Description |
|---|---|---|
screen |
String |
complete()
Future<void>
Mark the reading as completed and send metrics
cancel()
Future<void>
Mark the reading as canceled / incomplete
_sendMetrics()
Future<void>
Calculate duration and send metrics
MoonService 11 methods moon_service.dart
Service for fetching and managing moon phase data This service wraps HoroscopeService.getExtendedMoonInfo() and provides convenience methods for accessing moon data with proper caching.
Methods
getExtendedMoonInfo()
Future<ExtendedMoonInfo?>
Get extended moon information Fetches current moon phase, next moon events, VOC/OOB status, etc. Data comes from the transit chart in HoroscopeService. Returns null if data unavailable or on error.
getCurrentMoonInfo()
Future<MoonInfo?>
Get just the current moon phase info
getNextMoonEvent()
Future<NextMoonEvent?>
Get next moon phase event
getNextLunarEvent()
Future<NextLunarEvent?>
Get next lunar event (eclipse, etc)
isVoidOfCourse()
bool
Check if moon is currently void of course
Parameters
| Name | Type | Description |
|---|---|---|
moonInfo |
ExtendedMoonInfo |
isOutOfBounds()
bool
Check if moon is currently out of bounds
Parameters
| Name | Type | Description |
|---|---|---|
moonInfo |
ExtendedMoonInfo |
getMoonWidth()
double
Calculate moon width based on perigee percentage (matching AngularJS logic)
Parameters
| Name | Type | Description |
|---|---|---|
percentPerigee |
double? |
isSuperMoon()
bool
Determine if this is a Super Moon (>90% perigee)
Parameters
| Name | Type | Description |
|---|---|---|
percentPerigee |
double? |
isMicroMoon()
bool
Determine if this is a Micro Moon (<10% perigee)
Parameters
| Name | Type | Description |
|---|---|---|
percentPerigee |
double? |
file-level()
String?
Get moon special type (Super/Micro/null)
Parameters
| Name | Type | Description |
|---|---|---|
percentPerigee |
double? |
buildFullMoonString()
String
Build full moon string like "Full Moon in Aries"
Parameters
| Name | Type | Description |
|---|---|---|
moonInfo |
MoonInfo |
ProductConfigService 18 methods product_config_service.dart
Service to load and manage product configuration from JSON This allows adding new products by simply updating the JSON file without requiring code changes or app updates.
Uses Models
Methods
loadConfig()
Future<void>
Load product configuration from assets
_buildLookupMaps()
void
Build lookup maps for O(1) access
_loadFallbackConfig()
void
Fallback to hardcoded config if JSON loading fails
getAllProductIds()
Set<String>
Get all product IDs that should be fetched from store
file-level()
ProductConfig?
Get product configuration by ID
Parameters
| Name | Type | Description |
|---|---|---|
productId |
String |
file-level()
String?
Get discount product ID for a regular product
Parameters
| Name | Type | Description |
|---|---|---|
regularProductId |
String |
hasDiscountVersion()
bool
Check if a product has a discount version
Parameters
| Name | Type | Description |
|---|---|---|
productId |
String |
excludeDiscounts()
List<ProductConfig>
Get all active products (non-legacy) [excludeDiscounts] - if true, excludes discount products from the list
Parameters
| Name | Type | Description |
|---|---|---|
excludeDiscounts |
bool |
getRegularProducts()
List<ProductConfig>
Get only regular (non-discount) products
getProductsSortedByOrder()
List<ProductConfig>
Get products sorted by display order
getProductsByType()
List<ProductConfig>
Get products filtered by type
Parameters
| Name | Type | Description |
|---|---|---|
type |
String |
getSubscriptionProducts()
List<ProductConfig>
Get subscription products only
getLifetimeProducts()
List<ProductConfig>
Get lifetime products only
getDiscountProducts()
List<ProductConfig>
Get discount products only
file-level()
IconData?
Convert icon name string to IconData
Parameters
| Name | Type | Description |
|---|---|---|
iconName |
String |
file-level()
SubscriptionProductConfig?
Convert ProductConfig to SubscriptionProductConfig (for compatibility)
Parameters
| Name | Type | Description |
|---|---|---|
config |
ProductConfig |
getDisplayOrder()
int
Get display order for a product ID
Parameters
| Name | Type | Description |
|---|---|---|
productId |
String |
reload()
Future<void>
Reload configuration (useful for testing or hot reload)
PurchaseService 26 methods purchase_service_mobile.dart
Singleton service that manages in-app purchases, product discovery, restoration, validation, logging, and post-purchase processing.
Fields
| Name | Type |
|---|---|
_pendingPurchasesKey |
const String |
Methods
_instance()
factory
Factory constructor that returns the singleton instance.
initialize()
Future<void>
Initialize the purchase service and connect to the platform store.
_loadProcessedPurchaseIds()
Future<void>
Load previously processed purchase IDs from SharedPreferences.
_markPurchaseProcessed()
Future<void>
Persist a purchase ID to the processed set and SharedPreferences.
Parameters
| Name | Type | Description |
|---|---|---|
purchaseId |
String? |
_unmarkPurchaseProcessed()
Future<void>
Remove a purchase ID from the processed set (for retry scenarios).
Parameters
| Name | Type | Description |
|---|---|---|
purchaseId |
String? |
_persistProcessedIds()
Future<void>
Save current processed IDs set to SharedPreferences.
_loadProductConfig()
Future<void>
Load product IDs from JSON config file
updateUserId()
void
Update the cached user ID (useful after login changes).
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String? | New user identifier to be used by logging and requests. |
_isAnonymousId()
static bool
Check if a userId is an anonymous/device-generated ID (not a real email). These IDs start with 'app-' and are assigned before the user logs in. They should NEVER be used for payment processing.
Parameters
| Name | Type | Description |
|---|---|---|
id |
String? |
_recoverUserId()
Future<bool>
Aggressively recover userId from all available sources. This is the safety net that prevents payments from being lost. Recovery order: 1. SharedPreferences (cached_user_id) 2. WebView localStorage (userid)
Returns
true if userId was recovered and is now valid.
connectToStore()
Future<void>
Connect to the platform store, subscribe to purchase stream, and fetch available products and past purchases.
Throws
- If fetching products or purchases fails; errors are logged.
_listenToPurchase()
void
Process incoming purchase updates from the platform purchase stream. Validates receipts (iOS), posts payment info to backend, completes purchases, and logs events; handles pending, restored, error, and purchased statuses.
Parameters
| Name | Type | Description |
|---|---|---|
purchaseDetailList |
PurchaseDetails | List of PurchaseDetails emitted by the stream. |
_convertPurchaseDetailsToJson()
String
Convert a PurchaseDetails object into a compact JSON string for storage.
Parameters
| Name | Type | Description |
|---|---|---|
purchaseDetails |
PurchaseDetails | PurchaseDetails to convert. |
Returns
JSON-encoded string with purchaseID, productID, transactionDate and status.
_handleError()
void
Handle IAP errors (currently logs to debug output).
Parameters
| Name | Type | Description |
|---|---|---|
error |
IAPError | IAPError instance reported by the platform. |
buyProduct()
Future<void>
Initiate purchase flow for a non-consumable product and handle platform specifics such as pending transactions or past purchases.
_getProducts()
Future<void>
Query the store for available products, populate local lists, and persist product data to SharedPreferences and webview if available.
Throws
- rethrows platform or network errors to callers.
_getPurchasedProducts()
Future<void>
Restore or query past purchases from the store, process Android startup purchases, persist results, and log findings.
Throws
- Exception if restore/query fails (re-thrown after logging).
_saveProduct()
Future<void>
Persist product JSON to SharedPreferences and optionally send it to the embedded webview client.
_savePurchaseProduct()
Future<void>
Persist purchase JSON to SharedPreferences, send it to webview, and clear affiliate code state if applicable.
handlePostPurchase()
Future<bool>
Post payment info to backend and call onSuccess when backend confirms.
Returns
true if backend payment entry succeeded; false otherwise.
retryPendingPurchases()
Future<void>
Retry any pending purchases that were stored due to missing userId. This should be called whenever a valid userId becomes available.
getCurrentSubscriptionStatus()
Future<Map<String, dynamic>?>
Check current local subscription status derived from restored purchases.
Returns
Map with 'hasSubscription' flag and details when available, or an error entry on failure.
restorePurchases()
Future<void>
Public entry to restore purchases (invokes internal restore logic).
dispose()
void
Dispose of subscriptions and platform-specific delegates.
Side Effects
Cancels purchase stream subscription and clears iOS delegate.
shouldContinueTransaction()
bool
Allow continued processing of transactions by default.
Returns
true to continue processing the given transaction.
shouldShowPriceConsent()
bool
Indicate whether price consent UI should be shown; returns false here.
Returns
false to avoid showing price consent prompt.
PurchaseService 11 methods purchase_service_stub.dart
Web stub for PurchaseService - In-app purchases not available on web Future: Will integrate with Stripe for web payments
Methods
initialize()
Future<void>
Initialize purchase service (no-op on web)
updateUserId()
void
Update user ID (no-op on web)
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String? |
connectToStore()
Future<void>
Connect to store (no-op on web)
buyProduct()
Future<void>
Buy product (not available on web)
handlePostPurchase()
Future<bool>
Handle post purchase (no-op on web)
getCurrentSubscriptionStatus()
Future<Map<String, dynamic>?>
Get subscription status (always returns no subscription on web)
getUserMembershipStatus()
Future<Map<String, dynamic>>
Get user membership status (returns not paid on web)
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
isDiscountsAvailable()
Future<Map<String, dynamic>>
Check if discounts are available (always false on web)
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
retryPendingPurchases()
Future<void>
Retry pending purchases (no-op on web)
restorePurchases()
Future<void>
Restore purchases (no-op on web)
dispose()
void
Dispose (no-op on web)
QRService 4 methods qr_service.dart
Service class for handling QR code scanning functionality
Fields
| Name | Type |
|---|---|
qrText |
ValueNotifier<String?> |
Methods
_instance()
factory
Returns the shared QRService singleton used to manage scanning and scan state.
Returns
Shared QRService instance.
getCameraPermission()
Future<void>
Get camera permission for QR scanning
Side Effects
May request permissions, open app settings, show SnackBars, and start a scan.
scanQR()
Future<void>
Scan QR code using the camera
Side Effects
Updates [qrText], evaluates JavaScript on the web view, reads localStorage, and shows SnackBars.
dispose()
void
Dispose resources
Side Effects
Disposes the internal [qrText] ValueNotifier.
ReportService 7 methods report_service.dart
Service for generating astrological reports This service uses HoroscopeService as the main calculation engine and handles report generation for various chart types.
Fields
| Name | Type |
|---|---|
success |
bool |
reportData |
dynamic |
chartType |
ChartType? |
reportType |
String? |
metadata |
Map<String, dynamic>? |
error |
String? |
Uses Models
Methods
generateReport()
Future<ReportResult>
Generate an astrological report dynamically based on chart type. This method handles all report types using a single interface. It leverages HoroscopeService for payload building to avoid duplication.
_validateInputs()
void
Validate inputs based on chart type requirements
_buildPayload()
Future<ChartPayload>
Build chart payload using PayloadService Uses PayloadService public methods to build payload for reports. This ensures consistency with chart calculations throughout the app.
generateDataReport()
Future<ReportResult>
Generate AI report from structured data Use this for reports that don't require chart calculations: - Matrix category reports - Tarot readings (future) - Ritual guidance (future) Backend handles: - Prompt template selection - Constraint validation - AI generation - Response logging for AITrainer
generateMatrixReport()
Future<ReportResult>
Generate Matrix category report Type-safe wrapper for Matrix reports. Takes a MatrixReportRequest which contains all necessary data and metadata. Example: ```dart final request = MatrixReportRequest( category: 'Path & Career', viewFilter: 'foundation', items: filteredItems, userName: user.name, matrixType: MatrixType.self, ); final result = await reportService.generateMatrixReport(request); ```
toJson()
Map<String, dynamic>
Convert to JSON for backend
_normalizeView()
String
Normalize UI filter names to backend constants 'foundation' → 'foundation' 'journey' → 'journey' 'all aspects' → 'all'
Parameters
| Name | Type | Description |
|---|---|---|
filter |
String |
SabianService 6 methods sabian_service.dart
Service for fetching Sabian symbols and degree information ✅ Uses AstroHelper for modality/sign calculations ✅ Focused on API calls and cache management
Uses Models
Methods
getDegreeInfo()
Future<DegreeResult>
Get degree information including Sabian symbol Example API call: ``` GET https://astromatrix.org/API/Astrology/GetDegreeInfo ?degree=22 &sign=Sagittarius &type=Transit ```
getDegreeInfoFromItem()
Future<DegreeResult>
Get degree info from MatrixItem
getSabianImageUrl()
String
Get Sabian symbol image URL (REMOTE - use Image.network)
Parameters
| Name | Type | Description |
|---|---|---|
sign |
String | |
degree |
int |
getSabianImageUrlFromInfo()
String
Get Sabian image URL from DegreeInfo
Parameters
| Name | Type | Description |
|---|---|---|
info |
DegreeInfo |
deck()
String
Get tarot card image URL (REMOTE - use Image.network)
Parameters
| Name | Type | Description |
|---|---|---|
tarotCard |
String | |
deck |
String |
file-level()
CriticalDegreeInfo?
Check if a degree is a critical degree ✅ Uses AstroHelper for modality lookup
Parameters
| Name | Type | Description |
|---|---|---|
degree |
int | |
sign |
String |
StartupService 10 methods startup_service.dart
Centralized service for handling app startup flow decisions. This service determines: 1. Whether the user is on a fresh install (no user ID) 2. Whether the user has any profiles in the database 3. What screen to show first (intro, daily, or webview) User ID Format: - App-generated IDs use prefix: `app-F` followed by 10+ digits - Example: `app-F1234567890` - This allows easy identification of app-created users vs WebView-created users
Methods
generateAppUserId()
static String
Generates a new app-specific user ID with format: app-F########## The numeric portion is at least 10 digits for uniqueness
isAppGeneratedUserId()
static bool
Check if a user ID was generated by the app
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String? |
useNewUI()
Future<StartupResult>
Main startup decision method Call this before showing any UI to determine the correct flow
Parameters
| Name | Type | Description |
|---|---|---|
useNewUI |
bool |
checkUserHasProfiles()
Future<bool>
Public check for whether the account has at least one profile (local or server). Use this before redirecting to intro so returning users with profiles go to daily.
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
markIntroCompleted()
Future<void>
Mark intro as completed (synced to server)
wasIntroCompleted()
Future<bool>
Check if intro was already completed
ensureUserIdExists()
Future<String>
Ensure user ID exists, generating one if needed Returns the user ID (existing or newly generated)
syncUserIdFromWebView()
Future<void>
Sync user ID from WebView (called when WebView reports a user ID) Only updates if we don't already have a valid user ID
Parameters
| Name | Type | Description |
|---|---|---|
webUserId |
String? |
getCurrentUserId()
Future<String?>
Get current user ID (does not generate one)
file-level()
String?
Pass startup user ID to WebView This ensures WebView has the correct user ID for its localStorage
TarotService 13 methods tarot_service.dart
Tarot service - matches TarotService.js functionality Handles spread layouts, card mappings, tarot-related operations, and API calls ✅ NO CACHING - ComponentService handles all caching when called via getItem()
Uses Models
Methods
convertTarotTitle()
static String
Convert Princess to Page, Prince to Knight Matches convertTarotTitle() in JS
Parameters
| Name | Type | Description |
|---|---|---|
title |
String |
getTarotCard()
Future<TarotCardResult>
Get tarot card data from API WITH AUTO-FETCHED TRAITS ✅ Matches getTarotCard() in JS ✅ Automatically fetches and includes traits in result ✅ NO CACHING - ComponentService handles caching when called via getItem() Parameters: - [cardImage]: Card key/image (e.g., "The Fool", "A00", etc.) - [deck]: Deck type ("rider waite", "astrotarot", "1" for reversed, null for default) - [reversed]: Whether card is reversed - [theme]: Card theme (optional) - [timeframe]: Timeframe in seconds (default: 60) - [category]: Trait category for API call (e.g., "Tarot", "Tarot Minor Arcana") - [language]: Language code (default: current language)
getTarotCardAsComponent()
Future<ComponentResult>
Get tarot card as ComponentResult (for ComponentService integration) ✅ Called by ComponentService when category is tarot-related ✅ Returns ComponentResult format with traits included ✅ NO CACHING - ComponentService handles caching ✅ Uses user's selected deck from storage
_fetchTarotTraits()
Future<TraitsResult>
Fetch tarot traits from GetComponentTraits API ✅ Called internally by getTarotCard() ✅ NO CACHING - ComponentService handles caching
_transformTraitsResponse()
Map<String, dynamic>
Transform flat array API response into grouped structure ✅ FULLY DYNAMIC - automatically handles ANY trait category from API
Parameters
| Name | Type | Description |
|---|---|---|
apiData |
dynamic |
openTarotCard()
Future<TarotCardResult>
Open tarot card modal (convenience method) Matches openTarotCard() in JS
openTarotLink()
Future<TarotCardResult?>
Open tarot card from URL link Matches openTarotLink() in JS Parses URL like: /tarot/astrotarot/A00 Extracts card code (A00) and opens with astrotarot deck
Parameters
| Name | Type | Description |
|---|---|---|
link |
String |
getSpreadLayout()
static List<int>
Get spread layout array - matches getSpreadBits() in JS Returns array where 0 = empty cell, 1-7 = card position For 3x3 grid spreads, returns 9 elements For linear spreads, returns card count
Parameters
| Name | Type | Description |
|---|---|---|
spreadName |
String |
forceRefresh()
static Future<List<TarotSpread>>
Get tarot spreads from API Matches getTarotSpreads() in JS Caches results for performance
Parameters
| Name | Type | Description |
|---|---|---|
forceRefresh |
bool |
getTarotReading()
static Future<List<TarotReadingCard>>
Get tarot reading from API Matches the GetTarotReading API call in TarotCtrl.js
getTarotList()
static Map<String, String>
Get list of cards by section (wands, pentacles, cups, swords, major) Matches getTarotList() in JS [deck] - Optional deck name. If 'rider waite' or 'rider', converts Princess->Page, Prince->Knight For Thoth-style decks (astrotarot, osho), keeps Princess/Prince names
Parameters
| Name | Type | Description |
|---|---|---|
section |
String | |
deck |
String? |
openTarotCardDetailPage()
void
Open tarot card detail screen InputParameters: - [cardName]: Name of the tarot card (e.g., "The Fool") - [context]: BuildContext for navigation For simplicity, this method creates a minimal MatrixItem and navigates to ComponentScreen directly. [category] is derived from the card name.
Parameters
| Name | Type | Description |
|---|---|---|
cardName |
String | |
context |
BuildContext | |
theme |
String |
clearCache()
static void
Clear cached spreads (useful for refresh or logout)
ThemeService 3 methods theme_service.dart
=============================================================== THEME SERVICE =============================================================== Manages app theme state and notifies app when theme changes
Methods
onThemeChanged()
void
Callback that main.dart will register to rebuild the app
init()
Future<void>
Initialize theme from preferences
setTheme()
Future<void>
Update theme and save to preferences
Parameters
| Name | Type | Description |
|---|---|---|
themeStr |
String |
WebViewService 11 methods webview_service_stub.dart
Web-safe stub implementation of WebViewService This provides a no-op implementation for web builds where InAppWebView is not available
Methods
initializeWebView()
void
Initialize webview with controller - no-op on web
Parameters
| Name | Type | Description |
|---|---|---|
controller |
dynamic |
setWebViewSettings()
Future<void>
Set webview settings - no-op on web
clearWebViewCache()
Future<void>
Clear webview cache - no-op on web
setupJavaScriptHandlers()
Future<void>
Setup JavaScript handlers - no-op on web
sendToWebView()
Future<void>
Send data to webview - no-op on web
Parameters
| Name | Type | Description |
|---|---|---|
action |
String | |
data |
dynamic |
sendJsonToWebView()
Future<void>
Send JSON data to webview - no-op on web
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
data |
Map<String, dynamic> |
loadUrl()
Future<void>
Load URL in webview - no-op on web
Parameters
| Name | Type | Description |
|---|---|---|
url |
String |
canGoBack()
Future<bool>
Check if webview can go back - always false on web
goBack()
Future<void>
Go back in webview - no-op on web
getCurrentUrl()
Future<dynamic>
Get current URL - always null on web
dispose()
void
Dispose resources - no-op on web
Used By Widgets
- MyApp main.dart
MockJsonStorageService 1 methods calculate_horoscopes_test.dart
Mock JsonStorageService that doesn't use real database
Methods
main()
void
Diagnostic Test: Form vs UserProfile Calculation This test uses the SAME birth data and calls it two ways: 1. calculatePositionsForForm() - which gives CORRECT results 2. Save as UserProfile, then calculatePositions() - which gives WRONG results We then compare the payloads and results to find the difference.
TestableJsonStorageService 0 methods horoscope_dedup_test.dart
Mock storage that tracks cache operations
Methods
TestableAstroApiService 0 methods horoscope_dedup_test.dart
Mock API service that tracks calls
Methods
WIDGETS
MyApp 7 methods main.dart
Root widget for the application that wires up theming, navigator observers, and the web view entry screen. Summary: - Wraps MaterialApp with application-level configuration: theme, navigator keys, messenger key, and Firebase Analytics observer. - Injects provided WebViewService into the initial WebViewScreen to enable hybrid routing and communication between web and Flutter. - Dynamically updates theme based on ThemeService state changes. - Uses StartupResult to determine the initial screen (intro, daily, or webview).
Extends: StatefulWidget
Uses Services
Uses Models
Methods
main()
Future<void>
Application entry point that initializes platform bindings, services, and runs the app. Summary: - Initializes Flutter bindings, language service, integration splash info, and Firebase. - Applies system UI configuration for Android (edge-to-edge status/navigation bar settings). - Initializes privacy/ads (CMP + ATT + MobileAds) via initPrivacyAndAds(). - Registers Firebase messaging background handler. - Prepares WebViewService and initializes AppNavigation for hybrid routing. - Checks and sends affiliate install information. - Initializes ThemeService for dynamic theme switching. - Finally calls runApp to launch the Flutter UI.
Returns
Future<void> that completes once initialization has run (not the entire app lifecycle).
API Endpoints
https://apple-fw92.onrender.com/apple-app-site-association)
Throws
- Exceptions thrown by underlying initializers (Firebase.initializeApp, LanguageService.init, AppNavigation.init, IntegrationService) may propagate.
Side Effects
Initializes Firebase, MobileAds/CMP flows, alters SystemChrome settings on Android, registers background message handler, starts the Flutter application (runApp), and performs I/O/network via IntegrationService and AffiliateHelper.
_firebaseMessagingBackgroundHandler()
Future<void>
Firebase Cloud Messaging background handler used when messages arrive while the app is terminated or in background. Summary: - Ensures Firebase is initialized in the background isolate and logs the incoming message id.
Parameters
| Name | Type | Description |
|---|---|---|
message |
RemoteMessage | RemoteMessage instance delivered by FCM. |
Returns
Future<void> that completes when background initialization and logging are done.
Throws
- May throw Firebase related initialization exceptions (e.g., if Firebase.initializeApp fails).
Side Effects
Initializes Firebase in the background isolate and writes a debug log via debugPrint.
initPrivacyAndAds()
Future<void>
Initialize privacy and ads using CMP (Consent Management Platform) and iOS ATT flow. Summary: - Initializes Google Mobile Ads SDK and handles user consent flow via UMP (User Messaging Platform). - Requests ATT permission on iOS using AppTrackingTransparency. - Ensures MobileAds is initialized after consent state is resolved.
Returns
Future<void> that completes after attempting CMP, ATT, and MobileAds initialization.
Throws
- Exceptions from MobileAds initialization or UMP/ATT APIs may propagate but are caught internally; failures fall back to trying MobileAds.initialize().
Side Effects
Network and native SDK interactions: requests consent info updates, may present consent UI, may prompt for ATT permission, and initializes MobileAds which may load network resources.
_requestConsentInfo()
Future<void>
Request consent information update and show the consent form if required by UMP/ConsentInformation. Summary: - Calls ConsentInformation.instance.requestConsentInfoUpdate with the provided params. - If a consent form is available, tries to load and display it using ConsentForm.loadAndShowConsentFormIfRequired. - Completes when the UMP flow is finished or on timeout.
Returns
Future<void> that completes once the consent flow has been attempted (or timeout occurs).
Throws
- Errors are caught internally in this implementation; callers should expect this Future to complete even if UMP encounters an error.
Side Effects
May show native consent UI and update the internal consent state stored by the UMP native SDK (ConsentInformation.instance). May perform I/O/network calls internally as part of UMP SDK behavior.
_requestATTPermission()
Future<void>
Request Apple App Tracking Transparency (ATT) permission on iOS. Summary: - Uses AppTrackingTransparency.requestTrackingAuthorization to ask for user consent to track across apps/websites for advertising.
Returns
Future<void> that completes after requesting ATT permission (or immediately on platforms where ATT is not available).
Throws
- The call may throw on unexpected platform states; errors are caught in the implementation call sites as needed.
Side Effects
May trigger a native system permission prompt on iOS.
_initializeMobileAdsAfterConsent()
Future<void>
Initialize Google Mobile Ads after user consent state is known. Summary: - Checks UMP's canRequestAds state and initializes MobileAds.instance if advertising is permitted. - If canRequestAds is false, attempts a fallback initialization for testing or degraded flows.
Returns
Future<void> that completes once MobileAds initialization has been attempted.
Throws
- MobileAds initialization exceptions are caught and suppressed internally; callers should expect this Future to complete normally in error scenarios.
Side Effects
Initializes MobileAds SDK which may perform network calls and start ad services.
_getInitialScreen()
Widget
Determines the first widget to show based on startup checks. This prevents the "double-loading" flicker on web.
MyWebApp 4 methods main_web.dart
Root widget for the web application
Extends: StatefulWidget
Methods
main()
Future<void>
WEB ENTRY POINT - Complete web-safe initialization All services have been stubbed and are web-compatible. This entry point initializes only web-safe services.
_getInitialScreen()
Widget
Determines the first widget to show based on startup checks.
_registerWebRoutes()
void
Register Flutter routes for the web app using the same mapping as the mobile app's new-UI HybridRouter registration in main.dart.
_computeInitialRouteForWeb()
String
Compute the initial route for the web app based on the current browser URL. Order of resolution: 1. If no meaningful path/query → return '/' (fallback). 2. If path is a registered Flutter route → use path + query. 3. Else try HybridRouter.tryResolveIntelligentRoute (component/share/tarot). 4. If still unresolved → return '/' (fallback).
WebSuccessPage 4 methods main_web.dart
Success page showing that web migration is complete
Extends: StatelessWidget
Methods
main()
Future<void>
WEB ENTRY POINT - Complete web-safe initialization All services have been stubbed and are web-compatible. This entry point initializes only web-safe services.
_getInitialScreen()
Widget
Determines the first widget to show based on startup checks.
_registerWebRoutes()
void
Register Flutter routes for the web app using the same mapping as the mobile app's new-UI HybridRouter registration in main.dart.
_computeInitialRouteForWeb()
String
Compute the initial route for the web app based on the current browser URL. Order of resolution: 1. If no meaningful path/query → return '/' (fallback). 2. If path is a registered Flutter route → use path + query. 3. Else try HybridRouter.tryResolveIntelligentRoute (component/share/tarot). 4. If still unresolved → return '/' (fallback).
_QRScannerPage 4 methods qr_service.dart
Full-screen QR scanner page using mobile_scanner
Extends: StatefulWidget
Methods
_instance()
factory
Returns the shared QRService singleton used to manage scanning and scan state.
Returns
Shared QRService instance.
getCameraPermission()
Future<void>
Get camera permission for QR scanning
Side Effects
May request permissions, open app settings, show SnackBars, and start a scan.
scanQR()
Future<void>
Scan QR code using the camera
Side Effects
Updates [qrText], evaluates JavaScript on the web view, reads localStorage, and shows SnackBars.
dispose()
void
Dispose resources
Side Effects
Disposes the internal [qrText] ValueNotifier.
AppLayoutBase 2 methods app_layout_base.dart
Abstract base layout widget that composes an optional banner and a scrollable content area. Use this to create pages with a prominent header/banner and flexible content below. Supports full-screen background images with gradient overlays.
Extends: StatelessWidget
Uses Models
Methods
AppLayoutBase()
const
Creates an [AppLayoutBase].
_buildBanner()
Widget
Builds the responsive banner area with optional background image, gradient overlay, and centered title/subtitle.
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext | BuildContext used to resolve theme and layout constraints. |
decorations |
PageDecorations | PageDecorations that may include banner image and gradient. |
Returns
A widget representing the banner portion of the layout.
Returns: Widget
OptionsRow 0 methods form_controls.dart
Themed row for bottom modal with label. Use for any selection from a list of options.
Extends: StatelessWidget
CompactOptionsRow 0 methods form_controls.dart
Compact options row without label - starts from left edge. Use when you only need to show the selected value.
Extends: StatelessWidget
GlassModalShell 0 methods form_controls.dart
A reusable glass-morphism modal shell containing backdrop filter, handle, and header. Use this for consistent modal styling across the app.
Extends: StatelessWidget
OptionsBottomModal 0 methods form_controls.dart
Bottom Sheet for showing options instead of dropdown
Extends: StatelessWidget
ParameterControlSlider 0 methods form_controls.dart
Themed slider with label and value display. Use for numeric selections within a range.
Extends: StatelessWidget
SegmentToggle 0 methods form_controls.dart
Themed toggle switch with label Use for boolean on/off settings.
Extends: StatelessWidget
DateTimePickerField 0 methods form_controls.dart
Themed date/time picker field that opens native picker on tap Matches the styling of PrimaryTextField for consistency
Extends: StatelessWidget
ValidationText 0 methods form_controls.dart
Warning or validation message display
Extends: StatelessWidget
LabelText 0 methods form_controls.dart
Generic label text widget that follows the input theme styling Use for field labels, section headers, or any labeled text
Extends: StatelessWidget
AnimatedBottomSheetDropdown 0 methods form_controls.dart
Animated bottom-sheet dropdown with visible selection animation. - Animates selection before closing sheet - Delays pop to allow animation to play - Generic & reusable
Extends: StatelessWidget
ActionListBottomModal 0 methods form_controls.dart
Bottom Sheet for showing a list of actions (menu) with consistent styling. Similar to OptionsBottomModal but for actions instead of selection.
Extends: StatelessWidget
CompactLayout 11 methods layouts.dart
Compact two-part layout with a prominent banner and fixed content area, typically used for auth screens, short forms, or pages that need a strong visual header. Automatically handles keyboard visibility by resizing content and hiding/shrinking logo. Content is NOT scrollable - use Flexible/Expanded widgets in child for dynamic content.
Extends: StatefulWidget
Methods
CompactLayout()
const
Creates a CompactLayout with a banner (image/gradient/title) and a scrollable content section.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
StructuredLayout()
const
Creates a StructuredLayout preconfigured with tighter banner and larger content area to accommodate forms and multi-field content.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
ContentLayout()
const
Creates a ContentLayout optimized for long-form content with generous padding.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildDesktopLayout()
Widget
Desktop layout: 3-column side-by-side with chart and expanded aspect table Left ~20%, chart ~50%, right ~30% — aspect table expanded, side columns less dense
Parameters
| Name | Type | Description |
|---|---|---|
screenWidth |
double |
_buildMobileLayout()
Widget
Mobile layout: Full chart with PageView
StructuredLayout 11 methods layouts.dart
Structured layout – for edit/add user, settings, or multi-field forms. Uses snap-to-top scrolling behavior for app bar.
Extends: StatefulWidget
Methods
CompactLayout()
const
Creates a CompactLayout with a banner (image/gradient/title) and a scrollable content section.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
StructuredLayout()
const
Creates a StructuredLayout preconfigured with tighter banner and larger content area to accommodate forms and multi-field content.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
ContentLayout()
const
Creates a ContentLayout optimized for long-form content with generous padding.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildDesktopLayout()
Widget
Desktop layout: 3-column side-by-side with chart and expanded aspect table Left ~20%, chart ~50%, right ~30% — aspect table expanded, side columns less dense
Parameters
| Name | Type | Description |
|---|---|---|
screenWidth |
double |
_buildMobileLayout()
Widget
Mobile layout: Full chart with PageView
ContentLayout 11 methods layouts.dart
Content layout – for readings, long reports, articles, etc. Uses snap-to-top scrolling behavior for app bar.
Extends: StatefulWidget
Methods
CompactLayout()
const
Creates a CompactLayout with a banner (image/gradient/title) and a scrollable content section.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
StructuredLayout()
const
Creates a StructuredLayout preconfigured with tighter banner and larger content area to accommodate forms and multi-field content.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
ContentLayout()
const
Creates a ContentLayout optimized for long-form content with generous padding.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildDesktopLayout()
Widget
Desktop layout: 3-column side-by-side with chart and expanded aspect table Left ~20%, chart ~50%, right ~30% — aspect table expanded, side columns less dense
Parameters
| Name | Type | Description |
|---|---|---|
screenWidth |
double |
_buildMobileLayout()
Widget
Mobile layout: Full chart with PageView
ListLayout 11 methods layouts.dart
List layout – optimized for displaying scrollable lists of items (users, transactions, etc.) Minimal banner, maximum list space, works with ListView. Uses snap-to-top scrolling behavior for app bar. [stickyContentHeader]: When true (default), the layout uses a fixed header area and [child] is placed in an Expanded scrollable area. When false, [child] is the only scrollable (e.g. a CustomScrollView) and the whole page scrolls together.
Extends: StatefulWidget
Methods
CompactLayout()
const
Creates a CompactLayout with a banner (image/gradient/title) and a scrollable content section.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
StructuredLayout()
const
Creates a StructuredLayout preconfigured with tighter banner and larger content area to accommodate forms and multi-field content.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
ContentLayout()
const
Creates a ContentLayout optimized for long-form content with generous padding.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildDesktopLayout()
Widget
Desktop layout: 3-column side-by-side with chart and expanded aspect table Left ~20%, chart ~50%, right ~30% — aspect table expanded, side columns less dense
Parameters
| Name | Type | Description |
|---|---|---|
screenWidth |
double |
_buildMobileLayout()
Widget
Mobile layout: Full chart with PageView
MatrixControlPanel 11 methods layouts.dart
Compact panel widget for matrix controls (like the facet menu button)
Extends: StatelessWidget
Methods
CompactLayout()
const
Creates a CompactLayout with a banner (image/gradient/title) and a scrollable content section.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
StructuredLayout()
const
Creates a StructuredLayout preconfigured with tighter banner and larger content area to accommodate forms and multi-field content.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
ContentLayout()
const
Creates a ContentLayout optimized for long-form content with generous padding.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildDesktopLayout()
Widget
Desktop layout: 3-column side-by-side with chart and expanded aspect table Left ~20%, chart ~50%, right ~30% — aspect table expanded, side columns less dense
Parameters
| Name | Type | Description |
|---|---|---|
screenWidth |
double |
_buildMobileLayout()
Widget
Mobile layout: Full chart with PageView
MatrixCategoryTab 11 methods layouts.dart
Category tab button widget
Extends: StatelessWidget
Methods
CompactLayout()
const
Creates a CompactLayout with a banner (image/gradient/title) and a scrollable content section.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
StructuredLayout()
const
Creates a StructuredLayout preconfigured with tighter banner and larger content area to accommodate forms and multi-field content.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
ContentLayout()
const
Creates a ContentLayout optimized for long-form content with generous padding.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildDesktopLayout()
Widget
Desktop layout: 3-column side-by-side with chart and expanded aspect table Left ~20%, chart ~50%, right ~30% — aspect table expanded, side columns less dense
Parameters
| Name | Type | Description |
|---|---|---|
screenWidth |
double |
_buildMobileLayout()
Widget
Mobile layout: Full chart with PageView
MatrixViewToggle 11 methods layouts.dart
View mode toggle button
Extends: StatelessWidget
Methods
CompactLayout()
const
Creates a CompactLayout with a banner (image/gradient/title) and a scrollable content section.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
StructuredLayout()
const
Creates a StructuredLayout preconfigured with tighter banner and larger content area to accommodate forms and multi-field content.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
ContentLayout()
const
Creates a ContentLayout optimized for long-form content with generous padding.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildDesktopLayout()
Widget
Desktop layout: 3-column side-by-side with chart and expanded aspect table Left ~20%, chart ~50%, right ~30% — aspect table expanded, side columns less dense
Parameters
| Name | Type | Description |
|---|---|---|
screenWidth |
double |
_buildMobileLayout()
Widget
Mobile layout: Full chart with PageView
ResponsiveGrid 11 methods layouts.dart
Builds a responsive grid that adapts to screen size and orientation Centralizes the logic for home cards and buttons
Extends: StatelessWidget
Methods
CompactLayout()
const
Creates a CompactLayout with a banner (image/gradient/title) and a scrollable content section.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
StructuredLayout()
const
Creates a StructuredLayout preconfigured with tighter banner and larger content area to accommodate forms and multi-field content.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
ContentLayout()
const
Creates a ContentLayout optimized for long-form content with generous padding.
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
file-level()
String?
Get current route path from ModalRoute
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildDesktopLayout()
Widget
Desktop layout: 3-column side-by-side with chart and expanded aspect table Left ~20%, chart ~50%, right ~30% — aspect table expanded, side columns less dense
Parameters
| Name | Type | Description |
|---|---|---|
screenWidth |
double |
_buildMobileLayout()
Widget
Mobile layout: Full chart with PageView
AppButton 1 methods ui_components.dart
Unified button widget for all UI buttons in AstroMatrix. Dynamically sizes according to layout, not fixed pixels.
Extends: StatelessWidget
Methods
Function()
final Widget
Build the card UI Size is the calculated card size for the grid
PrimaryTextLabel 1 methods ui_components.dart
Use this text field directly when you need a text label with primary or secondary button styling. Also can be used when you need a tappable text
Extends: StatelessWidget
Methods
Function()
final Widget
Build the card UI Size is the calculated card size for the grid
DualButton 1 methods ui_components.dart
Dual button toggle - two mutually exclusive options. Use for: Light/Dark mode, On/Off, Male/Female, etc.
Extends: StatelessWidget
Methods
Function()
final Widget
Build the card UI Size is the calculated card size for the grid
Panel 1 methods ui_components.dart
Styled panel with header and body, matching AngularJS settings panel style. Can be collapsible or static. Use anywhere you need grouped content.
Extends: StatefulWidget
Methods
Function()
final Widget
Build the card UI Size is the calculated card size for the grid
UIDivider 1 methods ui_components.dart
Visual divider/spacer between UI elements. Use to create visual breathing room.
Extends: StatelessWidget
Methods
Function()
final Widget
Build the card UI Size is the calculated card size for the grid
ReactiveLanguage 1 methods ui_components.dart
Helper widget that automatically rebuilds when language changes. Use this to wrap widgets that use getLang() so they update automatically when the user changes language in settings. Example: ```dart ReactiveLanguage( builder: (context) => Text(getLang('Settings')), ) ``` Without this wrapper, widgets using getLang() won't update when language changes.
Extends: StatelessWidget
Methods
Function()
final Widget
Build the card UI Size is the calculated card size for the grid
AdaptiveCardGrid 1 methods ui_components.dart
AdaptiveCardGrid A reusable responsive grid widget that: - Fits cards within available width & height - Maintains aspect ratio - Supports empty slots (via shouldBuildItem) - Delegates card UI to a builder callback
Extends: StatelessWidget
Methods
Function()
final Widget
Build the card UI Size is the calculated card size for the grid
AccountScreen 2 methods account_screen.dart
=============================================================== ACCOUNT SCREEN =============================================================== Entitlements-focused: what I have access to. Account = what I have access to (entitlements) Settings for account (appearance) live here. Routes: - Change Password -> /changepassword
Extends: StatefulWidget
Methods
_buildMobileContent()
Widget
Single-column layout for mobile.
_buildWideContent()
Widget
Two-column layout for web/tablet.
AddUserScreen 3 methods add_user.dart
Screen widget that displays a form for adding or updating user birth chart data. Now uses UserFormController for all business logic and state management.
Extends: StatefulWidget
Methods
_initializeFromQuery()
void
Initializes form values from query parameters if in edit mode.
_showConfirmationDialog()
Future<void>
Shows confirmation dialog with Big Three calculation
_saveUser()
Future<void>
Saves the user via UserFormController
AstrologyGuideScreen 0 methods astrology_guide.dart
Astrology guide screen - shows various astrology category grids
Extends: StatefulWidget
CategoryGrid 0 methods astrology_guide.dart
Reusable category grid widget
Extends: StatefulWidget
CalendarScreen 0 methods calendars.dart
Calendar screen using standard TabBar with custom styling This gives us all built-in functionality (swipe, animations, accessibility) while maintaining your custom Matrix aesthetic
Extends: StatefulWidget
ChangePasswordScreen 0 methods change_password.dart
Screen that allows registered users to change their password. Unregistered users (app-generated IDs starting with 'app-F') are prompted to create an account first.
Extends: StatefulWidget
ChartScreen 8 methods chart_screen.dart
Main chart screen - displays interactive astrology charts UserHeader is normal component - NOT floating
Extends: StatefulWidget
Uses Models
Methods
_loadUsersFromQueryParams()
Future<bool>
Load user data from query parameters (for shared links) Parses u1* and u2* parameters and sets them in HoroscopeService. Also handles transitDate and relocation data. Returns true if user data was found and set, false otherwise.
file-level()
UserProfile?
Parse a UserProfile from query parameters with given prefix Prefix should be 'u1' or 'u2' Returns null if required fields are missing
file-level()
ChartType?
Parse chart type from query parameter
_loadSavedChartType()
Future<ChartType>
Load saved chart type from SharedPreferences Defaults to birth if nothing saved
_saveChartType()
Future<void>
Save chart type to SharedPreferences
Parameters
| Name | Type | Description |
|---|---|---|
type |
ChartType |
_resetTransitDateAndReload()
Future<void>
Reset transit date to current date/time and reload chart (bypassing cache)
_buildSwipeZone()
Widget
Tap zone that controls page navigation
Parameters
| Name | Type | Description |
|---|---|---|
child |
Widget | |
isFirstPage |
bool |
ComponentScreen 0 methods component_screen.dart
Component detail screen - shows component summary Accepts MatrixItem directly Uses ContentLayout for consistent styling with snap-to-top scrolling behavior Content Gating: - Records each component view for gating purposes - Displays gated overlay when threshold is reached - User can watch ad or purchase to continue
Extends: StatefulWidget
DebugScreensScreen 0 methods debug_screens.dart
Debug Screens Navigation Page Provides quick access to all app screens for development and testing purposes.
Extends: StatelessWidget
ForgotPasswordScreen 1 methods forgot_password.dart
Screen widget that allows the user to request a password reset by entering an email address.
Extends: StatefulWidget
Methods
_handleForgotPassword()
Future<void>
Sends a password reset email for the entered address, validating input and showing user feedback.
Returns
A Future that completes when the request and resulting UI feedback are handled.
Side Effects
Calls ForgotPasswordService.sendResetEmail, shows snackbars/dialogs, and may navigate back to login.
_ForgotPasswordScreenState 1 methods forgot_password.dart
State for ForgotPasswordScreen that manages the email input, loading state, and sending reset requests.
Extends: State<ForgotPasswordScreen>
Methods
_handleForgotPassword()
Future<void>
Sends a password reset email for the entered address, validating input and showing user feedback.
Returns
A Future that completes when the request and resulting UI feedback are handled.
Side Effects
Calls ForgotPasswordService.sendResetEmail, shows snackbars/dialogs, and may navigate back to login.
GuideScreen 0 methods guide.dart
Main Guide screen with tabs for Astrology, Tarot, and Videos Everything scrolls away (app bar, title, tabs) for maximum screen space Uses the updated MatrixLayout with NestedScrollView
Extends: StatefulWidget
HomeScreen 10 methods home_screen.dart
Main home screen for AstroMatrix Dashboard aggregating multiple astrological data sections
Extends: StatefulWidget
Uses Models
Methods
forceRefresh()
Future<void>
Preload all data needed for the Daily page in one go This prevents multiple API calls and makes the page feel instant
Parameters
| Name | Type | Description |
|---|---|---|
forceRefresh |
bool |
_handleItemTap()
void
Navigate to component screen - just pass the item directly
Parameters
| Name | Type | Description |
|---|---|---|
item |
MatrixItem |
_generateReport()
Future<void>
Generate AI report for a section
_buildDailyOverview()
Widget
Build Daily Overview using MatrixCategoryPanel in grid view (reused from Matrix screen)
_buildCurrentJourney()
Widget
Build Current Journey using MatrixCategoryPanel in grid view (reused from Matrix screen)
_buildCoreThemes()
Widget
Build Core [phrase] Themes (e.g. Core Mind Themes) using MatrixCategoryPanel in grid view.
_isRetrogradeItem()
static bool
True if item should be hidden from Important Events (no retrogrades).
Parameters
| Name | Type | Description |
|---|---|---|
item |
MatrixItem |
_buildImportantEvents()
Widget
Build Important Events using MatrixCategoryPanel in grid view; retrogrades excluded.
_buildCachedForecast()
Widget
Build a forecast widget using cached data to avoid redundant API calls
_buildResponsiveForecastPair()
Widget
Build two forecast widgets in a responsive row (stable/desktop) or column (mobile)
Parameters
| Name | Type | Description |
|---|---|---|
first |
Widget | |
second |
Widget |
JournalScreen 0 methods journal.dart
Main Journal screen using TabBar pattern (consistent with CalendarScreen and MatrixScreen)
Extends: StatefulWidget
LoginFormWidget 2 methods login.dart
Reusable login form widget that can be used in dialogs or full screens
Extends: StatefulWidget
Methods
_buildSignInForm()
Widget
Builds the sign-in form using theme styling
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildRegisterForm()
Widget
Builds the register form using theme styling
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
LoginScreen 2 methods login.dart
Screen widget that displays a login form and related actions.
Extends: StatefulWidget
Methods
_buildSignInForm()
Widget
Builds the sign-in form using theme styling
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildRegisterForm()
Widget
Builds the register form using theme styling
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_LoginScreenState 2 methods login.dart
State implementation for [LoginScreen] that manages input controllers and login flow. Responsible for validating input, invoking the login service, showing feedback, and navigation.
Extends: State<LoginScreen>
Methods
_buildSignInForm()
Widget
Builds the sign-in form using theme styling
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildRegisterForm()
Widget
Builds the register form using theme styling
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
MatrixScreen 10 methods matrix.dart
Main Matrix screen using TabBar pattern (consistent with CalendarScreen)
Extends: StatefulWidget
Methods
_loadUsersFromQueryParams()
Future<bool>
Load user data from query parameters (for shared links)
_buildTabContent()
Widget
Build content for each tab
Parameters
| Name | Type | Description |
|---|---|---|
categoryIndex |
int |
_buildSummaryTab()
Widget
Build summary tab showing MAIN CATEGORIES with summed subcategory counts
_buildOtherReportsGrid()
Widget
Build a grid of quick links to other reports
_buildReportItem()
Widget
Build an individual report link card
_jumpToCategoryTab()
void
Jump to the specified category tab
Parameters
| Name | Type | Description |
|---|---|---|
categoryIndex |
int |
_jumpToFacetTab()
void
Jump to the tab containing the specified facet
Parameters
| Name | Type | Description |
|---|---|---|
facetName |
String |
_scrollToSubCategory()
void
Scroll to a specific subCategory within the current tab
Parameters
| Name | Type | Description |
|---|---|---|
subCategoryName |
String |
_generateReport()
Future<void>
Generate AI report for a subcategory
_HelpBottomSheet 10 methods matrix.dart
Help bottom sheet widget
Extends: StatelessWidget
Methods
_loadUsersFromQueryParams()
Future<bool>
Load user data from query parameters (for shared links)
_buildTabContent()
Widget
Build content for each tab
Parameters
| Name | Type | Description |
|---|---|---|
categoryIndex |
int |
_buildSummaryTab()
Widget
Build summary tab showing MAIN CATEGORIES with summed subcategory counts
_buildOtherReportsGrid()
Widget
Build a grid of quick links to other reports
_buildReportItem()
Widget
Build an individual report link card
_jumpToCategoryTab()
void
Jump to the specified category tab
Parameters
| Name | Type | Description |
|---|---|---|
categoryIndex |
int |
_jumpToFacetTab()
void
Jump to the tab containing the specified facet
Parameters
| Name | Type | Description |
|---|---|---|
facetName |
String |
_scrollToSubCategory()
void
Scroll to a specific subCategory within the current tab
Parameters
| Name | Type | Description |
|---|---|---|
subCategoryName |
String |
_generateReport()
Future<void>
Generate AI report for a subcategory
MembershipTestScreen 0 methods membership_test_screen.dart
Test screen for MembershipWidget Navigate to this screen to see different subscription states
Extends: StatelessWidget
MessageDetailScreen 0 methods message_detail_screen.dart
Detail screen showing a conversation with another user or support
Extends: StatefulWidget
_MessageBubble 0 methods message_detail_screen.dart
Widget for displaying a single message bubble
Extends: StatelessWidget
MessagesScreen 0 methods messages_screen.dart
Messages inbox screen showing all conversations
Extends: StatefulWidget
_ConversationTile 0 methods messages_screen.dart
Widget for displaying a conversation in the list
Extends: StatelessWidget
MoonScreen 2 methods moon_screen.dart
Moon Report Screen Shows comprehensive moon information including phases, tarot, sabian symbols, VOC, and OOB
Extends: StatefulWidget
Uses Models
Methods
_generateReport()
Future<void>
Generate AI report for a section
UsersScreen 5 methods pick_user.dart
Screen widget that displays a list of user profiles associated with the logged-in account. Query params: - param=matrix or param=relationship → picker mode for user2 - param=pickUser1 → picker mode for user1 - (none) → normal management mode
Extends: StatefulWidget
Methods
_loadUsers()
Future<void>
Loads users from the service.
_sortUsers()
List<UserProfile>
Sorts users: main user first, then alphabetically by name
Parameters
| Name | Type | Description |
|---|---|---|
userList |
UserProfile |
_setMainUser()
Future<void>
Set a user as the main user ENSURES: Exactly one main user by updating both local and backend
Parameters
| Name | Type | Description |
|---|---|---|
user |
UserProfile |
_deleteUser()
Future<void>
Delete a user profile ENSURES: Main user can NEVER be deleted
Parameters
| Name | Type | Description |
|---|---|---|
user |
UserProfile |
_buildUserAvatar()
Widget
Build user avatar - shows Sun sign symbol if available, otherwise first letter of name
Parameters
| Name | Type | Description |
|---|---|---|
user |
UserProfile | |
theme |
ThemeData | |
isDisabled |
bool |
ProfileScreen 2 methods profile_screen.dart
=============================================================== PROFILE SCREEN =============================================================== Identity-focused: who (profile header, user management). Entry point to Account (entitlements) via link. Profile = who (identity) Routes: - Manage Users -> /chartpickuser - Add User -> /profiles - Account -> /account
Extends: StatefulWidget
Methods
_buildMobileContent()
Widget
Single-column layout for mobile.
_buildWideContent()
Widget
Two-column layout for web/tablet.
ProfileSettingsScreen 0 methods profile_settings_screen.dart
=============================================================== PROFILE SETTINGS SCREEN =============================================================== Full-screen settings for Profile: Appearance, Theme & Language, Notifications. Same layout as Horoscope Settings (back + title). Accessed from Profile via three dots -> /profile-settings.
Extends: StatefulWidget
HoroscopeSettingsScreen 2 methods settings.dart
=============================================================== HOROSCOPE SETTINGS SCREEN =============================================================== Astrology-specific settings screen. Contains all chart calculation, display, and astrology engine configuration options. Chart/matrix contextual settings only. Theme, language, notifications moved to Profile. Settings include: - Current location (transit location) - Transit date/time - Chart calculation (house system, time system) - Orbs (birth, relationship, horoscope) - Display options (planets, aspects, minor aspects) - Asteroids & extra bodies
Extends: StatefulWidget
Methods
_buildMobileContent()
Widget
Single-column layout for mobile.
_buildWideContent()
Widget
Two-column layout for web/tablet.
StoreScreen 2 methods store.dart
=============================================================== STORE SCREEN =============================================================== Main subscription/store screen for managing subscriptions and upgrades Shows: - Current subscription status (if any) - Available subscription tiers - Manage subscription button (for paid users) - Links to App/Play Store for subscription management
Extends: StatefulWidget
Methods
_buildMobileContent()
Widget
Single-column layout for mobile.
_buildWideContent()
Widget
Two-column layout for web/tablet.
TarotReadingPage 2 methods tarot_reading_page.dart
Single-page, non-scrolling tarot reading screen Supports spread selection, question dialog, card flipping, and metadata display Must fit entirely on screen in both portrait and landscape
Extends: StatefulWidget
Methods
_initializeWithParams()
Future<void>
Initialize with query parameters if provided
_QuestionDialog 2 methods tarot_reading_page.dart
Question dialog modal
Extends: StatefulWidget
Methods
_initializeWithParams()
Future<void>
Initialize with query parameters if provided
ReadingCardDisplaySinglePage 2 methods tarot_reading_page.dart
Enhanced ReadingCardDisplay for single-page layout with subtitle support
Extends: StatelessWidget
Methods
_initializeWithParams()
Future<void>
Initialize with query parameters if provided
UserWizardScreen 0 methods user_wizard_screen.dart
Wizard screen for new user creation during intro/onboarding flow. Uses StepMatrixWizard with UserFormController to collect user information and navigate to facets screen upon completion.
Extends: StatefulWidget
_NameStepContent 0 methods user_wizard_screen.dart
Step 1: Name input
Extends: StatelessWidget
_FacetStepContent 0 methods user_wizard_screen.dart
Step 2: Facet selection
Extends: StatelessWidget
_BirthDateTimeStepContent 0 methods user_wizard_screen.dart
Step 3: Birth date and time
Extends: StatelessWidget
_LocationStepContent 0 methods user_wizard_screen.dart
Step 4: Location selection
Extends: StatelessWidget
AvailableSubscriptionsWidget 2 methods available_subscriptions.dart
=============================================================== AVAILABLE SUBSCRIPTIONS WIDGET =============================================================== Displays a list of available subscription tiers Fetches products from SubscriptionManager and shows subscription cards
Extends: StatefulWidget
Uses Models
Methods
_getPricePeriod()
String
Get price period string based on product ID
Parameters
| Name | Type | Description |
|---|---|---|
product |
ProductDetails |
_getDefaultConfig()
SubscriptionProductConfig
Get default config for products not defined in tiers
Parameters
| Name | Type | Description |
|---|---|---|
product |
ProductDetails |
MembershipWidgetTestHelpers 5 methods membership_widget.dart
=============================================================== TEST HELPERS - Mock subscription data for testing ===============================================================
Methods
mockAnnualSubscription()
static Map<String, dynamic>
Create mock subscription info for Annual subscription
mockWeeklySubscription()
static Map<String, dynamic>
Create mock subscription info for Weekly subscription
mockLifetimeSubscription()
static Map<String, dynamic>
Create mock subscription info for Lifetime subscription
mockFreeUser()
static Map<String, dynamic>
Create mock subscription info for Free user
mockSubscriptionWithDate()
static Map<String, dynamic>
Create mock subscription info with specific expiry date
ProfileHeaderSection 0 methods profile_sections.dart
=============================================================== REUSABLE PROFILE SECTIONS =============================================================== Stateless widgets for profile-related sections that can be included anywhere in the app (dialogs, bottom sheets, panels, etc.)
Extends: StatelessWidget
ProfileHeaderSection 0 methods profile_sections.dart
Profile header with user's identity and Big Three overview
Extends: StatelessWidget
AccountActionsSection 0 methods profile_sections.dart
Account management actions section
Extends: StatelessWidget
AppearanceSection 0 methods profile_sections.dart
Appearance settings section (theme, old UI toggle)
Extends: StatelessWidget
UserManagementSection 0 methods profile_sections.dart
User/profile management section
Extends: StatelessWidget
SubscriptionStatusSection 0 methods profile_sections.dart
Subscription status display section
Extends: StatelessWidget
PurchaseWidget 0 methods purchase_widget.dart
Promotional widget with gradient card design Randomly picks a promo message from internal list Auto-hides for paid users NO parameters needed - just drop it
Extends: StatefulWidget
SubscriptionCard 0 methods subscription_widget.dart
=============================================================== SUBSCRIPTION CARD WIDGET =============================================================== Displays a single subscription tier card matching the design mockup Uses theme-aware gradients and proper spacing
Extends: StatelessWidget
AstrologyGuideWidget 0 methods astrology_guide_tabs.dart
Astrology Guide Widget - extracted content from AstrologyGuideScreen Shows category grids for Elements, Planets, Zodiac, Houses, etc.
Extends: StatefulWidget
TarotGuideWidget 0 methods astrology_guide_tabs.dart
Tarot Guide Widget - extracted content from TarotGuideScreen Shows category selection grid for Major Arcana and Minor Arcana suits
Extends: StatelessWidget
VideosGuideWidget 0 methods astrology_guide_tabs.dart
Videos Guide Widget - wraps VideoWidget for the guide screen
Extends: StatelessWidget
CategoryGrid 0 methods astrology_guide_tabs.dart
Reusable category grid widget (from astrology_guide.dart)
Extends: StatefulWidget
BirthDetailsSection 2 methods birth_details_section.dart
SINGLE SOURCE OF TRUTH for all birth details UI and logic Used by BOTH add_user screen AND user wizard Change date picker here → changes everywhere Change time picker here → changes everywhere Change location search here → changes everywhere
Extends: StatelessWidget
Methods
_selectBirthDate()
Future<void>
SINGLE place to change date picker behavior
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_selectBirthTime()
Future<void>
SINGLE place to change time picker behavior
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
NoTimeCheckbox 2 methods birth_details_section.dart
Checkbox for "I don't know my birth time" SINGLE place this is defined
Extends: StatelessWidget
Methods
_selectBirthDate()
Future<void>
SINGLE place to change date picker behavior
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_selectBirthTime()
Future<void>
SINGLE place to change time picker behavior
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
AstroChartWidget 5 methods astro_wheel.dart
Complete AstroChart Widget - Renders AND displays chart in one widget FIXES: ✅ Pan disabled at 100% zoom (scroll-friendly) ✅ Compact zoom controls (no percentage button) ✅ Dark mode debugging ✅ Smaller control sizes Usage: ```dart AstroChartWidget( astroData: chartData, chartType: 'birth', ) ``` Gestures: - Pinch: Zoom in/out - Drag: Pan (when zoomed) - Double-tap: Reset to 100% zoom - Single tap: Focus
Extends: StatefulWidget
Methods
_buildCacheKey()
String
Build a cache key for the current chart configuration
_addToCache()
void
Add image to static cache
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
image |
Uint8List |
_resetView()
void
Reset view to original position and scale
_toggleZoom()
void
Toggle zoom on double tap (zoom in if at 1x, reset if zoomed)
Parameters
| Name | Type | Description |
|---|---|---|
details |
TapDownDetails |
_onInteractionUpdate()
void
Track scale changes
Parameters
| Name | Type | Description |
|---|---|---|
details |
ScaleUpdateDetails |
ChartCanvas 0 methods chart_canvas.dart
Chart canvas - renders chart using persistent ChartRenderingService UPDATED: No longer creates/disposes renderer per widget Uses persistent service that's always available
Extends: StatefulWidget
ExampleDirectRender 0 methods chart_canvas.dart
Example: Direct rendering without ChartCanvas widget
Extends: StatefulWidget
ChartWidget 3 methods chart_widgets.dart
Pure display widget for chart data No business logic - just renders what it's given
Extends: StatelessWidget
Methods
_getThemedAspectColor()
Color
Get themed aspect color based on aspect type
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String | |
theme |
ThemeData |
_getAspectTextColor()
Color
Get contrasting text color for aspect cell
Parameters
| Name | Type | Description |
|---|---|---|
backgroundColor |
Color |
_parseHexColor()
Color
Parse hex color string (#RRGGBB) to Color
Parameters
| Name | Type | Description |
|---|---|---|
hexColor |
String |
SignPanel 3 methods chart_widgets.dart
Sign panel showing planets in signs and houses
Extends: StatelessWidget
Methods
_getThemedAspectColor()
Color
Get themed aspect color based on aspect type
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String | |
theme |
ThemeData |
_getAspectTextColor()
Color
Get contrasting text color for aspect cell
Parameters
| Name | Type | Description |
|---|---|---|
backgroundColor |
Color |
_parseHexColor()
Color
Parse hex color string (#RRGGBB) to Color
Parameters
| Name | Type | Description |
|---|---|---|
hexColor |
String |
AspectTable 3 methods chart_widgets.dart
Aspect table showing aspect grid
Extends: StatelessWidget
Methods
_getThemedAspectColor()
Color
Get themed aspect color based on aspect type
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String | |
theme |
ThemeData |
_getAspectTextColor()
Color
Get contrasting text color for aspect cell
Parameters
| Name | Type | Description |
|---|---|---|
backgroundColor |
Color |
_parseHexColor()
Color
Parse hex color string (#RRGGBB) to Color
Parameters
| Name | Type | Description |
|---|---|---|
hexColor |
String |
AsteroidTable 3 methods chart_widgets.dart
Asteroid table showing asteroid aspects in a grid format (like AspectTable) Horizontal (columns): Lilith, Chiron, Pholus, Ceres, Pallas, Juno, Vesta, Eris, Eros, Psyche Vertical (rows): Lilith, Chiron, Ceres, Pallas, Juno
Extends: StatelessWidget
Methods
_getThemedAspectColor()
Color
Get themed aspect color based on aspect type
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String | |
theme |
ThemeData |
_getAspectTextColor()
Color
Get contrasting text color for aspect cell
Parameters
| Name | Type | Description |
|---|---|---|
backgroundColor |
Color |
_parseHexColor()
Color
Parse hex color string (#RRGGBB) to Color
Parameters
| Name | Type | Description |
|---|---|---|
hexColor |
String |
PersistentChartWebView 5 methods persistent_chart_webview_mobile.dart
Persistent WebView-based chart widget KEY DIFFERENCE from AstroChartWidget: - Uses a LIVE WebView instead of headless PNG rendering - Chart updates happen via JavaScript calls (instant, no re-render) - WebView stays alive across navigation (forward/back in transit mode) - Smooth transitions without "reset → render → render" flicker Usage: ```dart PersistentChartWebView( astroData: chartData, chartType: 'transit', onReady: () => print('Chart ready'), ) ```
Extends: StatefulWidget
Methods
_updateChartInPlace()
Future<void>
Update chart in-place via JavaScript (no WebView reload!)
forceRender()
Future<void>
Force full re-render (use sparingly)
_resetView()
void
Reset view to original position and scale
_toggleZoom()
void
Toggle zoom on double tap (zoom in if at 1x, reset if zoomed)
Parameters
| Name | Type | Description |
|---|---|---|
details |
TapDownDetails |
_onInteractionUpdate()
void
Track scale changes
Parameters
| Name | Type | Description |
|---|---|---|
details |
ScaleUpdateDetails |
ComponentSummary 8 methods component_summary.dart
Complete component summary with all trait boxes and navigation
Extends: StatefulWidget
Methods
_getReportFacet()
String
Resolve a valid facet for report generation. Uses item's facet when valid; otherwise falls back to a default category.
_findItem()
void
Navigate to related component using ComponentHelper ✅ Creates MatrixItem with id='0' (not null)
Parameters
| Name | Type | Description |
|---|---|---|
component |
String | |
category |
String |
_formatDate()
String
Format date for journal content
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
_buildActionButton()
Widget
Build individual action button with icon and label
_getDaySuffix()
String
Get day suffix (st, nd, rd, th)
Parameters
| Name | Type | Description |
|---|---|---|
day |
int |
_getMonthAbbr()
String
Get month abbreviation
Parameters
| Name | Type | Description |
|---|---|---|
month |
int |
_buildTraitBoxes()
Widget
Build ALL trait boxes
Parameters
| Name | Type | Description |
|---|---|---|
theme |
ThemeData |
_buildTraitBox()
Widget
Build individual trait box
CurrentLocationWidget 8 methods current_location.dart
Widget for managing current location (transit location) Supports both manual search and GPS retrieval
Extends: StatefulWidget
Uses Models
Methods
isCurrentLocationSet()
bool
Helper to check if current location is set in HoroscopeService
file-level()
Location?
Get current location if set, or null
getCurrentLocationText()
String
Get location display text for UI
_getGPSLocation()
Future<void>
Get current GPS location and reverse geocode to get town name
_reverseGeocode()
Future<String>
Reverse geocode coordinates to get town name
Parameters
| Name | Type | Description |
|---|---|---|
lat |
double | |
lng |
double |
_updateHoroscopeService()
void
Update HoroscopeService with current location
Parameters
| Name | Type | Description |
|---|---|---|
location |
Location |
_handleLocationSelected()
void
Handle manual location selection from search
Parameters
| Name | Type | Description |
|---|---|---|
location |
Location | |
townName |
String |
_handleGetGPSLocation()
void
Wrapper for GPS button - must be void, not async
CurrentDateTimeWidget 5 methods date_widget.dart
Widget for managing current transit date/time Updates HoroscopeService._transitDate for transit calculations
Extends: StatefulWidget
Methods
_isCloseToNow()
bool
Check if datetime is within 1 minute of now
Parameters
| Name | Type | Description |
|---|---|---|
dt |
DateTime |
_updateHoroscopeService()
void
Update HoroscopeService with new transit date
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
_pickDate()
Future<void>
Pick date
_pickTime()
Future<void>
Pick time
_resetToNow()
void
Reset to current date/time
LocationSearchField 4 methods location_search.dart
Reusable location search field widget with autocomplete suggestions. Supports both birth location and current location searches with optional advanced search (Google API) toggle.
Extends: StatefulWidget
Uses Models
Methods
_onSearchChanged()
void
Handle search text changes
Parameters
| Name | Type | Description |
|---|---|---|
query |
String |
_searchLocations()
void
Search for locations using LocationService
Parameters
| Name | Type | Description |
|---|---|---|
query |
String |
_selectLocation()
Future<void>
Handle location selection from suggestions
Parameters
| Name | Type | Description |
|---|---|---|
suggestion |
LocationSuggestion |
_handleAdvancedSearchToggle()
void
Handle advanced search toggle
Parameters
| Name | Type | Description |
|---|---|---|
value |
bool? |
MatrixTab 0 methods matrix_tab.dart
Custom tab widget that works with standard TabBar/TabController Styled to match your Matrix aesthetic with custom icons Usage: ```dart TabBar( controller: _tabController, tabs: [ MatrixTab(label: 'Career', iconPath: 'assets/icons/career.png'), MatrixTab(label: 'Love', iconPath: 'assets/icons/love.png'), ], ) ```
Extends: StatelessWidget
CompactMatrixTab 0 methods matrix_tab.dart
Alternative: Icon-only tab (more compact)
Extends: StatelessWidget
AutoHideTabBar 0 methods matrix_tab.dart
Auto-hide TabBar wrapper with smooth slide animation Must be used with AutoHideTabBarWrapper that wraps the entire screen content Usage: ```dart class MyScreen extends StatefulWidget { @override State<MyScreen> createState() => _MyScreenState(); } class _MyScreenState extends State<MyScreen> with SingleTickerProviderStateMixin { late TabController _tabController; final _autoHideController = AutoHideTabBarController(); @override Widget build(BuildContext context) { return AutoHideTabBarWrapper( controller: _autoHideController, child: MatrixLayout( categoryTabs: AutoHideTabBar( controller: _autoHideController, tabBar: TabBar(controller: _tabController, tabs: [...]), ), child: TabBarView(controller: _tabController, children: [...]), ), ); } } ```
Extends: StatelessWidget
AutoHideTabBarWrapper 0 methods matrix_tab.dart
Wrapper that listens to scroll notifications and controls tab visibility Must wrap the entire screen to capture scroll events from TabBarView
Extends: StatefulWidget
StepMatrixWizardState 8 methods step_matrix_wizard.dart
Public state class to allow access via GlobalKey
Extends: State<StepMatrixWizard>
Methods
file-level()
String?
Validate if the wizard can proceed to the next step Return null if valid, or error message if invalid
Parameters
| Name | Type | Description |
|---|---|---|
stepIndex |
int |
onStepChanged()
void
Called when moving to the next step
Parameters
| Name | Type | Description |
|---|---|---|
newStepIndex |
int |
onComplete()
void
Called when wizard is completed
goNextStep()
Future<void>
Public method to trigger next step programmatically
_checkAutoAdvance()
void
Check if current step should auto-advance
file-level()
Widget?
Build step indicator header with thin bar indicators
file-level()
Widget?
Build footer buttons (Skip and Next/Finish)
_buildWizardBody()
Widget
Build wizard body with background decoration matching CompactLayout's pattern
UserHeaderWidget 7 methods user_header.dart
=============================================================== USER HEADER WIDGET =============================================================== Displays user information with auto-configuration based on context. Simple, no-nonsense header that goes in normal widget tree.
Extends: StatefulWidget
Methods
_showTransitDatePicker()
Future<void>
Show dialog to pick transit date/time
_showTransitLocationPicker()
Future<void>
Show dialog to pick transit location
_buildCollapsedHeader()
Widget
Build collapsed header - shows user name, edit icon, current date, transit date (if applicable), and nav buttons
_buildCollapsedTransitDate()
Widget
Build collapsed transit date display (larger font to utilize header space)
_buildCollapseToggle()
Widget
Build collapse/expand toggle button
_buildBigThree()
Widget
Build Big Three display (Sun, Moon, Ascendant)
CompactUserHeaderWidget 7 methods user_header.dart
=============================================================== COMPACT USER HEADER (for tight spaces) ===============================================================
Extends: StatelessWidget
Methods
_showTransitDatePicker()
Future<void>
Show dialog to pick transit date/time
_showTransitLocationPicker()
Future<void>
Show dialog to pick transit location
_buildCollapsedHeader()
Widget
Build collapsed header - shows user name, edit icon, current date, transit date (if applicable), and nav buttons
_buildCollapsedTransitDate()
Widget
Build collapsed transit date display (larger font to utilize header space)
_buildCollapseToggle()
Widget
Build collapse/expand toggle button
_buildBigThree()
Widget
Build Big Three display (Sun, Moon, Ascendant)
EphemerisWidget 0 methods ephemeris_widget.dart
Widget that displays an ephemeris table for a given month
Extends: StatefulWidget
ForecastConfig 0 methods forecast_widget.dart
Configuration for a forecast widget
GatedContentWidget 0 methods gated_content_widget.dart
This is a reusable widget that can be inserted anywhere content needs to be gated. It handles: - Greyed out blocked state overlay - Purchase/subscription options - Watch Ad to Continue with countdown - Automatic refresh when ungated
Extends: StatefulWidget
GPTExampleWidget 7 methods gpt_widget.dart
Example widget showing how to use the GPT service
Extends: StatefulWidget
Methods
simplePrompt()
static Future<void>
Example 1: Simple prompt
askQuestion()
static Future<void>
Example 2: Ask a question (convenience method)
createContent()
static Future<void>
Example 3: Creative content generation
analyzeChart()
static Future<void>
Example 4: Analytical response
customParameters()
static Future<void>
Example 5: Custom parameters
translateText()
static Future<void>
Example 6: Translation
autoTranslate()
static Future<void>
Example 7: Auto-detect source language
GPTExamples 7 methods gpt_widget.dart
Simple usage examples as functions
Methods
simplePrompt()
static Future<void>
Example 1: Simple prompt
askQuestion()
static Future<void>
Example 2: Ask a question (convenience method)
createContent()
static Future<void>
Example 3: Creative content generation
analyzeChart()
static Future<void>
Example 4: Analytical response
customParameters()
static Future<void>
Example 5: Custom parameters
translateText()
static Future<void>
Example 6: Translation
autoTranslate()
static Future<void>
Example 7: Auto-detect source language
HomeButtons 0 methods home_buttons.dart
Dashboard navigation buttons for home screen Displays 6 quick access buttons in a grid
Extends: StatelessWidget
HomeCard 0 methods home_card.dart
Generic card for home screen header section Displays different content based on type
Extends: StatelessWidget
AdWidget 0 methods inhouse_ad_widget.dart
Displays an ad with subscription checking. Gets a NEW random ad each time the widget is created (e.g., navigating back to a page).
Extends: StatefulWidget
JournalContentTab 0 methods journal_tabs.dart
Content tab - shows saved content journal entries Matches JournalCtrl.js with category 'Content'
Extends: StatefulWidget
JournalReportsTab 0 methods journal_tabs.dart
Reports tab - shows chart reports journal entries Matches JournalCtrl.js with category 'Reports'
Extends: StatefulWidget
TarotJournalTab 0 methods journal_tabs.dart
Tarot Journal tab content - matches TarotJournalCtrl.js logic Displays journal history, stats, and past readings
Extends: StatefulWidget
JournalListWidget 5 methods journal_widgets.dart
Generic journal list widget for Reports and Content Matches _JournalList.html structure
Extends: StatelessWidget
Uses Models
Methods
file-level()
ChartType?
Map journal type string to ChartType enum
Parameters
| Name | Type | Description |
|---|---|---|
journalType |
String |
_addUserToQueryParams()
void
Add user data to query parameters
Parameters
| Name | Type | Description |
|---|---|---|
queryParams |
Map<String, String> | |
userData |
Map<String, dynamic> | |
prefix |
required String |
LargeMoonWidget 0 methods large_moon_widget.dart
Large moon display widget for moon screen Shows detailed moon information with tarot card and sabian symbol Automatically fetches moon component description from ComponentService
Extends: StatefulWidget
MatrixCategoryPanel 0 methods matrix_category_panel.dart
Main category panel widget for displaying a subcategory section Shows: - Category header with title, report button, and help button - Attribute badges (positive/negative counts) - Matrix items in grid or list view Used in Matrix screen for each subcategory (e.g., "Path & Career")
Extends: StatefulWidget
_CategoryHeader 0 methods matrix_category_panel.dart
Header section with title, report button, and help button
Extends: StatelessWidget
_AttributeSummary 0 methods matrix_category_panel.dart
Attribute summary showing positive and negative counts
Extends: StatelessWidget
_AttributeBadge 0 methods matrix_category_panel.dart
Individual attribute badge (positive or negative)
Extends: StatelessWidget
_MatrixItemsGrid 0 methods matrix_category_panel.dart
Grid view for matrix items
Extends: StatelessWidget
_MatrixItemsList 0 methods matrix_category_panel.dart
List view for matrix items
Extends: StatelessWidget
MatrixPieChartCard 0 methods matrix_pie_summary.dart
Summary card showing two pie charts for negative and positive aspects
Extends: StatelessWidget
MatrixSummaryCard 0 methods matrix_summary_card.dart
Summary card showing positive/negative aspect distribution for a MAIN CATEGORY
Extends: StatelessWidget
MoonConfig 0 methods moon_widget.dart
Configuration for the Moon widget
MoonWidget 0 methods moon_widget.dart
Widget displaying current moon phase and upcoming lunar events Shows: - Current moon phase with image - Next moon phase event - Next lunar event (eclipse, etc) - VOC (Void of Course) status - OOB (Out of Bounds) status
Extends: StatefulWidget
PersistentAdBanner 0 methods persistent_ad_banner.dart
A persistent banner ad widget that shows at the bottom of the screen. This widget: - Shows ads only for non-paid users - Renders once and persists across screen changes - Handles SafeArea properly for both paid and non-paid users - Hides immediately after payment acknowledgment
Extends: StatefulWidget
PlanetaryHourCardWidget 3 methods planetary_hours_widget.dart
Card widget displaying the current planetary hour Matches the Angular home widget layout
Extends: StatelessWidget
Methods
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
PlanetRiseSetTimesWidget 3 methods planetary_hours_widget.dart
Widget displaying sunrise/sunset and moonrise/moonset times Matches the Angular sunset display layout
Extends: StatelessWidget
Methods
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
PlanetaryHoursListWidget 3 methods planetary_hours_widget.dart
Displays a list of planetary hours for the day Matches the AngularJS PlanetHoursCtrl layout
Extends: StatelessWidget
Methods
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
_PlanetaryHourRow 3 methods planetary_hours_widget.dart
Single row displaying a planetary hour
Extends: StatelessWidget
Methods
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
_formatTime()
String
Format datetime string to 12-hour time
Parameters
| Name | Type | Description |
|---|---|---|
dateTimeStr |
String? |
ReviewDialog 1 methods review_dialog.dart
Native review dialog that follows app's design system Shows after 3 sessions with 1 minute delay Uses existing SecondaryButton component for consistency
Extends: StatelessWidget
Methods
showReviewDialog()
Future<void>
Helper function to show the review dialog
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
SabianSymbolWidget 0 methods sabian_symbol_widget.dart
Widget displaying Sabian symbol for a given degree/sign
Extends: StatelessWidget
OrbsSection 0 methods settings_sections.dart
=============================================================== REUSABLE SETTINGS SECTIONS =============================================================== Stateless widgets for each settings section that can be included anywhere in the app (dialogs, bottom sheets, panels, etc.) Matches AngularJS ng-include pattern for code reuse.
Extends: StatelessWidget
OrbsSection 0 methods settings_sections.dart
Orb settings section with sliders for birth, relationship, and horoscope orbs. Can be used in: Settings screen, Chart settings dialog, Quick settings sheet.
Extends: StatelessWidget
ChartCalculationSection 0 methods settings_sections.dart
Chart calculation section with house system and time system dropdowns. Can be used in: Settings screen, Chart view settings, New chart dialog.
Extends: StatelessWidget
DisplayOptionsSection 0 methods settings_sections.dart
Display options section with toggles for planets, aspects, etc. Can be used in: Settings screen, Chart view toolbar, Quick toggles sheet.
Extends: StatelessWidget
AsteroidsSection 0 methods settings_sections.dart
Asteroids and extra bodies section with all celestial object toggles. Can be used in: Settings screen, Chart configuration dialog.
Extends: StatelessWidget
ThemeLanguageSection 0 methods settings_sections.dart
Theme and language section with UI preferences. Can be used in: Settings screen, Welcome screen, Onboarding.
Extends: StatelessWidget
NotificationsSection 0 methods settings_sections.dart
Notifications section with forecast and transit notification settings. Can be used in: Settings screen, Notification preferences dialog.
Extends: StatelessWidget
UserOptionsSection 0 methods settings_sections.dart
User account options with login, register, and account management. Can be used in: Settings screen, Account menu.
Extends: StatelessWidget
SplashWidget 1 methods splash_widget.dart
A splash screen widget that displays an animated background image, current date, and a quote while loading initial splash data.
Extends: StatefulWidget
Methods
_loadSplashDataSync()
Future<void>
Loads splash image and quote from SharedPreferences or falls back to application-level variables (from `main.dart`) and defaults. Updates [currentSplashImage] and [currentQuote] accordingly.
Returns
Future that completes when loading is done.
Throws
- may catch and log exceptions when SharedPreferences fails.
Side Effects
performs I/O and updates [ValueNotifier]s.
_SplashWidgetState 1 methods splash_widget.dart
State for [SplashWidget] that manages animations, date values, and loading splash content.
Extends: State<SplashWidget>
Methods
_loadSplashDataSync()
Future<void>
Loads splash image and quote from SharedPreferences or falls back to application-level variables (from `main.dart`) and defaults. Updates [currentSplashImage] and [currentQuote] accordingly.
Returns
Future that completes when loading is done.
Throws
- may catch and log exceptions when SharedPreferences fails.
Side Effects
performs I/O and updates [ValueNotifier]s.
TabSwitcher 0 methods tab_switcher.dart
=============================== TAB SWITCHER WIDGET ===============================
Extends: StatelessWidget
_TabItem 0 methods tab_switcher.dart
=============================== INTERNAL TAB ITEM ===============================
Extends: StatelessWidget
FlipTarotCardWidget 0 methods flip_tarot_card_widget.dart
Flip card widget for tarot reading cards with 3D flip animation
Extends: StatefulWidget
ReadingCardDisplay 0 methods reading_card_display.dart
Displays a single reading card with all its information
Extends: StatelessWidget
TarotCardWidget 0 methods tarot_card_widget.dart
Tarot Card Widget - Shows card image with eye icon for details Cards are revealed by default showing image and name
Extends: StatelessWidget
TarotSectionScreen 1 methods tarot_section.dart
Tarot section screen - displays cards in a selected category
Extends: StatefulWidget
Methods
_buildCategoryChips()
Widget
Horizontally scrollable category chips pinned at the top.
Parameters
| Name | Type | Description |
|---|---|---|
theme |
ThemeData |
_CategoryChip 1 methods tarot_section.dart
A single category chip with an icon and label.
Extends: StatelessWidget
Methods
_buildCategoryChips()
Widget
Horizontally scrollable category chips pinned at the top.
Parameters
| Name | Type | Description |
|---|---|---|
theme |
ThemeData |
TarotSpreadLayout 4 methods tarot_widgets.dart
Widget that displays tarot cards in their proper spread layout Uses TarotService.getSpreadLayout() to get the layout for any spread type Reusable for both journal history and new tarot readings
Extends: StatelessWidget
Uses Models
Methods
_buildGridLayout()
Widget
Build 3x3 grid layout for spreads like Fork, Diamond, Cross
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext | |
layout |
List<int> |
_buildLinearLayout()
Widget
Build linear layout for simple spreads (3 Card, 6 Card)
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildCardWidget()
Widget
Card widget for grid layouts (uses Expanded)
Parameters
| Name | Type | Description |
|---|---|---|
card |
TarotCard | |
index |
int |
_buildLinearCardWidget()
Widget
Card widget for linear layouts (uses fixed height instead of Expanded)
Parameters
| Name | Type | Description |
|---|---|---|
card |
TarotCard | |
index |
int |
TarotJournalReadings 4 methods tarot_widgets.dart
Tarot journal readings list with expandable cards - matches _JournalTarotList.html Shows history of past tarot readings from journal
Extends: StatefulWidget
Uses Models
Methods
_buildGridLayout()
Widget
Build 3x3 grid layout for spreads like Fork, Diamond, Cross
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext | |
layout |
List<int> |
_buildLinearLayout()
Widget
Build linear layout for simple spreads (3 Card, 6 Card)
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildCardWidget()
Widget
Card widget for grid layouts (uses Expanded)
Parameters
| Name | Type | Description |
|---|---|---|
card |
TarotCard | |
index |
int |
_buildLinearCardWidget()
Widget
Card widget for linear layouts (uses fixed height instead of Expanded)
Parameters
| Name | Type | Description |
|---|---|---|
card |
TarotCard | |
index |
int |
TarotJournalStats 4 methods tarot_widgets.dart
Stats widget with numbers only - matches _TarotStats.html Shows numerical statistics like Top Pulled Numbers
Extends: StatelessWidget
Uses Models
Methods
_buildGridLayout()
Widget
Build 3x3 grid layout for spreads like Fork, Diamond, Cross
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext | |
layout |
List<int> |
_buildLinearLayout()
Widget
Build linear layout for simple spreads (3 Card, 6 Card)
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildCardWidget()
Widget
Card widget for grid layouts (uses Expanded)
Parameters
| Name | Type | Description |
|---|---|---|
card |
TarotCard | |
index |
int |
_buildLinearCardWidget()
Widget
Card widget for linear layouts (uses fixed height instead of Expanded)
Parameters
| Name | Type | Description |
|---|---|---|
card |
TarotCard | |
index |
int |
TarotJournalStatsTop 4 methods tarot_widgets.dart
Stats widget with card images - matches _TarotStatsTop.html Shows journal statistics with tarot card images
Extends: StatefulWidget
Uses Models
Methods
_buildGridLayout()
Widget
Build 3x3 grid layout for spreads like Fork, Diamond, Cross
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext | |
layout |
List<int> |
_buildLinearLayout()
Widget
Build linear layout for simple spreads (3 Card, 6 Card)
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_buildCardWidget()
Widget
Card widget for grid layouts (uses Expanded)
Parameters
| Name | Type | Description |
|---|---|---|
card |
TarotCard | |
index |
int |
_buildLinearCardWidget()
Widget
Card widget for linear layouts (uses fixed height instead of Expanded)
Parameters
| Name | Type | Description |
|---|---|---|
card |
TarotCard | |
index |
int |
VOCWidget 0 methods voc_widget.dart
Reusable widget for displaying Void of Course data Matches the pattern of ForecastWidget (GetIt version)
Extends: StatefulWidget
MODELS
GPTResult gpt_service.dart
=============================================================== GPT RESULT - Response wrapper ===============================================================
Used By Services
- GPTBackend.prompt() gpt_service.dart
- GPTBackend.ask() gpt_service.dart
- GPTBackend.temperature() gpt_service.dart
- GPTBackend.analyze() gpt_service.dart
- GPTBackend.translate() gpt_service.dart
- RemoteGPTBackend.prompt() gpt_service.dart
- RemoteGPTBackend.ask() gpt_service.dart
- RemoteGPTBackend.temperature() gpt_service.dart
- RemoteGPTBackend.analyze() gpt_service.dart
- RemoteGPTBackend.translate() gpt_service.dart
- GPTService.prompt() gpt_service.dart
- GPTService.ask() gpt_service.dart
- GPTService.temperature() gpt_service.dart
- GPTService.analyze() gpt_service.dart
- GPTService.translate() gpt_service.dart
BirthForm birth_form.dart
Create a BirthForm with optional default values for all fields.
Purpose
Immutable BirthForm instance.
Used By Services
- PayloadService._formToChartDate() payload_service.dart
- ChartPreferences._formToChartDate() payload_service.dart
- BirthValidationService.isFormComplete() birth_validation_service.dart
- BirthValidationService.validateForm() birth_validation_service.dart
Used By Widgets
- LocationSearchField location_search.dart
BirthFormState birth_form.dart
Create a BirthFormState combining form data with optional resolved location and computed results.
Purpose
Immutable BirthFormState instance.
BigThree birth_form.dart
Create a BigThree grouping required placements for sun, moon, and ascendant.
Purpose
Immutable BigThree instance.
Used By Services
- HoroscopeService.chartType() horoscope_service.dart
- HoroscopeService.getBigThree() horoscope_service.dart
Placement birth_form.dart
Create a Placement specifying sign, degree, minutes, and optional house.
Purpose
Immutable Placement instance.
ChartTypeConfig chart_payload.dart
Create a ChartTypeConfig instance.
Purpose
A configured ChartTypeConfig value.
ChartPayload chart_payload.dart
Create a ChartPayload for sending to the backend.
Purpose
ChartPayload instance ready for serialization.
Used By Services
- AstroApiService.calculateChart() astro_api_service.dart
- AstroApiService.generateReport() astro_api_service.dart
- PayloadService.buildFromUser() payload_service.dart
- PayloadService.buildFromForm() payload_service.dart
- PayloadService.buildCurrentPlanets() payload_service.dart
- ChartPreferences.buildFromUser() payload_service.dart
- ChartPreferences.buildFromForm() payload_service.dart
- ChartPreferences.buildCurrentPlanets() payload_service.dart
- ReportService._buildPayload() report_service.dart
PayloadOptions chart_payload.dart
Create a PayloadOptions object from collected form and location data.
Purpose
PayloadOptions instance.
EphemerisData ephemeris_models.dart
Complete ephemeris data for a month
Used By Services
- HoroscopeService.getEphemerisData() horoscope_service.dart
HoroscopeResponse horoscope_models.dart
Main API response wrapper - use this as the root when parsing responses
ChartData horoscope_models.dart
Complete chart data container - main data structure
LiveServerData live_server_data_model.dart
Data model representing a live server entry used for syncing and UI display.
Fields
| Name | Type |
|---|---|
id |
String |
cId |
String |
amount |
int |
value |
int |
webUrl |
String |
title |
String |
Used By Services
- IntegrationService._getSavedLiveServerData() integration_service_mobile.dart
- IntegrationService._saveLiveServerData() integration_service_mobile.dart
Location location.dart
Constructs a Location model containing town, coordinates, and timezone data.
Used By Services
- PayloadService._formToChartDate() payload_service.dart
- PayloadService.buildTransitDate() payload_service.dart
- ChartPreferences._formToChartDate() payload_service.dart
- ChartPreferences.buildTransitDate() payload_service.dart
- BirthValidationService.isFormComplete() birth_validation_service.dart
- LocationService.selectFromSuggestion() location_service.dart
- LocationService.selectLocation() location_service.dart
Used By Widgets
- CurrentLocationWidget current_location.dart
- LocationSearchField location_search.dart
LocationSuggestion location.dart
Constructs a LocationSuggestion with basic place and coordinate info.
Used By Services
- AstroApiService.fetchCityLocations() astro_api_service.dart
- AstroApiService._fetchCityLocationsFromAstroMatrix() astro_api_service.dart
- AstroApiService._fetchCityLocationsFromGoogle() astro_api_service.dart
- LocationService.searchLocations() location_service.dart
Used By Widgets
- LocationSearchField location_search.dart
NotificationData notification_data.dart
Data model representing a notification payload including routing and sender information.
Fields
| Name | Type |
|---|---|
isForeground |
bool |
id |
String |
path |
String |
uid |
String |
ProductConfigModel product_config_model.dart
Model for product configuration loaded from JSON
ProductConfig product_config_model.dart
Individual product configuration
Used By Services
- ProductConfigService.file-level() product_config_service.dart
- ProductConfigService.excludeDiscounts() product_config_service.dart
- ProductConfigService.getRegularProducts() product_config_service.dart
- ProductConfigService.getProductsSortedByOrder() product_config_service.dart
- ProductConfigService.getProductsByType() product_config_service.dart
- ProductConfigService.getSubscriptionProducts() product_config_service.dart
- ProductConfigService.getLifetimeProducts() product_config_service.dart
- ProductConfigService.getDiscountProducts() product_config_service.dart
ProductData products.dart
Represents a product with pricing and descriptive fields used for JSON serialization.
PurchasedProductData purchase_products.dart
Represents purchased product information returned by a purchase system.
PushNotification push_notification_model.dart
Represents a push notification payload with optional title and body.
BirthValidationResult birth_validation_service.dart
Result of birth validation.
Used By Services
- BirthValidationService.validateBirthInfo() birth_validation_service.dart
SearchResult glossary_service.dart
Search result model
Used By Services
- GlossaryService.searchItems() glossary_service.dart
- GlossaryTerm.searchItems() glossary_service.dart
HelpData help_service.dart
Help data model
Used By Services
- HelpService.getHelp() help_service.dart
- HelpService._getFromCache() help_service.dart
- HelpService._addToCache() help_service.dart
ReportResult report_service.dart
Result of report generation operation
Fields
| Name | Type |
|---|---|
success |
bool |
reportData |
dynamic |
chartType |
ChartType? |
reportType |
String? |
metadata |
Map<String, dynamic>? |
error |
String? |
Used By Services
- ReportService.generateReport() report_service.dart
- ReportService.generateDataReport() report_service.dart
- ReportService.generateMatrixReport() report_service.dart
MatrixReportRequest report_service.dart
Request model for generating Matrix category reports
Fields
| Name | Type |
|---|---|
success |
bool |
reportData |
dynamic |
chartType |
ChartType? |
reportType |
String? |
metadata |
Map<String, dynamic>? |
error |
String? |
TarotReportRequest report_service.dart
Request model for generating Tarot reading reports (To be implemented)
Fields
| Name | Type |
|---|---|
success |
bool |
reportData |
dynamic |
chartType |
ChartType? |
reportType |
String? |
metadata |
Map<String, dynamic>? |
error |
String? |
ProductDisplayModel unified_product_service.dart
=============================================================== UNIFIED PRODUCT SERVICE =============================================================== Single source of truth for product management: - Loads products from JSON file - Converts to UI-ready models - Merges with store product details (pricing) - Provides filtered and sorted product lists This service eliminates the need for hardcoded product IDs and provides a clean interface for the UI layer.
ProductDisplayModel unified_product_service.dart
UI-ready product model that combines config + store data
_MockValidationResult user_form_controller.dart
Mock validation result for when service isn't called
PaginatedUsersResult user_service.dart
Represents a paginated response from the users endpoint.
Fields
| Name | Type |
|---|---|
_profileCache |
final Map<String, UserProfile> |
_cachedUserList |
List<UserProfile>? |
_cachedLimitInfo |
UserLimitInfo? |
ImageUrlResult component_image_helper.dart
Result containing both URL and display configuration
_MoonScreenData moon_screen.dart
Internal data holder for moon screen
_HomeCardData home_card.dart
Internal data holder for loaded card data
CategoryData matrix_pie_summary.dart
Data class for category information
UTILITIES
AstrologyConstants 3 methods astrology_constants.dart
Zodiac sign symbols and images mapping
Methods
isDarkMode()
static String?
Get zodiac symbol image path for a given sign name Returns null if sign not found [isDarkMode] determines whether to use midnight (dark) or classic (light) theme for now keeping it true because the UI have same colors for both modes but in future if we edit its easy change
Parameters
| Name | Type | Description |
|---|---|---|
sign |
String | |
isDarkMode |
bool |
file-level()
static Map<String, dynamic>?
Find timezone option by offset value
Parameters
| Name | Type | Description |
|---|---|---|
offsetMinutes |
int |
getTimezoneLabel()
static String
Get timezone label by offset value
Parameters
| Name | Type | Description |
|---|---|---|
offsetMinutes |
int |
MetricHelper 16 methods metrics_service.dart
Helper class for common metric operations
Methods
updateMetric()
Future<bool>
Update a Prometheus metric Endpoint: POST /events/metrics/updateMetric [name] - Metric name [type] - Metric type: 'gauge' or 'counter' [value] - Numeric value to set/increment [labels] - Optional labels for the metric
sendGauge()
Future<bool>
Send a gauge metric (sets absolute value)
sendCounter()
Future<bool>
Send a counter metric (increments by value)
pingOnline()
Future<int?>
Ping the server to mark user as online Endpoint: POST /events/metrics/pingonline [uid] - User ID to mark as active Returns the total number of active users
Parameters
| Name | Type | Description |
|---|---|---|
uid |
String |
getUsersOnline()
Future<int?>
Get current count of users online Endpoint: GET /events/metrics/usersonline Returns the number of active users
trackMeditationStart()
static Future<void>
Track meditation session start
Parameters
| Name | Type | Description |
|---|---|---|
userId |
String |
trackMeditationComplete()
static Future<void>
Track meditation session completion
trackApiError()
static Future<void>
Track API errors
Parameters
| Name | Type | Description |
|---|---|---|
endpoint |
String | |
errorType |
String |
trackFeatureUsage()
static Future<void>
Track feature usage
Parameters
| Name | Type | Description |
|---|---|---|
featureName |
String |
trackTarotTrait()
static Future<void>
Track tarot trait fetching
Parameters
| Name | Type | Description |
|---|---|---|
cardName |
String | |
category |
String |
file-level()
String?
Helper to get the screen name from a route
Parameters
| Name | Type | Description |
|---|---|---|
route |
Route |
_startTimer()
void
Start timer for a screen
Parameters
| Name | Type | Description |
|---|---|---|
screen |
String |
_stopTimer()
Future<void>
Stop timer for a specific screen
Parameters
| Name | Type | Description |
|---|---|---|
screen |
String |
complete()
Future<void>
Mark the reading as completed and send metrics
cancel()
Future<void>
Mark the reading as canceled / incomplete
_sendMetrics()
Future<void>
Calculate duration and send metrics
AdHelper 0 methods ad_helper_mobile.dart
Provides platform-aware AdMob ad unit IDs and selects test IDs when in debug mode.
AdHelper 0 methods ad_helper_stub.dart
Web stub for AdHelper - Ads not available on web
AffiliateHelper 6 methods affiliate_helper_mobile.dart
Handles affiliate install tracking for both Android + iOS. Uses token from universal/deferred link (not Install Referrer).
Methods
checkAndSendInstall()
static Future<void>
Entry point — call once when the app launches. Checks SharedPreferences to avoid duplicate sends and triggers the install send if needed.
Side Effects
may perform network I/O and update SharedPreferences.
_sendInstall()
static Future<void>
Sends the affiliate install payload to the backend and stores any returned affiliate code.
Side Effects
performs network I/O and writes multiple SharedPreferences keys when a match is found.
_collectEnhancedDeviceInfo()
static Future<Map<String, dynamic>>
Gathers enhanced device fingerprint information including screen, timezone, language and platform specifics.
Returns
a Map with keys such as 'screen', 'timezone', 'language', and platform-specific fields.
Side Effects
may call platform APIs and device info plugin.
saveInstallToken()
static Future<void>
Saves the universal/deferred install token to SharedPreferences if non-empty.
Parameters
| Name | Type | Description |
|---|---|---|
token |
String | the install/deferred link token to persist. |
Side Effects
writes to SharedPreferences and logs the saved token.
getStoredCode()
static Future<String?>
Retrieves the stored affiliate code from SharedPreferences, if any.
Returns
the saved affiliate code or null.
clearAffiliateData()
static Future<void>
Clears all affiliate-related data from SharedPreferences.
Side Effects
removes multiple keys related to affiliate tracking and logs the action.
AffiliateHelper 5 methods affiliate_helper_stub.dart
Web stub for AffiliateHelper - Affiliate tracking
Methods
checkAndSendInstall()
static Future<void>
Check and send install (no-op on web)
checkAffiliateClick()
static Future<void>
Check affiliate click (no-op on web)
saveInstallToken()
static Future<void>
Save install token (no-op on web)
Parameters
| Name | Type | Description |
|---|---|---|
token |
String |
getStoredCode()
static Future<String?>
Get stored code (always returns null on web)
clearAffiliateData()
static Future<void>
Clear affiliate data (no-op on web)
AstroHelper 52 methods astro_helper.dart
Matrix Helper - Reusable utilities and reference data for astrology This is the SINGLE SOURCE OF TRUTH for all astrological reference data
Methods
getElement()
static String
Get element for a sign
Parameters
| Name | Type | Description |
|---|---|---|
sign |
String |
getModality()
static String
Get modality for a sign
Parameters
| Name | Type | Description |
|---|---|---|
sign |
String |
getRuler()
static String
Get planetary ruler for a sign
Parameters
| Name | Type | Description |
|---|---|---|
sign |
String |
getHouseRuler()
static String
Get house ruler for a sign (1-12)
Parameters
| Name | Type | Description |
|---|---|---|
sign |
String |
getElementPhrase()
static String
Get element phrase for a sign
Parameters
| Name | Type | Description |
|---|---|---|
sign |
String |
getHouseTheme()
static String
Get house theme for a house number (1-12)
Parameters
| Name | Type | Description |
|---|---|---|
houseNumber |
int |
_getOrdinal()
static String
Get ordinal string (1st, 2nd, 3rd, etc.)
Parameters
| Name | Type | Description |
|---|---|---|
n |
int |
getPlanetSymbol()
static String
Get planet symbol
Parameters
| Name | Type | Description |
|---|---|---|
planet |
String |
getPlanetColor()
static Color
Get planet color
Parameters
| Name | Type | Description |
|---|---|---|
planet |
String |
getPlanetImagePath()
static String
Get planet image path
Parameters
| Name | Type | Description |
|---|---|---|
planet |
String | |
isDarkMode |
bool |
getAspectSymbol()
static String
Get aspect symbol
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String |
getAspectColor()
static Color
Get aspect color
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String |
getAspectImagePath()
static String
Get aspect image path
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String | |
isDarkMode |
bool |
adjustOffset()
static void
Adjust date/time for timezone offset (used for API responses)
Parameters
| Name | Type | Description |
|---|---|---|
item |
dynamic | |
offsetMinutes |
int? |
parseApiDate()
static DateTime
Parse date string from API (handles timezone conversion)
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String |
isToday()
static bool
Check if date is today
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatDate()
static String
Format date as M/D/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatDateShort()
static String
Format date as M/D (short)
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatDateWithSuffix()
static String
Format date as "Dec 4th"
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTime()
static String
Format time as "1:48 AM"
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatDateRange()
static String
Format date range as "M/D - M/D"
Parameters
| Name | Type | Description |
|---|---|---|
start |
DateTime | |
end |
DateTime |
_getDaySuffix()
static String
Get day suffix (st, nd, rd, th)
Parameters
| Name | Type | Description |
|---|---|---|
day |
int |
formatDuration()
static String
Format duration between two dates
Parameters
| Name | Type | Description |
|---|---|---|
start |
DateTime | |
end |
DateTime |
fullWords()
static String
Format number of days as duration string
Parameters
| Name | Type | Description |
|---|---|---|
days |
int | |
fullWords |
bool |
daysUntil()
static int
Calculate days until a date
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
daysSince()
static int
Calculate days since a date
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
getTransitStatus()
static TransitStatus
Get transit status: active, upcoming, or past
Parameters
| Name | Type | Description |
|---|---|---|
begins |
DateTime | |
ends |
DateTime |
fullWords()
static DurationInfo
Get duration info for a transit
Parameters
| Name | Type | Description |
|---|---|---|
begins |
DateTime | |
ends |
DateTime | |
fullWords |
bool |
getMoonPhaseImagePath()
static String
Get moon phase image path
Parameters
| Name | Type | Description |
|---|---|---|
segment |
int? |
getMoonPhaseName()
static String
Get moon phase name from segment
Parameters
| Name | Type | Description |
|---|---|---|
segment |
int? |
getTimeAway()
static String
Get time away from now to a given date Returns strings like "In 2 hours", "Happening Now", "Past"
Parameters
| Name | Type | Description |
|---|---|---|
targetDate |
DateTime | |
endDate |
DateTime |
isHappeningNow()
static bool
Check if event is happening now
Parameters
| Name | Type | Description |
|---|---|---|
begins |
DateTime | |
ends |
DateTime |
isPast()
static bool
Check if event is in the past
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
isFuture()
static bool
Check if event is in the future
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTimeRange()
static String
Format time range as "2:30 PM ~ 4:45 PM"
Parameters
| Name | Type | Description |
|---|---|---|
start |
DateTime | |
end |
DateTime |
getAllPlanets()
static List<String>
Get list of all planets (major + asteroids)
isAsteroid()
static bool
Check if a planet is an asteroid
Parameters
| Name | Type | Description |
|---|---|---|
planetName |
String |
isMajorPlanet()
static bool
Check if a planet is a major planet
Parameters
| Name | Type | Description |
|---|---|---|
planetName |
String |
planetToPlacement()
static Placement
Takes a Planet object from horoscope API and converts it to a Placement object used by BigThree and other models. Handles degree/minutes calculation and type conversions.
Parameters
| Name | Type | Description |
|---|---|---|
planet |
Planet | Planet object from horoscope service |
file-level()
static BigThree?
Extract Sun, Moon, and Ascendant from chart data
Parameters
| Name | Type | Description |
|---|---|---|
chartData |
Map<String, dynamic> |
formatPosition()
static String
Format placement as "Sign D°M'"
Parameters
| Name | Type | Description |
|---|---|---|
placement |
Placement |
formatPositionWithSymbol()
static String
Format placement as "D°M' SYMBOL"
Parameters
| Name | Type | Description |
|---|---|---|
placement |
Placement |
formatFullPlacement()
static String
Format placement with house
Parameters
| Name | Type | Description |
|---|---|---|
placement |
Placement |
getSignColor()
static Color
Get color for a sign based on its element from theme Fire → Red, Earth → Green, Air → Yellow, Water → Blue
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext | |
sign |
String |
getSignSymbol()
static String
Get sign symbol (zodiac glyph)
Parameters
| Name | Type | Description |
|---|---|---|
sign |
String |
getExpression()
static String
Get expression trait for a planet (what the planet represents)
Parameters
| Name | Type | Description |
|---|---|---|
planet |
String |
getAspectAction()
static String
Get action trait for an aspect (how the aspect operates)
Parameters
| Name | Type | Description |
|---|---|---|
aspect |
String |
getHouseFocus()
static String
Get focus area for a house (what life area the house represents)
Parameters
| Name | Type | Description |
|---|---|---|
houseNumber |
int |
showSymbol()
static String
Format astrological degrees and minutes Examples: 15.5° with minutes → "15°30'", without minutes → "15°"
Parameters
| Name | Type | Description |
|---|---|---|
degree |
double | |
showSymbol |
bool | |
showMinutes |
bool |
isValidDegree()
static bool
Check if a degree value is valid for astrological use (0-30)
Parameters
| Name | Type | Description |
|---|---|---|
degree |
double |
getSignTheme()
static String
Get theme/keyword for a sign
Parameters
| Name | Type | Description |
|---|---|---|
sign |
String |
computePlanetTheme()
static String
Compute combined planet theme
ImageDisplayConfig 7 methods component_image_helper.dart
Image display configuration for different component types
Methods
getImageUrl()
static String
Get image URL for any component type Automatically detects tarot cards and uses appropriate URL builder For tarot cards: - Delegates to TarotImageHelper - Returns: https://astromatrix.app/images/{deck}/{category}/{cardName}.jpg For regular components: - Uses standard component image path with -sm suffix - Returns: https://astromatrix.app/images/{path}-sm.jpg
getIconUrl()
static String
Get icon URL for component summary cards (same as getImageUrl)
getFullImageUrl()
static String
Get full-size image URL (no -sm suffix)
isTarotCategory()
static bool
Check if category is tarot-related
Parameters
| Name | Type | Description |
|---|---|---|
category |
String |
getDisplayConfig()
static ImageDisplayConfig
Get display configuration for a component category
Parameters
| Name | Type | Description |
|---|---|---|
category |
String |
getImageUrlWithConfig()
static ImageUrlResult
Get both URL and display config together
_buildStandardImageUrl()
static String
Build standard component image URL (shared logic) This is the ONLY place we handle standard component images
ComponentImageHelper 7 methods component_image_helper.dart
Unified image URL helper for all component types Handles both standard components (planets, signs, etc.) AND tarot cards Delegates tarot image handling to TarotImageHelper to avoid duplication 🐛 DEBUG VERSION - Contains extensive logging for troubleshooting
Methods
getImageUrl()
static String
Get image URL for any component type Automatically detects tarot cards and uses appropriate URL builder For tarot cards: - Delegates to TarotImageHelper - Returns: https://astromatrix.app/images/{deck}/{category}/{cardName}.jpg For regular components: - Uses standard component image path with -sm suffix - Returns: https://astromatrix.app/images/{path}-sm.jpg
getIconUrl()
static String
Get icon URL for component summary cards (same as getImageUrl)
getFullImageUrl()
static String
Get full-size image URL (no -sm suffix)
isTarotCategory()
static bool
Check if category is tarot-related
Parameters
| Name | Type | Description |
|---|---|---|
category |
String |
getDisplayConfig()
static ImageDisplayConfig
Get display configuration for a component category
Parameters
| Name | Type | Description |
|---|---|---|
category |
String |
getImageUrlWithConfig()
static ImageUrlResult
Get both URL and display config together
_buildStandardImageUrl()
static String
Build standard component image URL (shared logic) This is the ONLY place we handle standard component images
AppDateUtils 39 methods date_utils.dart
Comprehensive date, time, and timezone utility functions for parsing, formatting, and manipulating date/time data and timezone offsets.
Methods
parseTimeComprehensive()
static TimeComponents
Parse time string with comprehensive AM/PM support Handles: "14:30", "2:30 PM", "02:30:00" Returns hour in 24-hour format and minute Returns 12:00 (noon) as default if parsing fails
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
parseOffsetToMinutes()
static String
Parse timezone offset to minutes as string Handles: "UTC+01:00", "UTC-05:30", "+5.5", "-300", "300", "60.0" Returns offset in minutes as string (e.g., "-180" or "60")
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String |
formatTime12HourWithPeriod()
static String
Format time in 12-hour format with AM/PM period Example: formatTime12HourWithPeriod(14, 30) → "2:30 PM"
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int | |
minute |
int |
_isUSLocale()
static bool
Determines if the current locale uses US date format (MM/DD/YYYY) vs EU (DD/MM/YYYY) US format: en_US, en_CA All others default to DD/MM/YYYY
formatDateLocale()
static String
Format date according to user's locale US: MM/DD/YYYY EU/other: DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
getLocaleDateFormat()
static DateFormat
Get localized DateFormat for display (not for API) US: 'MM/dd/yyyy' EU/other: 'dd/MM/yyyy'
getLocaleDateFormatHint()
static String
Get localized date picker format hint
getCurrentDateTime()
static DateTimeComponents
Get current date and time components
format12Hour()
static int
Format hour in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int |
file-level()
static DateTime?
Parse date string in format YYYY-MM-DD
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
file-level()
static TimeComponents?
Parse time string in format HH:MM
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
formatDate()
static String
Format date as MM/DD/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatDateDDMMYYYY()
static String
Format date as DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTime12Hour()
static String
Format time in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour |
int | |
minute |
int |
getCurrentMonthYear()
static String
Get current month and year formatted
formatMonthYear()
static String
Format month and year (e.g., "January 2025")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Convert date and time components to DateTime
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? | |
timeStr |
String? |
formatDateWithSuffix()
static String
Format date with ordinal suffix (e.g., "Jan 5th", "Feb 22nd")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
_getDaySuffix()
static String
Get day suffix (st, nd, rd, th)
Parameters
| Name | Type | Description |
|---|---|---|
day |
int |
file-level()
static String?
Format time if present (returns null if time is midnight)
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
file-level()
static DateTime?
Parse date from various formats
Parameters
| Name | Type | Description |
|---|---|---|
value |
dynamic |
formatDateForApi()
static String
Format date for API calls (MM/DD/YYYY) Used when sending dates to astrology calculation API NOTE: Always uses MM/DD/YYYY regardless of user locale
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTimeForApi()
static String
Format time for API calls (HH:MM in 24-hour format) Used when sending times to astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Parse date from API response (MM/DD/YYYY format) Used when receiving dates from astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
combineDateTime()
static DateTime
Combine date and time components into single DateTime
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | |
time |
TimeOfDay |
getCurrentDateForApi()
static String
Get current date formatted for API
getCurrentTimeForApi()
static String
Get current time formatted for API
formatDateTimeForApi()
static Map<String, String>
Format DateTime for API (combines date and time) Returns a map with 'date' and 'time' keys
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
getTimeOffset()
static String
Returns the provided offset string or the default value as a string when the offset is null or empty.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String? | nullable offset string |
defaultValue |
int | fallback integer value returned as string when offset is null/empty |
Returns
offset string or defaultValue as string
parseOffset()
static double
Parses a timezone offset string (e.g., "+5.5", "-8", "5:30") into a double representing hours.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to parse |
Returns
numeric offset in hours, or 0.0 if parsing fails
formatOffset()
static String
Formats a numeric offset as a signed string with one decimal place (e.g., "+5.5", "-0.5").
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
Returns
formatted offset string with sign
offsetToComponents()
static OffsetComponents
Converts a numeric offset into hours and minutes components and a sign indicator.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
formatGMT()
static String
Formats an offset string into a GMT representation like "GMT+5:30".
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to format |
Returns
GMT formatted offset string
isDSTActive()
static bool
Determines whether Daylight Saving Time is active for the given date and zone. Note: This is a simplified placeholder and always returns false; use a timezone library for production.
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | date to check for DST |
zoneName |
String | timezone identifier (e.g., "America/New_York") |
Returns
true if DST is considered active (always false in this implementation)
applyDST()
static String
Applies a DST adjustment to the given offset string by adding one hour when isDST is true.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to adjust |
isDST |
bool | whether DST is active |
Returns
adjusted offset string (unchanged if isDST is false)
getOrdinal()
static String
Get ordinal suffix for a number (1st, 2nd, 3rd, 4th, etc.) Used for formatting house numbers and other ordinal displays
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getOrdinalSuffix()
static String
Get just the suffix without the number
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getMonthName()
static String
Get month name by number (1-12)
Parameters
| Name | Type | Description |
|---|---|---|
month |
int |
getMonthNumber()
static int
Get month number by name (case-insensitive)
Parameters
| Name | Type | Description |
|---|---|---|
monthName |
String |
DateTimeComponents 39 methods date_utils.dart
Date and time components
Methods
parseTimeComprehensive()
static TimeComponents
Parse time string with comprehensive AM/PM support Handles: "14:30", "2:30 PM", "02:30:00" Returns hour in 24-hour format and minute Returns 12:00 (noon) as default if parsing fails
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
parseOffsetToMinutes()
static String
Parse timezone offset to minutes as string Handles: "UTC+01:00", "UTC-05:30", "+5.5", "-300", "300", "60.0" Returns offset in minutes as string (e.g., "-180" or "60")
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String |
formatTime12HourWithPeriod()
static String
Format time in 12-hour format with AM/PM period Example: formatTime12HourWithPeriod(14, 30) → "2:30 PM"
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int | |
minute |
int |
_isUSLocale()
static bool
Determines if the current locale uses US date format (MM/DD/YYYY) vs EU (DD/MM/YYYY) US format: en_US, en_CA All others default to DD/MM/YYYY
formatDateLocale()
static String
Format date according to user's locale US: MM/DD/YYYY EU/other: DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
getLocaleDateFormat()
static DateFormat
Get localized DateFormat for display (not for API) US: 'MM/dd/yyyy' EU/other: 'dd/MM/yyyy'
getLocaleDateFormatHint()
static String
Get localized date picker format hint
getCurrentDateTime()
static DateTimeComponents
Get current date and time components
format12Hour()
static int
Format hour in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int |
file-level()
static DateTime?
Parse date string in format YYYY-MM-DD
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
file-level()
static TimeComponents?
Parse time string in format HH:MM
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
formatDate()
static String
Format date as MM/DD/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatDateDDMMYYYY()
static String
Format date as DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTime12Hour()
static String
Format time in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour |
int | |
minute |
int |
getCurrentMonthYear()
static String
Get current month and year formatted
formatMonthYear()
static String
Format month and year (e.g., "January 2025")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Convert date and time components to DateTime
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? | |
timeStr |
String? |
formatDateWithSuffix()
static String
Format date with ordinal suffix (e.g., "Jan 5th", "Feb 22nd")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
_getDaySuffix()
static String
Get day suffix (st, nd, rd, th)
Parameters
| Name | Type | Description |
|---|---|---|
day |
int |
file-level()
static String?
Format time if present (returns null if time is midnight)
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
file-level()
static DateTime?
Parse date from various formats
Parameters
| Name | Type | Description |
|---|---|---|
value |
dynamic |
formatDateForApi()
static String
Format date for API calls (MM/DD/YYYY) Used when sending dates to astrology calculation API NOTE: Always uses MM/DD/YYYY regardless of user locale
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTimeForApi()
static String
Format time for API calls (HH:MM in 24-hour format) Used when sending times to astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Parse date from API response (MM/DD/YYYY format) Used when receiving dates from astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
combineDateTime()
static DateTime
Combine date and time components into single DateTime
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | |
time |
TimeOfDay |
getCurrentDateForApi()
static String
Get current date formatted for API
getCurrentTimeForApi()
static String
Get current time formatted for API
formatDateTimeForApi()
static Map<String, String>
Format DateTime for API (combines date and time) Returns a map with 'date' and 'time' keys
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
getTimeOffset()
static String
Returns the provided offset string or the default value as a string when the offset is null or empty.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String? | nullable offset string |
defaultValue |
int | fallback integer value returned as string when offset is null/empty |
Returns
offset string or defaultValue as string
parseOffset()
static double
Parses a timezone offset string (e.g., "+5.5", "-8", "5:30") into a double representing hours.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to parse |
Returns
numeric offset in hours, or 0.0 if parsing fails
formatOffset()
static String
Formats a numeric offset as a signed string with one decimal place (e.g., "+5.5", "-0.5").
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
Returns
formatted offset string with sign
offsetToComponents()
static OffsetComponents
Converts a numeric offset into hours and minutes components and a sign indicator.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
formatGMT()
static String
Formats an offset string into a GMT representation like "GMT+5:30".
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to format |
Returns
GMT formatted offset string
isDSTActive()
static bool
Determines whether Daylight Saving Time is active for the given date and zone. Note: This is a simplified placeholder and always returns false; use a timezone library for production.
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | date to check for DST |
zoneName |
String | timezone identifier (e.g., "America/New_York") |
Returns
true if DST is considered active (always false in this implementation)
applyDST()
static String
Applies a DST adjustment to the given offset string by adding one hour when isDST is true.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to adjust |
isDST |
bool | whether DST is active |
Returns
adjusted offset string (unchanged if isDST is false)
getOrdinal()
static String
Get ordinal suffix for a number (1st, 2nd, 3rd, 4th, etc.) Used for formatting house numbers and other ordinal displays
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getOrdinalSuffix()
static String
Get just the suffix without the number
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getMonthName()
static String
Get month name by number (1-12)
Parameters
| Name | Type | Description |
|---|---|---|
month |
int |
getMonthNumber()
static int
Get month number by name (case-insensitive)
Parameters
| Name | Type | Description |
|---|---|---|
monthName |
String |
TimeComponents 39 methods date_utils.dart
Time components
Methods
parseTimeComprehensive()
static TimeComponents
Parse time string with comprehensive AM/PM support Handles: "14:30", "2:30 PM", "02:30:00" Returns hour in 24-hour format and minute Returns 12:00 (noon) as default if parsing fails
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
parseOffsetToMinutes()
static String
Parse timezone offset to minutes as string Handles: "UTC+01:00", "UTC-05:30", "+5.5", "-300", "300", "60.0" Returns offset in minutes as string (e.g., "-180" or "60")
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String |
formatTime12HourWithPeriod()
static String
Format time in 12-hour format with AM/PM period Example: formatTime12HourWithPeriod(14, 30) → "2:30 PM"
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int | |
minute |
int |
_isUSLocale()
static bool
Determines if the current locale uses US date format (MM/DD/YYYY) vs EU (DD/MM/YYYY) US format: en_US, en_CA All others default to DD/MM/YYYY
formatDateLocale()
static String
Format date according to user's locale US: MM/DD/YYYY EU/other: DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
getLocaleDateFormat()
static DateFormat
Get localized DateFormat for display (not for API) US: 'MM/dd/yyyy' EU/other: 'dd/MM/yyyy'
getLocaleDateFormatHint()
static String
Get localized date picker format hint
getCurrentDateTime()
static DateTimeComponents
Get current date and time components
format12Hour()
static int
Format hour in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int |
file-level()
static DateTime?
Parse date string in format YYYY-MM-DD
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
file-level()
static TimeComponents?
Parse time string in format HH:MM
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
formatDate()
static String
Format date as MM/DD/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatDateDDMMYYYY()
static String
Format date as DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTime12Hour()
static String
Format time in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour |
int | |
minute |
int |
getCurrentMonthYear()
static String
Get current month and year formatted
formatMonthYear()
static String
Format month and year (e.g., "January 2025")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Convert date and time components to DateTime
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? | |
timeStr |
String? |
formatDateWithSuffix()
static String
Format date with ordinal suffix (e.g., "Jan 5th", "Feb 22nd")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
_getDaySuffix()
static String
Get day suffix (st, nd, rd, th)
Parameters
| Name | Type | Description |
|---|---|---|
day |
int |
file-level()
static String?
Format time if present (returns null if time is midnight)
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
file-level()
static DateTime?
Parse date from various formats
Parameters
| Name | Type | Description |
|---|---|---|
value |
dynamic |
formatDateForApi()
static String
Format date for API calls (MM/DD/YYYY) Used when sending dates to astrology calculation API NOTE: Always uses MM/DD/YYYY regardless of user locale
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTimeForApi()
static String
Format time for API calls (HH:MM in 24-hour format) Used when sending times to astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Parse date from API response (MM/DD/YYYY format) Used when receiving dates from astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
combineDateTime()
static DateTime
Combine date and time components into single DateTime
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | |
time |
TimeOfDay |
getCurrentDateForApi()
static String
Get current date formatted for API
getCurrentTimeForApi()
static String
Get current time formatted for API
formatDateTimeForApi()
static Map<String, String>
Format DateTime for API (combines date and time) Returns a map with 'date' and 'time' keys
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
getTimeOffset()
static String
Returns the provided offset string or the default value as a string when the offset is null or empty.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String? | nullable offset string |
defaultValue |
int | fallback integer value returned as string when offset is null/empty |
Returns
offset string or defaultValue as string
parseOffset()
static double
Parses a timezone offset string (e.g., "+5.5", "-8", "5:30") into a double representing hours.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to parse |
Returns
numeric offset in hours, or 0.0 if parsing fails
formatOffset()
static String
Formats a numeric offset as a signed string with one decimal place (e.g., "+5.5", "-0.5").
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
Returns
formatted offset string with sign
offsetToComponents()
static OffsetComponents
Converts a numeric offset into hours and minutes components and a sign indicator.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
formatGMT()
static String
Formats an offset string into a GMT representation like "GMT+5:30".
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to format |
Returns
GMT formatted offset string
isDSTActive()
static bool
Determines whether Daylight Saving Time is active for the given date and zone. Note: This is a simplified placeholder and always returns false; use a timezone library for production.
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | date to check for DST |
zoneName |
String | timezone identifier (e.g., "America/New_York") |
Returns
true if DST is considered active (always false in this implementation)
applyDST()
static String
Applies a DST adjustment to the given offset string by adding one hour when isDST is true.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to adjust |
isDST |
bool | whether DST is active |
Returns
adjusted offset string (unchanged if isDST is false)
getOrdinal()
static String
Get ordinal suffix for a number (1st, 2nd, 3rd, 4th, etc.) Used for formatting house numbers and other ordinal displays
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getOrdinalSuffix()
static String
Get just the suffix without the number
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getMonthName()
static String
Get month name by number (1-12)
Parameters
| Name | Type | Description |
|---|---|---|
month |
int |
getMonthNumber()
static int
Get month number by name (case-insensitive)
Parameters
| Name | Type | Description |
|---|---|---|
monthName |
String |
OffsetComponents 39 methods date_utils.dart
Data class representing hours and minutes components of a timezone offset.
Methods
parseTimeComprehensive()
static TimeComponents
Parse time string with comprehensive AM/PM support Handles: "14:30", "2:30 PM", "02:30:00" Returns hour in 24-hour format and minute Returns 12:00 (noon) as default if parsing fails
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
parseOffsetToMinutes()
static String
Parse timezone offset to minutes as string Handles: "UTC+01:00", "UTC-05:30", "+5.5", "-300", "300", "60.0" Returns offset in minutes as string (e.g., "-180" or "60")
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String |
formatTime12HourWithPeriod()
static String
Format time in 12-hour format with AM/PM period Example: formatTime12HourWithPeriod(14, 30) → "2:30 PM"
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int | |
minute |
int |
_isUSLocale()
static bool
Determines if the current locale uses US date format (MM/DD/YYYY) vs EU (DD/MM/YYYY) US format: en_US, en_CA All others default to DD/MM/YYYY
formatDateLocale()
static String
Format date according to user's locale US: MM/DD/YYYY EU/other: DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
getLocaleDateFormat()
static DateFormat
Get localized DateFormat for display (not for API) US: 'MM/dd/yyyy' EU/other: 'dd/MM/yyyy'
getLocaleDateFormatHint()
static String
Get localized date picker format hint
getCurrentDateTime()
static DateTimeComponents
Get current date and time components
format12Hour()
static int
Format hour in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int |
file-level()
static DateTime?
Parse date string in format YYYY-MM-DD
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
file-level()
static TimeComponents?
Parse time string in format HH:MM
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
formatDate()
static String
Format date as MM/DD/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatDateDDMMYYYY()
static String
Format date as DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTime12Hour()
static String
Format time in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour |
int | |
minute |
int |
getCurrentMonthYear()
static String
Get current month and year formatted
formatMonthYear()
static String
Format month and year (e.g., "January 2025")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Convert date and time components to DateTime
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? | |
timeStr |
String? |
formatDateWithSuffix()
static String
Format date with ordinal suffix (e.g., "Jan 5th", "Feb 22nd")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
_getDaySuffix()
static String
Get day suffix (st, nd, rd, th)
Parameters
| Name | Type | Description |
|---|---|---|
day |
int |
file-level()
static String?
Format time if present (returns null if time is midnight)
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
file-level()
static DateTime?
Parse date from various formats
Parameters
| Name | Type | Description |
|---|---|---|
value |
dynamic |
formatDateForApi()
static String
Format date for API calls (MM/DD/YYYY) Used when sending dates to astrology calculation API NOTE: Always uses MM/DD/YYYY regardless of user locale
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTimeForApi()
static String
Format time for API calls (HH:MM in 24-hour format) Used when sending times to astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Parse date from API response (MM/DD/YYYY format) Used when receiving dates from astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
combineDateTime()
static DateTime
Combine date and time components into single DateTime
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | |
time |
TimeOfDay |
getCurrentDateForApi()
static String
Get current date formatted for API
getCurrentTimeForApi()
static String
Get current time formatted for API
formatDateTimeForApi()
static Map<String, String>
Format DateTime for API (combines date and time) Returns a map with 'date' and 'time' keys
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
getTimeOffset()
static String
Returns the provided offset string or the default value as a string when the offset is null or empty.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String? | nullable offset string |
defaultValue |
int | fallback integer value returned as string when offset is null/empty |
Returns
offset string or defaultValue as string
parseOffset()
static double
Parses a timezone offset string (e.g., "+5.5", "-8", "5:30") into a double representing hours.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to parse |
Returns
numeric offset in hours, or 0.0 if parsing fails
formatOffset()
static String
Formats a numeric offset as a signed string with one decimal place (e.g., "+5.5", "-0.5").
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
Returns
formatted offset string with sign
offsetToComponents()
static OffsetComponents
Converts a numeric offset into hours and minutes components and a sign indicator.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
formatGMT()
static String
Formats an offset string into a GMT representation like "GMT+5:30".
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to format |
Returns
GMT formatted offset string
isDSTActive()
static bool
Determines whether Daylight Saving Time is active for the given date and zone. Note: This is a simplified placeholder and always returns false; use a timezone library for production.
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | date to check for DST |
zoneName |
String | timezone identifier (e.g., "America/New_York") |
Returns
true if DST is considered active (always false in this implementation)
applyDST()
static String
Applies a DST adjustment to the given offset string by adding one hour when isDST is true.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to adjust |
isDST |
bool | whether DST is active |
Returns
adjusted offset string (unchanged if isDST is false)
getOrdinal()
static String
Get ordinal suffix for a number (1st, 2nd, 3rd, 4th, etc.) Used for formatting house numbers and other ordinal displays
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getOrdinalSuffix()
static String
Get just the suffix without the number
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getMonthName()
static String
Get month name by number (1-12)
Parameters
| Name | Type | Description |
|---|---|---|
month |
int |
getMonthNumber()
static int
Get month number by name (case-insensitive)
Parameters
| Name | Type | Description |
|---|---|---|
monthName |
String |
MonthConstants 39 methods date_utils.dart
Constants for month names and related utilities
Methods
parseTimeComprehensive()
static TimeComponents
Parse time string with comprehensive AM/PM support Handles: "14:30", "2:30 PM", "02:30:00" Returns hour in 24-hour format and minute Returns 12:00 (noon) as default if parsing fails
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
parseOffsetToMinutes()
static String
Parse timezone offset to minutes as string Handles: "UTC+01:00", "UTC-05:30", "+5.5", "-300", "300", "60.0" Returns offset in minutes as string (e.g., "-180" or "60")
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String |
formatTime12HourWithPeriod()
static String
Format time in 12-hour format with AM/PM period Example: formatTime12HourWithPeriod(14, 30) → "2:30 PM"
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int | |
minute |
int |
_isUSLocale()
static bool
Determines if the current locale uses US date format (MM/DD/YYYY) vs EU (DD/MM/YYYY) US format: en_US, en_CA All others default to DD/MM/YYYY
formatDateLocale()
static String
Format date according to user's locale US: MM/DD/YYYY EU/other: DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
getLocaleDateFormat()
static DateFormat
Get localized DateFormat for display (not for API) US: 'MM/dd/yyyy' EU/other: 'dd/MM/yyyy'
getLocaleDateFormatHint()
static String
Get localized date picker format hint
getCurrentDateTime()
static DateTimeComponents
Get current date and time components
format12Hour()
static int
Format hour in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour24 |
int |
file-level()
static DateTime?
Parse date string in format YYYY-MM-DD
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
file-level()
static TimeComponents?
Parse time string in format HH:MM
Parameters
| Name | Type | Description |
|---|---|---|
timeStr |
String? |
formatDate()
static String
Format date as MM/DD/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatDateDDMMYYYY()
static String
Format date as DD/MM/YYYY
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTime12Hour()
static String
Format time in 12-hour format
Parameters
| Name | Type | Description |
|---|---|---|
hour |
int | |
minute |
int |
getCurrentMonthYear()
static String
Get current month and year formatted
formatMonthYear()
static String
Format month and year (e.g., "January 2025")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Convert date and time components to DateTime
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? | |
timeStr |
String? |
formatDateWithSuffix()
static String
Format date with ordinal suffix (e.g., "Jan 5th", "Feb 22nd")
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
_getDaySuffix()
static String
Get day suffix (st, nd, rd, th)
Parameters
| Name | Type | Description |
|---|---|---|
day |
int |
file-level()
static String?
Format time if present (returns null if time is midnight)
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
file-level()
static DateTime?
Parse date from various formats
Parameters
| Name | Type | Description |
|---|---|---|
value |
dynamic |
formatDateForApi()
static String
Format date for API calls (MM/DD/YYYY) Used when sending dates to astrology calculation API NOTE: Always uses MM/DD/YYYY regardless of user locale
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
formatTimeForApi()
static String
Format time for API calls (HH:MM in 24-hour format) Used when sending times to astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
file-level()
static DateTime?
Parse date from API response (MM/DD/YYYY format) Used when receiving dates from astrology calculation API
Parameters
| Name | Type | Description |
|---|---|---|
dateStr |
String? |
combineDateTime()
static DateTime
Combine date and time components into single DateTime
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | |
time |
TimeOfDay |
getCurrentDateForApi()
static String
Get current date formatted for API
getCurrentTimeForApi()
static String
Get current time formatted for API
formatDateTimeForApi()
static Map<String, String>
Format DateTime for API (combines date and time) Returns a map with 'date' and 'time' keys
Parameters
| Name | Type | Description |
|---|---|---|
dateTime |
DateTime |
getTimeOffset()
static String
Returns the provided offset string or the default value as a string when the offset is null or empty.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String? | nullable offset string |
defaultValue |
int | fallback integer value returned as string when offset is null/empty |
Returns
offset string or defaultValue as string
parseOffset()
static double
Parses a timezone offset string (e.g., "+5.5", "-8", "5:30") into a double representing hours.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to parse |
Returns
numeric offset in hours, or 0.0 if parsing fails
formatOffset()
static String
Formats a numeric offset as a signed string with one decimal place (e.g., "+5.5", "-0.5").
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
Returns
formatted offset string with sign
offsetToComponents()
static OffsetComponents
Converts a numeric offset into hours and minutes components and a sign indicator.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
double | numeric offset in hours |
formatGMT()
static String
Formats an offset string into a GMT representation like "GMT+5:30".
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to format |
Returns
GMT formatted offset string
isDSTActive()
static bool
Determines whether Daylight Saving Time is active for the given date and zone. Note: This is a simplified placeholder and always returns false; use a timezone library for production.
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime | date to check for DST |
zoneName |
String | timezone identifier (e.g., "America/New_York") |
Returns
true if DST is considered active (always false in this implementation)
applyDST()
static String
Applies a DST adjustment to the given offset string by adding one hour when isDST is true.
Parameters
| Name | Type | Description |
|---|---|---|
offset |
String | offset string to adjust |
isDST |
bool | whether DST is active |
Returns
adjusted offset string (unchanged if isDST is false)
getOrdinal()
static String
Get ordinal suffix for a number (1st, 2nd, 3rd, 4th, etc.) Used for formatting house numbers and other ordinal displays
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getOrdinalSuffix()
static String
Get just the suffix without the number
Parameters
| Name | Type | Description |
|---|---|---|
number |
int |
getMonthName()
static String
Get month name by number (1-12)
Parameters
| Name | Type | Description |
|---|---|---|
month |
int |
getMonthNumber()
static int
Get month number by name (case-insensitive)
Parameters
| Name | Type | Description |
|---|---|---|
monthName |
String |
SystemNotifier 3 methods system_notifier.dart
A global notifier for system-level feedback (network issues, server errors, etc.) Automatically adapts to light/dark mode and supports both Snack + Dialog modes.
Methods
showGlobalFeedback()
static Future<void>
Unified feedback entry point that displays a translated message as a SnackBar or Dialog.
Returns
A Future that completes when a dialog is dismissed or snackbar is queued.
Side Effects
May show a SnackBar or present a Dialog.
_showSnack()
static void
Internal helper that clears existing SnackBars and shows a new SnackBar via the global messenger.
Parameters
| Name | Type | Description |
|---|---|---|
message |
String | Translated message text to display. |
type |
SnackType | Severity type used to build the Snack UI. |
Side Effects
Clears existing SnackBars and enqueues a new one.
_showDialog()
static Future<void>
Internal helper that presents an AlertDialog using the provided BuildContext with icon and title derived from [type].
Returns
A Future that completes when the dialog is dismissed.
Side Effects
Pushes a dialog route onto the Navigator.
UrlLauncherHelper 2 methods url_launcher_helper.dart
Helper to handle all external URL launching with strict whitelisting. This prevents Google Play "Device and Network Abuse" violations by ensuring the app doesn't accidentally launch a URL that could lead to an external APK download.
Methods
mode()
static Future<void>
Launches a URL only if it's considered safe.
Parameters
| Name | Type | Description |
|---|---|---|
uri |
Uri | |
mode |
LaunchMode |
isSafe()
static bool
Checks if a URL is safe to launch based on scheme, host, and file extension.
Parameters
| Name | Type | Description |
|---|---|---|
uri |
Uri |
ENUMS
ReportType app_constants.dart
Enumeration of supported report types for generating astrological reports. Use ReportType to select the kind of calculation or report generation.
Values
nameRequireddateTimeRequiredlocationRequiredchartErrordeleteProfileConfirmdeleteHistoryConfirmclearHistoryConfirmlocationErrorreportError
LocationType app_constants.dart
Enumeration for location context used in forms and API calls.
Values
nameRequireddateTimeRequiredlocationRequiredchartErrordeleteProfileConfirmdeleteHistoryConfirmclearHistoryConfirmlocationErrorreportError
ChartType chart_payload.dart
Enumeration of chart types supported by the application and their JSON string mappings. Purpose: - Represents the type of astrological chart being requested or processed.
Used By Services
- ChartService.getChartTypeLabel() chart_service.dart
- ChartService.getChartTitles() chart_service.dart
- ChartService.shouldShowTransits() chart_service.dart
- ChartService.shouldShowHouses() chart_service.dart
- ChartService.shouldShowDeclinations() chart_service.dart
- ChartService.needsSecondUser() chart_service.dart
- HoroscopeService.chartType() horoscope_service.dart
- ReportService report_service.dart
Used By Widgets
- ChartScreen chart_screen.dart
- JournalListWidget journal_widgets.dart
LocationType location_service.dart
Location type enumeration
Values
_searchDebounceDuration
SnackType feedback.dart
Different categories of feedback messages
InfoRowLayout form_controls.dart
Display-only information row with label and value. Use for read-only information display.
Values
iconWidget
ButtonType ui_components.dart
Semantic variants for AppButton to select visual style and intent.
SymbolType astro_helper.dart
Symbol type for buildSymbolImage
Values
signs
IconPattern astrology_guide.dart
Icon pattern for category items
IconPattern astrology_guide_tabs.dart
Icon pattern for category items (from astrology_guide.dart)
HeaderDateStepUnit user_header.dart
=============================================================== USER HEADER CONFIGURATION =============================================================== Auto-configures what to show based on chart/matrix type
Values
config
HomeCardType home_card.dart
Type of home header card to display
PlanetaryHoursLayout planetary_hours_widget.dart
Layout style for planetary hours list
FUNCTIONS
loadMoonImageFromAssets() MoonImageHelper.java
Load a moon image from assets by extracting the image number from URL Example: "https://astromatrix.app/symbols/moon-17.gif" -> loads "moon_images/moon_17.png"
Parameters
| Name | Type |
|---|---|
context |
Context |
imageUrl |
String |
Returns
public static Bitmap
Returns: Bitmap
extractFileName() MoonImageHelper.java
Extract filename from URL and convert to asset name "https://astromatrix.app/symbols/moon-17.gif" -> "moon_17.png" "https://astromatrix.app/symbols/moon-0.png" -> "moon_0.png"
Parameters
| Name | Type |
|---|---|
imageUrl |
String |
Returns
private static String
resizeBitmap() MoonImageHelper.java
Resize bitmap to save memory
Parameters
| Name | Type |
|---|---|
bitmap |
Bitmap |
width |
int |
height |
int |
Returns
private static Bitmap
Returns: Bitmap
loadLocalImage() MoonWidget.java
✅ NEW: Load image from local assets instead of SharedPreferences cache
Parameters
| Name | Type |
|---|---|
context |
Context |
remoteViews |
RemoteViews |
imageUrl |
String |
imageViewId |
int |
Returns
private void
loadLocalImageSync() MoonWidget.java
✅ NEW: Load image from local assets synchronously Replaces the old downloadAndCacheImage method
Parameters
| Name | Type |
|---|---|
context |
Context |
remoteViews |
RemoteViews |
imageUrl |
String |
imageViewId |
int |
Returns
private static void
schedulePeriodicWork() MoonWidgetScheduler.java
Schedule periodic work to update the widget every 15 minutes
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
public static void
cancelPeriodicWork() MoonWidgetScheduler.java
Cancel periodic work when widget is disabled
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
public static void
shouldFetchNewData() MoonWidgetWorker.java
Check if we should fetch new data based on last update time
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
private boolean
notifyDataChanged() PlanetaryWidget.java
Notify all widgets that data has changed
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
private void
shouldFetchNewData() PlanetaryWidget.java
Check if we should fetch new data (minimum 1 hour interval)
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
private boolean
schedulePeriodicWork() PlanetaryWidgetScheduler.java
Schedule periodic work to check for updates every 15 minutes (Actual API calls are rate-limited to 15 minutes inside the worker)
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
public static void
cancelPeriodicWork() PlanetaryWidgetScheduler.java
Cancel periodic work when widget is disabled
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
public static void
loadPlanetaryData() PlanetaryWidgetService.java
Load planetary data from SharedPreferences cache
Returns
private void
formatTo12HourTime() PlanetaryWidgetService.java
Format UTC time string to 12-hour local time
Parameters
| Name | Type |
|---|---|
utcTime |
String |
Returns
private String
isCurrentTimeInRange() PlanetaryWidgetService.java
Check if current time is within the given UTC time range
Parameters
| Name | Type |
|---|---|
startTime |
String |
endTime |
String |
Returns
private boolean
loadBitmapAsync() PlanetaryWidgetService.java
Load bitmap asynchronously
Parameters
| Name | Type |
|---|---|
url |
String |
callback |
BitmapCallback |
Returns
private void
shouldFetchNewData() PlanetaryWidgetWorker.java
Check if we should fetch new data (15 minutes interval)
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
private boolean
scheduleExactUpdate() PlanetaryWidgetWorker.java
Schedule update at exact planetary hour change
Parameters
| Name | Type |
|---|---|
context |
Context |
startTime |
String |
Returns
public static void
updateWidgetFromCache() PlanetaryWidgetWorker.java
Update widget from cached data (no API call)
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
public static void
fetchPlanetaryData() PlanetaryWidgetWorker.java
Fetch planetary data from API (called only when needed - every 15 minutes)
Parameters
| Name | Type |
|---|---|
context |
Context |
Returns
public static void
findNextPlanetaryHourStart() PlanetaryWidgetWorker.java
Find the next planetary hour start time
Parameters
| Name | Type |
|---|---|
planetHours |
PlanetHour |
Returns
private static String
getClient() SabianWidget.java
Returns the singleton instance of RBApiInterface.
Returns
public static RBApiInterface
Returns: RBApiInterface
getViewLimitForSession() content_gating_config.dart
Get the view limit for a given session count Returns the appropriate limit based on progressive tightening
Parameters
| Name | Type |
|---|---|
sessionCount |
int |
Returns
static int
initialize() deep_link_service_mobile.dart
Initialize the deep link service
Returns
Future<void>
_checkPendingAffiliateDiscount() deep_link_service_mobile.dart
🆕 Check if there's a pending affiliate discount from install Loads a pending flag from SharedPreferences and, if present, validates and applies the affiliate code.
Returns
Future<void>
_initDeepLinks() deep_link_service_mobile.dart
Initialize deep links
Returns
Future<void>
_handleAffiliateLink() deep_link_service_mobile.dart
Handle incoming deep links
Parameters
| Name | Type |
|---|---|
url |
String |
Returns
Future<void>
_handleAffiliateLink() deep_link_service_mobile.dart
Handle affiliate discount links
Parameters
| Name | Type |
|---|---|
url |
String |
Returns
Future<void>
_loadAffiliateCode() deep_link_service_mobile.dart
Load affiliate code from SharedPreferences
Returns
Future<void>
_saveAffiliateCode() deep_link_service_mobile.dart
Save affiliate code to SharedPreferences
Parameters
| Name | Type |
|---|---|
code |
String |
Returns
Future<void>
_validateAffiliateCode() deep_link_service_mobile.dart
Validate affiliate code
Parameters
| Name | Type |
|---|---|
code |
String |
Returns
Future<bool>
_notifyWebViewDiscountApplied() deep_link_service_mobile.dart
Notify web view about discount applied
Returns
void
updateUserInfo() deep_link_service_mobile.dart
Update user and device info
Parameters
| Name | Type |
|---|---|
userId |
String? |
deviceInfoId |
String? |
Returns
void
dispose() deep_link_service_mobile.dart
Dispose resources
Returns
void
call() local_api_bridge_mobile.dart
Unified GET/POST mimic API call
Returns
static Map<String, dynamic>
setupServiceLocator() service_locator.dart
Initializes storage and registers core application services into the GetIt locator.
Returns
Future<void>
Description
Future<void> that completes when initialization and registrations are finished.
resetServiceLocator() service_locator.dart
Unregisters all services from the global GetIt instance and resets the dependency injection state.
Returns
Future<void>
Description
Future<void> that completes when the reset is finished.
hasTag() video.dart
Check if video has a specific tag (case-insensitive)
Parameters
| Name | Type |
|---|---|
tagName |
String |
Returns
bool
preloadDailyData() daily_preload_service.dart
Preload Daily page data in the background Safe to call multiple times - will only preload once
Returns
Future<void>
getJournalsByCategory() journal_service.dart
Get journals by category (Tarot, Reports, Content)
Returns
static Future<List<JournalEntry>>
Returns: JournalEntry
getTarotJournals() journal_service.dart
Get tarot reading journals with timeframe filtering Uses the Node.js journals API with type filter
Returns
static Future<List<JournalEntry>>
Returns: JournalEntry
getReadingHistory() journal_service.dart
Get tarot reading history from the Utility API. Uses GET /API/Utility/GetTarotJournals
Returns
static Future<List<JournalEntry>>
Returns: JournalEntry
addReadingJournal() journal_service.dart
Add a tarot reading journal via the Utility API. Uses POST /API/Utility/AddTarotJournal
Returns
static Future<bool>
removeReadingJournal() journal_service.dart
Remove a tarot reading journal via the Utility API. Uses POST /API/Utility/RemoveJournal
Returns
static Future<bool>
updateReadingJournal() journal_service.dart
Update a tarot reading journal (title/comment) via the Utility API. Uses PUT /journals/{TarotReadingJournalID}
Returns
static Future<bool>
getTarotStats() journal_service.dart
Get tarot statistics (TopCards, Suits, Number)
Uses Models
getTarotCards() journal_service.dart
Get tarot cards for a specific reading
Uses Models
removeJournal() journal_service.dart
Remove a journal entry
Returns
static Future<bool>
updateJournalComment() journal_service.dart
Update journal comment
Returns
static Future<bool>
addTarotJournal() journal_service.dart
Add a tarot journal entry
Returns
static Future<bool>
getTarotSpreads() journal_service.dart
clearAllCaches() journal_service.dart
Clear all journal caches (useful for logout or data refresh)
Returns
static Future<void>
getJournalIdForComponent() journal_service.dart
Check if a component is saved in journal and return its journal ID if found Returns null if not saved, or the journal ID if saved
Returns
static Future<String?>
buildComponentDeeplink() journal_service.dart
Build a deeplink route string for a component. Returns a route like: /component?component=Sun+in+Cancer&category=Zodiac+Planets This deeplink can be used by HybridRouter.navigate() to reopen the view.
Returns
static String
buildChartDeeplink() journal_service.dart
Build a deeplink route string for a chart view. Returns a route like: /chartview?type=birth
Returns
static String
buildMatrixDeeplink() journal_service.dart
Build a deeplink for a matrix view.
Returns
static String
addDeeplinkJournal() journal_service.dart
Add a journal entry as a deeplink reference. Instead of duplicating full content, this saves: - `deeplink`: the route to reopen the view (e.g., `/component?component=...`) - `title`, `image`, `type`: minimal display metadata for the journal list When the user taps a journal entry, the app opens the deeplink which re-fetches and renders the original view with full context.
Returns
static Future<Map<String, dynamic>?>
enableCache() journal_service.dart
Disable caching temporarily
Returns
static void
enableCache() journal_service.dart
Enable caching
Returns
static void
addChartReportJournal() journal_service.dart
Add chart-based report to journal as a deeplink. Instead of saving the full report JSON, saves a deeplink to the chart view — e.g., `/chartview?type=birth`. When reopened, the chart recalculates from the current data.
Returns
static Future<bool>
_getChartImageUrl() journal_service.dart
Get image URL for chart type
Parameters
| Name | Type |
|---|---|
journalType |
String |
Returns
static String
addDataReportJournal() journal_service.dart
Add data-driven report to journal as a deeplink. For Matrix, Tarot (non-spread), and other data-driven reports. Saves a deeplink to the matrix view instead of duplicating content.
Returns
static Future<bool>
_getChartJournalType() journal_service.dart
Get journal type string based on chart type
Parameters
| Name | Type |
|---|---|
chartType |
String |
Returns
static String
_buildChartReportTitle() journal_service.dart
Build journal title for chart reports
Returns
static String
_transformData() matrix_service.dart
Fast inline transform - uses centralized enrichment from astro_parser
Uses Models
Parameters
| Name | Type |
|---|---|
data |
Map<String, dynamic> |
facetMapping |
Map<String, String> |
filterItems() matrix_service.dart
Filter items by facet and optional chart type filter
Uses Models
calculateFilteredAttributes() matrix_service.dart
Calculate attributes for filtered items
Returns
Map<String, MatrixAttribute>
Returns: MatrixAttribute
getSummaryAttributes() matrix_service.dart
Get summary data for all facets with optional chart type filter
Returns
Map<String, MatrixAttribute>
Returns: MatrixAttribute
getSortedSummary() matrix_service.dart
Get sorted facet list for summary view
Returns
List<MapEntry<String, MatrixAttribute>>
Returns: MapEntry, MatrixAttribute
getFacetNames() matrix_service.dart
Get list of facet names for the current matrix type
Parameters
| Name | Type |
|---|---|
type |
MatrixType |
Returns
List<String>
start() screen_timer_service.dart
Start timer for a screen
Parameters
| Name | Type |
|---|---|
screenName |
String |
Returns
void
stop() screen_timer_service.dart
Stop timer for a screen and report metrics
Parameters
| Name | Type |
|---|---|
screenName |
String |
profileId |
String? |
Returns
Future<void>
incrementCount() screen_timer_service.dart
Increment a simple counter in profile stats and Grafana
Parameters
| Name | Type |
|---|---|
name |
String |
profileId |
String? |
Returns
Future<void>
_updateLocalStats() screen_timer_service.dart
Update local UserProfile stats
Returns
Future<void>
setCacheDuration() video_service.dart
Configure cache duration (updates JsonStorageService.defaultExpiry)
Parameters
| Name | Type |
|---|---|
duration |
Duration |
Returns
static void
fetchVideos() video_service.dart
Fetch videos from API with caching Cache automatically expires based on JsonStorageService.defaultExpiry Parameters: - useCache: If false, bypasses cache and forces fresh fetch
Returns
Future<VideoResult>
Returns: VideoResult
refreshVideos() video_service.dart
Force refresh videos (invalidates cache)
Returns
Future<VideoResult>
Returns: VideoResult
file-level() video_service.dart
Get a random video from the list
Parameters
| Name | Type |
|---|---|
videos |
Video |
Returns
Video?
Returns: Video
filterByConsciousnessLevel() video_service.dart
Filter videos by consciousness level tag
Parameters
| Name | Type |
|---|---|
videos |
Video |
level |
String |
Returns
List<Video>
Returns: Video
file-level() video_service.dart
Get consciousness level from astrological component (ported from AngularJS)
Parameters
| Name | Type |
|---|---|
component |
String |
Returns
String?
useCache() video_service.dart
Get appropriate video for a given astrological component
Parameters
| Name | Type |
|---|---|
component |
String |
useCache |
bool |
Returns
Future<Video?>
Returns: Video
_getFromCache() video_service.dart
Get videos from cache Expired entries are automatically filtered by JsonStorageService
Parameters
| Name | Type |
|---|---|
key |
String |
Returns
Future<List<Video>?>
Returns: Video
_addToCache() video_service.dart
Add videos to cache Expiry is handled automatically by JsonStorageService
Parameters
| Name | Type |
|---|---|
key |
String |
videos |
Video |
Returns
Future<void>
clearCache() video_service.dart
Clear video cache
Returns
Future<void>
cleanupExpiredCache() video_service.dart
Cleanup expired video cache entries
Returns
Future<void>
fetchVOCData() voc_service.dart
Fetch Void of Course data [date] - Optional date to fetch VOC for (defaults to current date) [limit] - Number of items to return [useCache] - Whether to use cached data if available
Returns
Future<VOCResult>
Returns: VOCResult
_getCacheKey() voc_service.dart
Generate cache key
Parameters
| Name | Type |
|---|---|
date |
DateTime |
limit |
int |
Returns
String
_getFromCache() voc_service.dart
Get data from cache if not expired
Parameters
| Name | Type |
|---|---|
key |
String |
Returns
Future<List<VOCItem>?>
Returns: VOCItem
_addToCache() voc_service.dart
Add data to cache
Parameters
| Name | Type |
|---|---|
key |
String |
items |
VOCItem |
Returns
Future<void>
clearCache() voc_service.dart
Clear all cached data
Returns
Future<void>
clearExpiredCache() voc_service.dart
Clear expired cache entries
Returns
Future<void>
initializeWebView() webview_service_mobile.dart
Initialize webview with controller
Parameters
| Name | Type |
|---|---|
controller |
InAppWebViewController |
Returns
void
setWebViewSettings() webview_service_mobile.dart
Set webview settings
Returns
Future<void>
clearWebViewCache() webview_service_mobile.dart
Clear webview cache
Returns
Future<void>
setupJavaScriptHandlers() webview_service_mobile.dart
Setup JavaScript handlers
Returns
Future<void>
_handleInterstitialAd() webview_service_mobile.dart
Handle interstitial ad request
Returns
Future<void>
_handleRewardAd() webview_service_mobile.dart
Handle reward ad request
Parameters
| Name | Type |
|---|---|
value |
dynamic |
context |
BuildContext |
Returns
Future<void>
_handleLocationRequest() webview_service_mobile.dart
Handle location request
Parameters
| Name | Type |
|---|---|
value |
dynamic |
context |
BuildContext |
Returns
void
_handlePurchase() webview_service_mobile.dart
Handle purchase request — BLOCKS if no valid userId is available.
Returns
Future<void>
_handleRestorePurchases() webview_service_mobile.dart
Handle restore purchases
Returns
Future<void>
_handleQRScan() webview_service_mobile.dart
Handle QR scan request
Parameters
| Name | Type |
|---|---|
value |
dynamic |
context |
BuildContext |
Returns
void
_openAppStore() webview_service_mobile.dart
Open app store for review
Returns
Future<void>
_getPlatform() webview_service_mobile.dart
Get platform string
Returns
String
sendJsonToWebView() webview_service_mobile.dart
Send JSON data to webview
Parameters
| Name | Type |
|---|---|
key |
String |
data |
Map<String, dynamic> |
Returns
Future<void>
loadUrl() webview_service_mobile.dart
Load URL in webview
Parameters
| Name | Type |
|---|---|
url |
String |
Returns
Future<void>
canGoBack() webview_service_mobile.dart
Check if webview can go back
Returns
Future<bool>
goBack() webview_service_mobile.dart
Go back in webview
Returns
Future<void>
getCurrentUrl() webview_service_mobile.dart
Get current URL
Returns
Future<WebUri?>
Returns: WebUri
_syncSubscriptionAfterLogin() webview_service_mobile.dart
Shared logic for syncing subscription status to WebView after login This ensures cross-platform purchases are recognized immediately.
Parameters
| Name | Type |
|---|---|
userId |
String |
Returns
Future<void>
dispose() webview_service_mobile.dart
Dispose resources
Returns
void
initializeWebView() webview_service_web.dart
Initialize webview with controller
Parameters
| Name | Type |
|---|---|
controller |
InAppWebViewController |
Returns
void
setWebViewSettings() webview_service_web.dart
Set webview settings
Returns
Future<void>
clearWebViewCache() webview_service_web.dart
Clear webview cache
Returns
Future<void>
setupJavaScriptHandlers() webview_service_web.dart
Setup JavaScript handlers
Returns
Future<void>
_handlePurchase() webview_service_web.dart
Handle purchase request
Returns
Future<void>
sendJsonToWebView() webview_service_web.dart
Send JSON data to webview
Parameters
| Name | Type |
|---|---|
key |
String |
data |
Map<String, dynamic> |
Returns
Future<void>
loadUrl() webview_service_web.dart
Load URL in webview
Parameters
| Name | Type |
|---|---|
url |
String |
Returns
Future<void>
canGoBack() webview_service_web.dart
Check if webview can go back
Returns
Future<bool>
goBack() webview_service_web.dart
Go back in webview
Returns
Future<void>
getCurrentUrl() webview_service_web.dart
Get current URL
Returns
Future<WebUri?>
Returns: WebUri
dispose() webview_service_web.dart
Dispose resources
Returns
void
adCodeName() add_error_handelers_mobile.dart
Maps a numeric Mobile Ads SDK error code to a symbolic error name string.
Parameters
| Name | Type |
|---|---|
code |
int |
Returns
String
Description
symbolic error name (or 'unknown_error' if not recognized)
adCodeDescription() add_error_handelers_mobile.dart
Provides a concise human-readable description for a Mobile Ads SDK error code.
Parameters
| Name | Type |
|---|---|
code |
int |
Returns
String
Description
short explanation of the error scenario
adCodeSuggestedAction() add_error_handelers_mobile.dart
Suggests a next-step action for given Mobile Ads SDK error codes to aid diagnostics.
Parameters
| Name | Type |
|---|---|
code |
int |
Returns
String
Description
recommended action or triage step to take
handleLoadAdError() add_error_handelers_mobile.dart
Global handler for ad load failures that logs structured diagnostics to remote logging. Logs a JSON payload and calls a centralized ad-error logger with contextual fields.
Returns
Future<void>
Description
Future that completes after logs are sent
handleShowAdError() add_error_handelers_mobile.dart
Global handler for full-screen ad show failures that records contextual diagnostics. Sends both a JSON-encoded error log and a structured ad-error record for monitoring.
Returns
Future<void>
Description
Future that completes after logs are sent
handleLoadAdError() add_error_handelers_stub.dart
Web stub for ad error handlers - Not needed on web Helper functions for mobile ad error handling
Returns
Future<void>
createChartRenderer() chart_renderer.dart
Factory function to create the platform-specific chart renderer. Returns a [ChartRenderer] implementation for the current platform.
Uses Models
createChartRendererImpl() chart_renderer_stub.dart
Stub implementation that throws. This will be overridden by platform-specific implementations.
Uses Models
clean() generic_helper_methods.dart
Cleans the input string by removing any leading or trailing non-alphanumeric characters.
Parameters
| Name | Type |
|---|---|
input |
String |
Returns
String
variant() tarot_card_helper.dart
Card back image used across the app. // Existing assets on the server: tarotback3.png / tarotback4.png
Parameters
| Name | Type |
|---|---|
variant |
int |
Returns
static String
faceImageUrl() tarot_card_helper.dart
Build the card face image URL. Inputs: - [deck]: selected tarot deck (e.g. "astrotarot") - [cardName]: human-readable name (used only as a fallback/debug context) - [image]: value returned by the API for the card image - [category]: category returned by the API (often needed for correct pathing)
Returns
static String
file-level() tarot_card_helper.dart
Get card name from code
Parameters
| Name | Type |
|---|---|
code |
String |
Returns
static String?
file-level() tarot_card_helper.dart
Get card code from name
Parameters
| Name | Type |
|---|---|
name |
String |
Returns
static String?
file-level() tarot_card_helper.dart
Get category from code
Parameters
| Name | Type |
|---|---|
code |
String |
Returns
static String?
file-level() tarot_card_helper.dart
Get suit from code
Parameters
| Name | Type |
|---|---|
code |
String |
Returns
static String?
file-level() tarot_card_helper.dart
Get category from name
Parameters
| Name | Type |
|---|---|
name |
String |
Returns
static String?
file-level() tarot_card_helper.dart
Get suit from name
Parameters
| Name | Type |
|---|---|
name |
String |
Returns
static String?
toRiderWaite() tarot_card_helper.dart
Convert Princess/Prince to Page/Knight (Rider-Waite)
Parameters
| Name | Type |
|---|---|
name |
String |
Returns
static String
toThoth() tarot_card_helper.dart
Convert Page/Knight to Princess/Prince (Thoth)
Parameters
| Name | Type |
|---|---|
name |
String |
Returns
static String
file-level() tarot_card_helper.dart
Parse tarot link (e.g., "Tarot/A33" or full URL)
Parameters
| Name | Type |
|---|---|
link |
String |
Returns
static String?
getImageUrl() tarot_card_helper.dart
Get image URL for a card
Returns
static String
notifyFlutterReady() web_utils_stub.dart
Stub for JS integration to prevent compilation errors on mobile.
Returns
void
notifyFlutterReady() web_utils_web.dart
Web implementation to signal readiness to the HTML splash screen.
Returns
void
hideSplashLogo() web_utils_web.dart
Web implementation to hide just the splash logo.
Returns
void
_initializeServices() web_view_screen.dart
Initialize all services
Returns
Future<void>
_setupServices() web_view_screen.dart
Setup all services
Returns
Future<void>
_syncSubscriptionToWebView() web_view_screen.dart
Cross-platform subscription sync. Checks backend for user's payment status (from any platform: Web, iOS, Android) This ensures users who purchased on a different platform are recognized.
Parameters
| Name | Type |
|---|---|
userId |
String |
Returns
Future<void>
initWebServices() web_view_screen.dart
Initialize web services using WebViewService
Returns
Future<void>
_saveValue() web_view_screen.dart
Save value in local storage
Returns
Future<void>
_formatDateMatrixStyle() weekly_report.dart
Format date in M/D/YYYY format to match matrix list view
Parameters
| Name | Type |
|---|---|
date |
DateTime |
Returns
String
_getAspectColor() weekly_report.dart
Determines if an aspect is challenging (red) or harmonious (green) Returns harmonious (green) for unknown aspects
Uses Models
Parameters
| Name | Type |
|---|---|
item |
MatrixItem |
planet |
String |
Returns
Color
Returns: Color
forceRender() persistent_chart_webview_web.dart
Force full re-render (consistency with mobile)
Returns
Future<void>
_recalculateChart() confirm_user_dialog.dart
Recalculate birth chart when timezone or coordinates change
Returns
Future<void>
_buildDialogContent() confirm_user_dialog.dart
Build the main content of the dialog
Returns
Widget
Returns: Widget
_handleConfirm() confirm_user_dialog.dart
Handle confirm button press
Returns
void
_getTypeIconPath() matrix_item_card.dart
Get the icon asset path based on item type and theme
Parameters
| Name | Type |
|---|---|
isDarkMode |
bool |
Returns
String
_buildTypeIcon() matrix_item_card.dart
Build the type indicator icon widget
Parameters
| Name | Type |
|---|---|
context |
BuildContext |
Returns
Widget
Returns: Widget
main() accuracy_test.dart
Astronomical Accuracy Tests Tests against known birth charts to verify calculations are correct Tolerance: ±2 degrees is standard in astrology due to: - Rounding differences - House system variations - Timezone/DST handling Run with: flutter test test/accuracy_test.dart
Returns
void
main() api_integration_test.dart
Automated API tests - Run with: flutter test test/api_integration_test.dart
Returns
void
_testUser() payload_service_test.dart
Minimal test user for payload building.
Returns
UserProfile
Returns: UserProfile
main() gpt_translate.dart
Quick GPT Translation Test - MINIMAL (saves API tokens) Run with: flutter test test/gpt_translation_test.dart
Returns
void
registerTestServices() test_helpers.dart
Registers fake/real lightweight services into GetIt for widget testing. Call this in setUpAll() before widget tests. Services that are singletons accessed via .instance (HoroscopeService) are set up via their test-specific APIs.
Returns
Future<void>
unregisterTestServices() test_helpers.dart
Cleans up GetIt and HoroscopeService singleton. Call this in tearDownAll() after widget tests.
Returns
Future<void>
buildTestApp() test_helpers.dart
Wraps [child] in a MaterialApp with theme, localization, and navigator matching the real app configuration. Use this in pumpWidget().
Returns
Widget
Returns: Widget
buildTestScaffold() test_helpers.dart
Wraps [child] in a Scaffold inside buildTestApp. Useful for widgets that expect a Scaffold ancestor.
Returns
Widget
Returns: Widget
_item() matrix_service_logic_test.dart
Helper to create a minimal MatrixItem for testing filterItems / attributes
Uses Models
main() quick_api_test.dart
Quick API comparison test Tests both timezonedb and Google API return same timezone Run with: flutter test test/quick_api_test.dart
Returns
void
main() traits_api_test.dart
Comprehensive Traits API Test Tests component traits API to debug why traits aren't showing Run with: flutter test test/traits_api_test.dart
Returns
void
dark() form_controls_test.dart
Wraps [child] in MaterialApp with full AppTheme (all required extensions).
Parameters
| Name | Type |
|---|---|
child |
Widget |
dark |
bool |
Returns
Widget
Returns: Widget