add back public profile toggle to learning settings (#1316)

pull/1544/head
ggurdin 10 months ago committed by GitHub
parent 7e9dc022eb
commit 60a3587c8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -4655,5 +4655,7 @@
"pleaseAgreeToTOS": "Please agree to the Terms and Conditions",
"pleaseEnterEmail": "Please enter a valid email address.",
"pleaseSelectALanguage": "Please select a language",
"myBaseLanguage": "My base language"
"myBaseLanguage": "My base language",
"publicProfileTitle": "Allow my profile to be found in search",
"publicProfileDesc": "By enabling this option, I confirm that I am of legal age in my country of residence"
}

@ -32,10 +32,12 @@ class SettingsLearningController extends State<SettingsLearning> {
}
setPublicProfile(bool isPublic) {
pangeaController.userController.updateProfile((profile) {
profile.userSettings.publicProfile = isPublic;
return profile;
});
pangeaController.userController.updateProfile(
(profile) {
profile.userSettings.publicProfile = isPublic;
return profile;
},
);
setState(() {});
}
@ -88,6 +90,9 @@ class SettingsLearningController extends State<SettingsLearning> {
}
}
bool get publicProfile =>
pangeaController.userController.profile.userSettings.publicProfile;
@override
Widget build(BuildContext context) {
return SettingsLearningView(this);

@ -110,6 +110,13 @@ class SettingsLearningView extends StatelessWidget {
),
],
),
SwitchListTile.adaptive(
value: controller.publicProfile,
onChanged: controller.setPublicProfile,
title: Text(L10n.of(context).publicProfileTitle),
subtitle: Text(L10n.of(context).publicProfileDesc),
activeColor: AppConfig.activeToggleColor,
),
],
),
),

Loading…
Cancel
Save