|
|
|
|
@ -94,22 +94,18 @@ class AppState {
|
|
|
|
|
String? get getProfileImageData => _profileImageData;
|
|
|
|
|
|
|
|
|
|
set setProfileImageData(String? value) {
|
|
|
|
|
print('📸 AppState: Setting profile image data - ${value != null && value.isNotEmpty ? "Has data (${value.length} chars)" : "Empty/null"}');
|
|
|
|
|
_profileImageData = value;
|
|
|
|
|
// Persist to cache
|
|
|
|
|
if (value != null && value.isNotEmpty) {
|
|
|
|
|
cacheService.saveString(key: _profileImageKey, value: value);
|
|
|
|
|
print('💾 AppState: Profile image saved to cache');
|
|
|
|
|
} else {
|
|
|
|
|
cacheService.remove(key: _profileImageKey);
|
|
|
|
|
print('🗑️ AppState: Profile image removed from cache');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Load profile image from cache on app initialization
|
|
|
|
|
void _loadProfileImageFromCache() {
|
|
|
|
|
_profileImageData = cacheService.getString(key: _profileImageKey);
|
|
|
|
|
print('📂 AppState: Loaded profile image from cache - ${_profileImageData != null && _profileImageData!.isNotEmpty ? "Has data (${_profileImageData!.length} chars)" : "Empty/null"}');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Clear profile image from cache (e.g., on logout)
|
|
|
|
|
|