Add toggle for disabling service bulletin (#1347)

* Add toggle for disabling service bulletin

* Make the toggle functional

* Fix + add toggle to Advanced Settings

* Remove unused variable

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
tuxsudo
2024-03-25 20:28:45 +02:00
committed by GitHub
co-authored by Omar Hatem
parent bca59ad5e4
commit 4520f583a6
34 changed files with 78 additions and 2 deletions
+10 -1
View File
@@ -103,7 +103,16 @@ class _DashboardPageView extends BasePage {
Widget get endDrawer => MenuWidget(dashboardViewModel);
@override
Widget leading(BuildContext context) => ServicesUpdatesWidget(dashboardViewModel.getServicesStatus());
Widget leading(BuildContext context) {
return Observer(
builder: (context) {
if (dashboardViewModel.isEnabledBulletinAction) {
return ServicesUpdatesWidget(dashboardViewModel.getServicesStatus());
}
return const SizedBox();
},
);
}
@override
Widget middle(BuildContext context) {
@@ -100,6 +100,12 @@ class _AdvancedPrivacySettingsBodyState extends State<AdvancedPrivacySettingsBod
Observer(builder: (_) {
return Column(
children: [
SettingsSwitcherCell(
title: S.current.disable_bulletin,
value: widget.privacySettingsViewModel.disableBulletin,
onValueChange: (BuildContext _, bool value) {
widget.privacySettingsViewModel.setDisableBulletin(value);
}),
SettingsSwitcherCell(
title: S.current.add_custom_node,
value: widget.privacySettingsViewModel.addCustomNode,
@@ -80,6 +80,12 @@ class PrivacyPage extends BasePage {
onValueChange: (BuildContext _, bool value) {
_privacySettingsViewModel.setDisableSell(value);
}),
SettingsSwitcherCell(
title: S.current.disable_bulletin,
value: _privacySettingsViewModel.disableBulletin,
onValueChange: (BuildContext _, bool value) {
_privacySettingsViewModel.setDisableBulletin(value);
}),
if (_privacySettingsViewModel.canUseEtherscan)
SettingsSwitcherCell(
title: S.current.etherscan_history,