add back public profile toggle to learning settings (#1316)
This commit is contained in:
parent
7e9dc022eb
commit
60a3587c8f
3 changed files with 19 additions and 5 deletions
|
|
@ -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…
Add table
Reference in a new issue