feat(privacy): add personalized ads toggle in settings
- Add PrivacySettings schema with can_sell field (default: false) - Move privacy toggle to GeneralSettingsScreen with clear labeling - Update l10n for zh/en/zh_hant with user-friendly copy - Clean up redundant PrivacyNotificationSettingsScreen - Update profile-protocol.md to reflect new privacy schema - Fix basedpyright warnings in user.py
This commit is contained in:
@@ -84,6 +84,23 @@ class DivinationTutorialSettings {
|
||||
}
|
||||
}
|
||||
|
||||
class PrivacySettings {
|
||||
const PrivacySettings({
|
||||
this.canSell = false,
|
||||
this.profileVisibility = 'public',
|
||||
});
|
||||
|
||||
final bool canSell;
|
||||
final String profileVisibility;
|
||||
|
||||
PrivacySettings copyWith({bool? canSell, String? profileVisibility}) {
|
||||
return PrivacySettings(
|
||||
canSell: canSell ?? this.canSell,
|
||||
profileVisibility: profileVisibility ?? this.profileVisibility,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ProfileSettingsV1 {
|
||||
const ProfileSettingsV1({
|
||||
this.version = 1,
|
||||
@@ -92,7 +109,7 @@ class ProfileSettingsV1 {
|
||||
this.avatarPath,
|
||||
this.avatarUrl,
|
||||
this.preferences = const PreferenceSettings(),
|
||||
this.privacy = const <String, Object?>{},
|
||||
this.privacy = const PrivacySettings(),
|
||||
this.notification = const NotificationSettings(),
|
||||
this.divinationTutorial = const DivinationTutorialSettings(),
|
||||
});
|
||||
@@ -103,7 +120,7 @@ class ProfileSettingsV1 {
|
||||
final String? avatarPath;
|
||||
final String? avatarUrl;
|
||||
final PreferenceSettings preferences;
|
||||
final Map<String, Object?> privacy;
|
||||
final PrivacySettings privacy;
|
||||
final NotificationSettings notification;
|
||||
final DivinationTutorialSettings divinationTutorial;
|
||||
|
||||
@@ -114,7 +131,7 @@ class ProfileSettingsV1 {
|
||||
String? avatarPath,
|
||||
String? avatarUrl,
|
||||
PreferenceSettings? preferences,
|
||||
Map<String, Object?>? privacy,
|
||||
PrivacySettings? privacy,
|
||||
NotificationSettings? notification,
|
||||
DivinationTutorialSettings? divinationTutorial,
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user