cake_wallet/lib/src/screens/settings/privacy_page.dart

53 lines
2.1 KiB
Dart
Raw Normal View History

2022-11-16 07:29:14 +00:00
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_choices_cell.dart';
2022-11-16 07:29:14 +00:00
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
2022-11-23 17:06:41 +00:00
import 'package:cake_wallet/view_model/settings/privacy_settings_view_model.dart';
2022-11-16 07:29:14 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
import 'package:cake_wallet/entities/fiat_api_mode.dart';
2022-11-16 07:29:14 +00:00
class PrivacyPage extends BasePage {
2022-11-25 20:51:07 +00:00
PrivacyPage(this._privacySettingsViewModel);
2022-11-16 07:29:14 +00:00
@override
String get title => S.current.privacy_settings;
2022-11-25 20:51:07 +00:00
final PrivacySettingsViewModel _privacySettingsViewModel;
2022-11-16 07:29:14 +00:00
@override
Widget body(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 10),
child: Observer(builder: (_) {
2022-12-01 19:21:51 +00:00
return Column(
mainAxisSize: MainAxisSize.min,
children: [
SettingsChoicesCell(
ChoicesListItem<FiatApiMode>(
title: 'Fiat api',
items: FiatApiMode.all,
selectedItem: _privacySettingsViewModel.fiatApiMode,
onItemSelected: (FiatApiMode mode) => _privacySettingsViewModel.setFiatMode(mode),
),
),
2022-12-01 19:21:51 +00:00
SettingsSwitcherCell(
title: S.current.disable_exchange,
value: _privacySettingsViewModel.disableExchange,
onValueChange: (BuildContext context, bool value) {
_privacySettingsViewModel.setEnableExchange(value);
}),
SettingsSwitcherCell(
title: S.current.settings_save_recipient_address,
value: _privacySettingsViewModel.shouldSaveRecipientAddress,
onValueChange: (BuildContext _, bool value) {
_privacySettingsViewModel.setShouldSaveRecipientAddress(value);
})
],
);
2022-11-16 07:29:14 +00:00
}),
);
}
}