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
DeviceService 7 methods device_service.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).
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.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 ===============================================================
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String |
getUnsyncedRecords()
Future<List<Map<String, dynamic>>>
Get unsynced records for background sync
Parameters
| Name | Type | Description |
|---|---|---|
namespace |
String |
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
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 12 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) Returns: ChartPayload ready for API submission
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 12 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) Returns: ChartPayload ready for API submission
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 16 methods preferences_service.dart
=============================================================== PREFERENCE SYNC SERVICE - FIXED WITH TYPE NORMALIZATION ===============================================================
Methods
initializeDefaults()
static Future<void>
Initialize all preferences with defaults on first app start
_upsertPreferences()
static Future<void>
Upsert preferences (create or update)
Parameters
| Name | Type | Description |
|---|---|---|
uid |
String | |
preferences |
Map<String, dynamic> |
setPreferenceLanguage()
static Future<void>
Set preference that works even when not logged in (mainly for language)
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
value |
dynamic |
setPreference()
static Future<void>
Save preference locally and sync to server
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
value |
dynamic |
_syncToWebView()
static Future<void>
Sync preference to WebView
Parameters
| Name | Type | Description |
|---|---|---|
key |
String | |
value |
dynamic |
_invalidateCacheIfNeeded()
static Future<void>
Invalidate chart cache if preference affects chart calculations
Parameters
| Name | Type | Description |
|---|---|---|
key |
String |
_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 |
_syncToServerInBackground()
static void
Sync to server in background (don't await)
Parameters
| Name | Type | Description |
|---|---|---|
uid |
String | |
preferences |
Map<String, dynamic> |
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
Parameters
| Name | Type | Description |
|---|---|---|
preferences |
Map<String, dynamic> |
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.
StorageProvider 0 methods storage_service.dart
====================================================================== STORAGE PROVIDER INTERFACE ======================================================================
Methods
StorageService 0 methods storage_service.dart
====================================================================== STORAGE SERVICE (SINGLETON) ======================================================================
Methods
Used By Services
- NotificationServices notification_service.dart
AdsService 16 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
_loadAdsState()
Future<void>
Load ads state from SharedPreferences
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 and disables ads.
_disposeAllAds()
void
Dispose all ad objects
loadBannerAd()
Future<void>
Load and show banner ad
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 1 methods analytics_service.dart
Service that provides helpers for logging events to Firebase Analytics.
Fields
| Name | Type |
|---|---|
analytics |
FirebaseAnalytics |
Methods
analyticsEventLog()
Future<void>
Logs an analytics event to Firebase Analytics, defaulting to 'purchase_completed' and including product_id when provided.
Returns
Future<void> that completes when the event has been sent.
Side Effects
Sends data to Firebase Analytics.
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 1 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
getCategoryItems()
Future<List<CategoryItem>>
Get items for a category Used by ItemCategoryCtrl equivalent in Flutter
Parameters
| Name | Type | Description |
|---|---|---|
category |
String |
CategoryItem 1 methods category_items_service.dart
Category item model
Uses Models
Uses Services
Methods
getCategoryItems()
Future<List<CategoryItem>>
Get items for a category Used by ItemCategoryCtrl equivalent in Flutter
Parameters
| Name | Type | Description |
|---|---|---|
category |
String |
Used By Services
- CategoryItemsService.getCategoryItems() category_items_service.dart
- CategoryItem.getCategoryItems() 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 28 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
getTransitPlanets()
static List<Map<String, dynamic>>
Transform transit planets with display data
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 Horizontal (columns): Lilith, Chiron, Pholus, Ceres, Pallas, Juno, Vesta, Eris, Eros, Psyche Vertical (rows): Lilith, Chiron, Ceres, Pallas, Juno
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 |
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? |
ForecastService 0 methods forecast_service.dart
Forecast service using shared top-level mapping functions
Methods
GlossaryService 2 methods glossary_service.dart
Service for fetching glossary terms and help content
Uses Models
Uses Services
Methods
getGlossaryTerms()
Future<List<GlossaryTerm>>
Get glossary terms Endpoint: /help/get?type=Glossary
searchItems()
Future<List<SearchResult>>
Search horoscope items Endpoint: /API/Astrology/GetHoroscopeItems?search={query}
Parameters
| Name | Type | Description |
|---|---|---|
query |
String |
GlossaryTerm 2 methods glossary_service.dart
Glossary term model
Uses Models
Uses Services
Methods
getGlossaryTerms()
Future<List<GlossaryTerm>>
Get glossary terms Endpoint: /help/get?type=Glossary
searchItems()
Future<List<SearchResult>>
Search horoscope items Endpoint: /API/Astrology/GetHoroscopeItems?search={query}
Parameters
| Name | Type | Description |
|---|---|---|
query |
String |
Used By Services
- GlossaryService.getGlossaryTerms() glossary_service.dart
- GlossaryTerm.getGlossaryTerms() 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 1 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}
HoroscopeService 32 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.
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.
_persistUser1()
Future<void>
Persist user1 ID to preferences.
_persistUser2()
Future<void>
Persist user2 ID to preferences.
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.
Parameters
| Name | Type | Description |
|---|---|---|
date |
DateTime |
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 Reads preferences and sets showPlanet flag on each planet Works with PreferenceService/StorageService preferences Usage: ```dart final chartData = await calculateChart(...); final filteredData = await AstroHelper.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. Results are cached by user ID and date.
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)
calculateHoroscopes()
Future<ChartResult>
Calculate horoscopes with interpretations.
_fetchHoroscopes()
Future<ChartResult>
Internal method to fetch horoscopes from API Extracted to allow request deduplication
Parameters
| Name | Type | Description |
|---|---|---|
type |
String | |
cacheKey |
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 |
_buildCacheKey()
String
Build cache key from current state.
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)
getBigThree()
Future<BigThree?>
Get Big Three (Sun, Moon, Ascendant) from birth chart Returns BigThree with Placement objects for sun, moon, and ascendant Returns null if any of the three are missing
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
AdsService 1 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.
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.
Parameters
| Name | Type | Description |
|---|---|---|
type |
String | the ad type filter ('content', 'link', 'promo', 'all'). |
Returns
a random ad object or null if no ads match.
IntegrationService 7 methods integration_service.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.
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 |
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 |
NotificationServices 12 methods notification_service.dart
Service that encapsulates Firebase Cloud Messaging and local notification setup and handling. Provides methods to initialize listeners, request permissions, show local notifications, retrieve device token, and handle notification interactions.
Fields
| Name | Type |
|---|---|
_storageService |
StorageService |
Uses Models
Uses Services
Methods
initLocalNotifications()
void
Initializes the local notifications plugin and registers a response callback to handle interactions when the app is active.
Side Effects
Registers onDidReceiveNotificationResponse callback and may call handleMessage.
firebaseInit()
void
Subscribes to foreground Firebase messages and triggers local notification display and handlers.
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext | BuildContext used for handling message interactions. |
Side Effects
Listens to FirebaseMessaging.onMessage and may call initLocalNotifications, showNotification, and forgroundMessage.
requestNotificationPermission()
void
Requests notification permissions from the platform via Firebase Messaging. Prints debug logs about user's decision.
setNotificationGroup()
Future<void>
Configures notification topic group and creates notification channels.
createNotificationChannel()
Future<void>
Creates an Android notification channel with the given identifiers and importance.
checkAndRequestNotificationPermission()
Future<void>
Checks and requests notification permission using the permission_handler package, opening app settings if the permission is denied or permanently denied.
Side Effects
May open platform app settings.
showNotification()
Future<void>
Builds a notification channel and displays a local notification for the given RemoteMessage.
Parameters
| Name | Type | Description |
|---|---|---|
message |
RemoteMessage | RemoteMessage containing notification title and body to display. |
Returns
Future that completes after scheduling the local notification.
Side Effects
Displays a local platform notification via FlutterLocalNotificationsPlugin.
getDeviceToken()
Future<String>
Retrieves the FCM device token for this client.
Returns
A non-null device token string.
Throws
- If the messaging token cannot be retrieved (null).
isTokenRefresh()
void
Subscribes to token refresh events to react when the FCM token is rotated.
Side Effects
Listens to onTokenRefresh stream and logs refresh events.
setupInteractMessage()
Future<void>
Configures handling for notification interactions when the app is backgrounded or terminated.
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext | BuildContext used to handle message interactions (e.g., navigation). |
Returns
Future that completes after initial message check and listener setup.
Side Effects
May call handleMessage for initial messages and registers onMessageOpenedApp listener.
handleMessage()
void
Handles a notification tap or interaction and performs appropriate in-app navigation or actions.
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext | BuildContext used for potential navigation. |
message |
RemoteMessage | RemoteMessage containing data that determines navigation. |
Side Effects
May navigate to screens based on message.data.
forgroundMessage()
Future
Configures foreground notification presentation options on iOS so alerts, badges, and sounds are shown.
Returns
Future that completes after setting presentation options.
Side Effects
Updates Firebase Messaging foreground presentation behavior.
PurchaseService 18 methods purchase_service.dart
Singleton service that manages in-app purchases, product discovery, restoration, validation, logging, and post-purchase processing.
Methods
_instance()
factory
Factory constructor that returns the singleton instance.
initialize()
Future<void>
Initialize the purchase service and connect to the platform store.
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. |
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.
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.
ExamplePaymentQueueDelegate 18 methods purchase_service.dart
iOS payment queue delegate used to interact with StoreKit queue behavior.
Methods
_instance()
factory
Factory constructor that returns the singleton instance.
initialize()
Future<void>
Initialize the purchase service and connect to the platform store.
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. |
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.
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.
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 |
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
_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
Parameters
| Name | Type | Description |
|---|---|---|
section |
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 |
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 |
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 6 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.
Extends: StatefulWidget
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.
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
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 scrollable content area, typically used for auth screens, short forms, or pages that need a strong visual header. 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 dominating Adjusts flex ratios based on screen width for better tablet experience
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 dominating Adjusts flex ratios based on screen width for better tablet experience
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 dominating Adjusts flex ratios based on screen width for better tablet experience
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.
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 dominating Adjusts flex ratios based on screen width for better tablet experience
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 dominating Adjusts flex ratios based on screen width for better tablet experience
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 dominating Adjusts flex ratios based on screen width for better tablet experience
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 dominating Adjusts flex ratios based on screen width for better tablet experience
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
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 1 methods account_screen.dart
=============================================================== ACCOUNT SCREEN =============================================================== Unified user account and profile management screen. Contains: profile info, membership, appearance settings, user management, and account actions. Routes: - Change Password -> /changepassword - Manage Users -> /chartpickuser - Add User -> /profiles - Settings -> /horoscope-settings
Extends: StatefulWidget
Methods
PurchaseWidget()
const
Uncomment below to test MembershipWidget with mock subscription data
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
Uses Models
Methods
_initializeFromQuery()
void
Initializes form values from query parameters if in edit mode.
_showConfirmationDialog()
Future<void>
Shows confirmation dialog with Big Three calculation
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 2 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
Uses Models
Methods
_handleItemTap()
void
✅ Navigate to component screen - just pass the item directly
Parameters
| Name | Type | Description |
|---|---|---|
item |
MatrixItem |
_handleEphemerisCellTap()
void
Handle ephemeris cell tap - navigate to planet in sign interpretation
Parameters
| Name | Type | Description |
|---|---|---|
planetName |
String | |
sign |
String |
ChangePasswordScreen 0 methods change_password.dart
Screen that allows registered users to change their password. Unregistered users (app-*) are prompted to create an account first.
Extends: StatefulWidget
ChartScreen 2 methods chart_screen.dart
Main chart screen - displays interactive astrology charts UserHeader is normal component - NOT floating
Extends: StatefulWidget
Methods
_parseChartTypeFromQuery()
void
Parse chart type from query parameter
_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 snap-to-top scrolling behavior for app bar
Extends: StatefulWidget
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 1 methods home_screen.dart
Main home screen for AstroMatrix Dashboard aggregating multiple astrological data sections
Extends: StatefulWidget
Uses Models
Methods
_handleItemTap()
void
Navigate to component screen - just pass the item directly
Parameters
| Name | Type | Description |
|---|---|---|
item |
MatrixItem |
JournalScreen 0 methods journal.dart
Main Journal screen using TabBar pattern (consistent with CalendarScreen and MatrixScreen)
Extends: StatefulWidget
LoginScreen 4 methods login.dart
Screen widget that displays a login form and related actions.
Extends: StatefulWidget
Methods
_handleLogin()
Future<void>
Handles the login flow: validates inputs, calls the login service, shows feedback, and navigates on success.
Returns
a [Future] that completes when the operation and any navigation are done.
Side Effects
updates [isLoading], shows snack/dialog feedback, performs navigation via [AppNavigation].
_buildTabSwitcher()
Widget
Builds the custom tab switcher widget using theme styling
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_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 4 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
_handleLogin()
Future<void>
Handles the login flow: validates inputs, calls the login service, shows feedback, and navigates on success.
Returns
a [Future] that completes when the operation and any navigation are done.
Side Effects
updates [isLoading], shows snack/dialog feedback, performs navigation via [AppNavigation].
_buildTabSwitcher()
Widget
Builds the custom tab switcher widget using theme styling
Parameters
| Name | Type | Description |
|---|---|---|
context |
BuildContext |
_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 3 methods matrix.dart
Main Matrix screen using TabBar pattern (consistent with CalendarScreen)
Extends: StatefulWidget
Methods
_buildTabContent()
Widget
Build content for each tab
Parameters
| Name | Type | Description |
|---|---|---|
categoryIndex |
int |
_generateReport()
Future<void>
Generate AI report for a subcategory Called when user taps the report button (⭐) in a subcategory header. Takes ~10 seconds due to AI generation.
_showReportModal()
void
Show generated report in draggable bottom sheet modal Provides a clean, full-screen reading experience with: - Draggable sheet (can expand/collapse) - Scrollable content - Selectable text (users can copy insights) - Close button
Parameters
| Name | Type | Description |
|---|---|---|
title |
required String | |
content |
String |
_HelpBottomSheet 3 methods matrix.dart
Help bottom sheet widget
Extends: StatelessWidget
Methods
_buildTabContent()
Widget
Build content for each tab
Parameters
| Name | Type | Description |
|---|---|---|
categoryIndex |
int |
_generateReport()
Future<void>
Generate AI report for a subcategory Called when user taps the report button (⭐) in a subcategory header. Takes ~10 seconds due to AI generation.
_showReportModal()
void
Show generated report in draggable bottom sheet modal Provides a clean, full-screen reading experience with: - Draggable sheet (can expand/collapse) - Scrollable content - Selectable text (users can copy insights) - Close button
Parameters
| Name | Type | Description |
|---|---|---|
title |
required String | |
content |
String |
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 1 methods moon_screen.dart
Moon Report Screen Shows comprehensive moon information including phases, tarot, sabian symbols, VOC, and OOB
Extends: StatefulWidget
Uses Models
Methods
UsersScreen 4 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 |
ProfileScreen 0 methods profile_screen.dart
=============================================================== PROFILE SCREEN =============================================================== User profile and account management screen. Contains non-astrology settings: photo, name, email, password, theme, UI preferences, user management, and account actions. Routes: - Change Password -> /change-password - Manage Users -> /chartpickuser - Add User -> /profiles
Extends: StatefulWidget
HoroscopeSettingsScreen 0 methods settings.dart
=============================================================== HOROSCOPE SETTINGS SCREEN =============================================================== Astrology-specific settings screen. Contains all chart calculation, display, and astrology engine configuration options. 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 - Tarot deck selection - Notifications
Extends: StatefulWidget
StoreScreen 0 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
TarotReadingPage 1 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 1 methods tarot_reading_page.dart
Question dialog modal
Extends: StatefulWidget
Methods
_initializeWithParams()
Future<void>
Initialize with query parameters if provided
ReadingCardDisplaySinglePage 1 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 avatar/photo and basic info
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
AdWidget 0 methods 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
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 3 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
_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.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 7 methods component_summary.dart
Complete component summary with all trait boxes and navigation
Extends: StatefulWidget
Methods
_findItem()
void
Navigate to related component using ComponentHelper ✅ Creates MatrixItem with id='0' (not null)
Parameters
| Name | Type | Description |
|---|---|---|
component |
String | |
category |
String |
_buildActionButtons()
Widget
Ref: DEB-88 : Implement component summary inactive logic
Parameters
| Name | Type | Description |
|---|---|---|
theme |
ThemeData |
_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
StepMatrixWizard 9 methods step_matrix_wizard.dart
Pure UI component - knows nothing about business logic
Extends: StatefulWidget
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 Can be called from parent widgets or step content
_checkAutoAdvance()
void
Check if current step should auto-advance
_showError()
void
Uncomment the following code if you want to show error messages using SnackBar and to be handled inside the wizard widget.
Parameters
| Name | Type | Description |
|---|---|---|
message |
String |
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
StepMatrixWizardState 9 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 Can be called from parent widgets or step content
_checkAutoAdvance()
void
Check if current step should auto-advance
_showError()
void
Uncomment the following code if you want to show error messages using SnackBar and to be handled inside the wizard widget.
Parameters
| Name | Type | Description |
|---|---|---|
message |
String |
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 8 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
Uses Models
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
_buildCurrentDate()
Widget
Build current date display (always shown in collapsed mode)
_buildCollapsedTransitDate()
Widget
Build collapsed transit date display
_buildCollapseToggle()
Widget
Build collapse/expand toggle button
_buildBigThree()
Widget
Build Big Three display (Sun, Moon, Ascendant)
CompactUserHeaderWidget 8 methods user_header.dart
=============================================================== COMPACT USER HEADER (for tight spaces) ===============================================================
Extends: StatelessWidget
Uses Models
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
_buildCurrentDate()
Widget
Build current date display (always shown in collapsed mode)
_buildCollapsedTransitDate()
Widget
Build collapsed transit date display
_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
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
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 0 methods journal_widgets.dart
Generic journal list widget for Reports and Content Matches _JournalList.html structure
Extends: StatelessWidget
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
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
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? |
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.
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 0 methods tarot_section.dart
Tarot section screen - displays cards in a selected category
Extends: StatefulWidget
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.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.dart
- IntegrationService._saveLiveServerData() integration_service.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
- AddUserScreen add_user.dart
- 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 |
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
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? |
_MockValidationResult user_form_controller.dart
Mock validation result for when service isn't called
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
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 |
AdHelper 0 methods ad_helper.dart
Provides platform-aware AdMob ad unit IDs and selects test IDs when in debug mode.
AffiliateHelper 6 methods affiliate_helper.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.
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 |
getDurationInfo()
static DurationInfo
Get duration info for a transit
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 |
formatDegreesMinutes()
static String
Format astrological degrees and minutes Examples: 15.5° with minutes → "15°30'", without minutes → "15°"
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.
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
- ReportService report_service.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.
ButtonType ui_components.dart
Semantic variants for AppButton to select visual style and intent.
SymbolType astro_helper.dart
Symbol type for buildSymbolImage
IconPattern astrology_guide.dart
Icon pattern for category items
IconPattern astrology_guide_tabs.dart
Icon pattern for category items (from astrology_guide.dart)
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
initialize() deep_link_service.dart
Initialize the deep link service
Returns
Future<void>
_checkPendingAffiliateDiscount() deep_link_service.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.dart
Initialize deep links
Returns
Future<void>
handleDeepLink() deep_link_service.dart
Handle incoming deep links
Parameters
| Name | Type |
|---|---|
url |
String |
Returns
Future<void>
_handleAffiliateLink() deep_link_service.dart
Handle affiliate discount links
Parameters
| Name | Type |
|---|---|
url |
String |
Returns
Future<void>
_loadAffiliateCode() deep_link_service.dart
Load affiliate code from SharedPreferences
Returns
Future<void>
_saveAffiliateCode() deep_link_service.dart
Save affiliate code to SharedPreferences
Parameters
| Name | Type |
|---|---|
code |
String |
Returns
Future<void>
_validateAffiliateCode() deep_link_service.dart
Validate affiliate code
Parameters
| Name | Type |
|---|---|
code |
String |
Returns
Future<bool>
_notifyWebViewDiscountApplied() deep_link_service.dart
Notify web view about discount applied
Returns
void
updateUserInfo() deep_link_service.dart
Update user and device info
Parameters
| Name | Type |
|---|---|
userId |
String? |
deviceInfoId |
String? |
Returns
void
dispose() deep_link_service.dart
Dispose resources
Returns
void
call() local_api_bridge.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
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 dedicated GetTarotJournals API endpoint
Returns
static Future<List<JournalEntry>>
Returns: JournalEntry
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>
disableCache() journal_service.dart
Disable caching temporarily
Returns
static void
enableCaching() journal_service.dart
Enable caching
Returns
static void
addChartReportJournal() journal_service.dart
Add chart-based report to journal For traditional astrological reports (birth, synastry, transit, etc.)
Returns
static Future<bool>
addDataReportJournal() journal_service.dart
Add data-driven report to journal For Matrix, Tarot (non-spread), and other data-driven reports
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
setAccountID() user_service.dart
Sets the account ID (email/auth identifier) - stored as 'userID'
Parameters
| Name | Type |
|---|---|
accountId |
String |
Returns
static Future<void>
getAccountID() user_service.dart
Gets the account ID (email/auth identifier)
Returns
static Future<String?>
setUserID() user_service.dart
Sets the user profile ID (birth chart ID) - stored as 'profileID'
Parameters
| Name | Type |
|---|---|
profileId |
String |
Returns
static Future<void>
getUserID() user_service.dart
Gets the user profile ID (birth chart ID)
Returns
static Future<String?>
clearUserSession() user_service.dart
Clear user session data on logout Removes all user-specific data while preserving: - Language preference - Device-specific data (deviceId, fcmToken) - Non-user-specific cache (VOC, videos, components, etc.)
Returns
static Future<void>
getUserLimitInfo() user_service.dart
Get user limit info for UI display
Returns
static Future<UserLimitInfo>
Returns: UserLimitInfo
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.dart
Initialize webview with controller
Parameters
| Name | Type |
|---|---|
controller |
InAppWebViewController |
Returns
void
setWebViewSettings() webview_service.dart
Set webview settings
Returns
Future<void>
clearWebViewCache() webview_service.dart
Clear webview cache
Returns
Future<void>
setupJavaScriptHandlers() webview_service.dart
Setup JavaScript handlers
Returns
Future<void>
_handleInterstitialAd() webview_service.dart
Handle interstitial ad request
Returns
Future<void>
_handleRewardAd() webview_service.dart
Handle reward ad request
Parameters
| Name | Type |
|---|---|
value |
dynamic |
context |
BuildContext |
Returns
Future<void>
_handleLocationRequest() webview_service.dart
Handle location request
Parameters
| Name | Type |
|---|---|
value |
dynamic |
context |
BuildContext |
Returns
void
_handlePurchase() webview_service.dart
Handle purchase request
Returns
Future<void>
_handleRestorePurchases() webview_service.dart
Handle restore purchases
Returns
Future<void>
_handleQRScan() webview_service.dart
Handle QR scan request
Parameters
| Name | Type |
|---|---|
value |
dynamic |
context |
BuildContext |
Returns
void
_openAppStore() webview_service.dart
Open app store for review
Returns
Future<void>
_getPlatform() webview_service.dart
Get platform string
Returns
String
sendJsonToWebView() webview_service.dart
Send JSON data to webview
Parameters
| Name | Type |
|---|---|
key |
String |
data |
Map<String, dynamic> |
Returns
Future<void>
loadUrl() webview_service.dart
Load URL in webview
Parameters
| Name | Type |
|---|---|
url |
String |
Returns
Future<void>
canGoBack() webview_service.dart
Check if webview can go back
Returns
Future<bool>
goBack() webview_service.dart
Go back in webview
Returns
Future<void>
getCurrentUrl() webview_service.dart
Get current URL
Returns
Future<WebUri?>
Returns: WebUri
dispose() webview_service.dart
Dispose resources
Returns
void
adCodeName() add_error_handelers.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.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.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.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.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
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
_initializeServices() web_view_screen.dart
Initialize all services
Returns
Future<void>
_setupServices() web_view_screen.dart
Setup all services
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>
_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
_cleanupExpiredCache() video_widget.dart
Cleanup expired videos from cache (runs in background)
Returns
Future<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
main() gpt_translate.dart
Quick GPT Translation Test - MINIMAL (saves API tokens) Run with: flutter test test/gpt_translation_test.dart
Returns
void
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