mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-07 08:04:04 +01:00
Reformat the whole codebase with 100 line width (#3403)
This commit is contained in:
@@ -1 +1 @@
|
||||
enum Attributes {arrow, header, link, switcher, widget, rawWidget}
|
||||
enum Attributes { arrow, header, link, switcher, widget, rawWidget }
|
||||
|
||||
@@ -43,89 +43,87 @@ class ConnectionSyncPage extends BasePage {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Observer(
|
||||
builder: (context) =>
|
||||
NewListSections(
|
||||
sections: {
|
||||
"": [
|
||||
if (FeatureFlag.isInAppTorEnabled)
|
||||
ListItemToggle(
|
||||
keyValue: "enable_builtin_tor",
|
||||
label: S.of(context).enable_builtin_tor,
|
||||
value: _connectionSyncViewModel.builtinTor,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setBuiltinTor(val, context);
|
||||
}),
|
||||
ListItemToggle(
|
||||
keyValue: "disable_automatic_exchange_status_updates",
|
||||
label: S.of(context).disable_automatic_exchange_status_updates,
|
||||
value: _connectionSyncViewModel.disableAutomaticExchangeStatusUpdates,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setDisableAutomaticExchangeStatusUpdates(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseBlinkProtection)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_blink_protection",
|
||||
label: S.of(context).use_blink_protection,
|
||||
value: _connectionSyncViewModel.useBlinkProtection,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseBlinkProtection(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseEtherscan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_etherscan",
|
||||
label: S.of(context).etherscan_history,
|
||||
value: _connectionSyncViewModel.useEtherscan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseEtherscan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUsePolygonScan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_polygonscan",
|
||||
label: S.of(context).polygonscan_history,
|
||||
value: _connectionSyncViewModel.usePolygonScan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUsePolygonScan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseBaseScan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_basescan",
|
||||
label: S.of(context).basescan_history,
|
||||
value: _connectionSyncViewModel.canUseBaseScan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseBaseScan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseArbiScan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_arbiscan",
|
||||
label: S.of(context).arbiscan_history,
|
||||
value: _connectionSyncViewModel.useArbiScan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseArbiScan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseBscScan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_bscscan",
|
||||
label: S.of(context).bscscan_history,
|
||||
value: _connectionSyncViewModel.useBscScan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseBscScan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseTronGrid)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_trongrid",
|
||||
label: S.of(context).trongrid_history,
|
||||
value: _connectionSyncViewModel.useTronGrid,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseTronGrid(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseMempoolFeeAPI)
|
||||
ListItemToggle(
|
||||
keyValue: "enable_mempool_api",
|
||||
label: S.of(context).enable_mempool_api,
|
||||
value: _connectionSyncViewModel.useMempoolFeeAPI,
|
||||
onChanged: (bool isEnabled) async {
|
||||
if (!isEnabled) {
|
||||
final bool confirmation = await showPopUp<bool>(
|
||||
builder: (context) => NewListSections(sections: {
|
||||
"": [
|
||||
if (FeatureFlag.isInAppTorEnabled)
|
||||
ListItemToggle(
|
||||
keyValue: "enable_builtin_tor",
|
||||
label: S.of(context).enable_builtin_tor,
|
||||
value: _connectionSyncViewModel.builtinTor,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setBuiltinTor(val, context);
|
||||
}),
|
||||
ListItemToggle(
|
||||
keyValue: "disable_automatic_exchange_status_updates",
|
||||
label: S.of(context).disable_automatic_exchange_status_updates,
|
||||
value: _connectionSyncViewModel.disableAutomaticExchangeStatusUpdates,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setDisableAutomaticExchangeStatusUpdates(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseBlinkProtection)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_blink_protection",
|
||||
label: S.of(context).use_blink_protection,
|
||||
value: _connectionSyncViewModel.useBlinkProtection,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseBlinkProtection(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseEtherscan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_etherscan",
|
||||
label: S.of(context).etherscan_history,
|
||||
value: _connectionSyncViewModel.useEtherscan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseEtherscan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUsePolygonScan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_polygonscan",
|
||||
label: S.of(context).polygonscan_history,
|
||||
value: _connectionSyncViewModel.usePolygonScan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUsePolygonScan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseBaseScan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_basescan",
|
||||
label: S.of(context).basescan_history,
|
||||
value: _connectionSyncViewModel.canUseBaseScan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseBaseScan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseArbiScan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_arbiscan",
|
||||
label: S.of(context).arbiscan_history,
|
||||
value: _connectionSyncViewModel.useArbiScan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseArbiScan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseBscScan)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_bscscan",
|
||||
label: S.of(context).bscscan_history,
|
||||
value: _connectionSyncViewModel.useBscScan,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseBscScan(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseTronGrid)
|
||||
ListItemToggle(
|
||||
keyValue: "can_use_trongrid",
|
||||
label: S.of(context).trongrid_history,
|
||||
value: _connectionSyncViewModel.useTronGrid,
|
||||
onChanged: (val) {
|
||||
_connectionSyncViewModel.setUseTronGrid(val);
|
||||
}),
|
||||
if (_connectionSyncViewModel.canUseMempoolFeeAPI)
|
||||
ListItemToggle(
|
||||
keyValue: "enable_mempool_api",
|
||||
label: S.of(context).enable_mempool_api,
|
||||
value: _connectionSyncViewModel.useMempoolFeeAPI,
|
||||
onChanged: (bool isEnabled) async {
|
||||
if (!isEnabled) {
|
||||
final bool confirmation = await showPopUp<bool>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertWithTwoActions(
|
||||
@@ -133,91 +131,88 @@ class ConnectionSyncPage extends BasePage {
|
||||
alertContent: S.of(context).disable_fee_api_warning,
|
||||
rightButtonText: S.of(context).confirm,
|
||||
leftButtonText: S.of(context).cancel,
|
||||
actionRightButton: () => Navigator.of(context).pop(true),
|
||||
actionLeftButton: () => Navigator.of(context).pop(false));
|
||||
actionRightButton: () =>
|
||||
Navigator.of(context).pop(true),
|
||||
actionLeftButton: () =>
|
||||
Navigator.of(context).pop(false));
|
||||
}) ??
|
||||
false;
|
||||
if (confirmation) {
|
||||
_connectionSyncViewModel.setUseMempoolFeeAPI(isEnabled);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
false;
|
||||
if (confirmation) {
|
||||
_connectionSyncViewModel.setUseMempoolFeeAPI(isEnabled);
|
||||
}),
|
||||
if (Platform.isAndroid && FeatureFlag.isBackgroundSyncEnabled)
|
||||
ListItemRegularRow(
|
||||
keyValue: "background_sync",
|
||||
label: S.of(context).background_sync,
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.backgroundSync)
|
||||
),
|
||||
if (_connectionSyncViewModel.hasPowNodes)
|
||||
ListItemRegularRow(
|
||||
keyValue: "manage_pow_nodes",
|
||||
label: S.of(context).manage_pow_nodes,
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.managePowNodes),
|
||||
),
|
||||
ListItemSelector(
|
||||
keyValue: "fiat_api",
|
||||
label: S.of(context).fiat_api,
|
||||
options: [_connectionSyncViewModel.fiatApiMode.title],
|
||||
onTap: () async {
|
||||
final items = FiatApiMode.all;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final selectedAtIndex =
|
||||
_connectionSyncViewModel.setUseMempoolFeeAPI(isEnabled);
|
||||
}),
|
||||
if (Platform.isAndroid && FeatureFlag.isBackgroundSyncEnabled)
|
||||
ListItemRegularRow(
|
||||
keyValue: "background_sync",
|
||||
label: S.of(context).background_sync,
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.backgroundSync)),
|
||||
if (_connectionSyncViewModel.hasPowNodes)
|
||||
ListItemRegularRow(
|
||||
keyValue: "manage_pow_nodes",
|
||||
label: S.of(context).manage_pow_nodes,
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.managePowNodes),
|
||||
),
|
||||
ListItemSelector(
|
||||
keyValue: "fiat_api",
|
||||
label: S.of(context).fiat_api,
|
||||
options: [_connectionSyncViewModel.fiatApiMode.title],
|
||||
onTap: () async {
|
||||
final items = FiatApiMode.all;
|
||||
|
||||
final selectedAtIndex =
|
||||
items.indexOf(_connectionSyncViewModel.fiatApiMode);
|
||||
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: (FiatApiMode fiatApiMode) {
|
||||
_connectionSyncViewModel.setFiatMode(fiatApiMode);
|
||||
},
|
||||
isSeparated: false,
|
||||
),
|
||||
);
|
||||
}),
|
||||
ListItemSelector(
|
||||
keyValue: "swap",
|
||||
label: S.of(context).swap,
|
||||
options: [_connectionSyncViewModel.exchangeStatus.title],
|
||||
onTap: () async {
|
||||
final items = ExchangeApiMode.all;
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: (FiatApiMode fiatApiMode) {
|
||||
_connectionSyncViewModel.setFiatMode(fiatApiMode);
|
||||
},
|
||||
isSeparated: false,
|
||||
),
|
||||
);
|
||||
}),
|
||||
ListItemSelector(
|
||||
keyValue: "swap",
|
||||
label: S.of(context).swap,
|
||||
options: [_connectionSyncViewModel.exchangeStatus.title],
|
||||
onTap: () async {
|
||||
final items = ExchangeApiMode.all;
|
||||
|
||||
final selectedAtIndex =
|
||||
final selectedAtIndex =
|
||||
items.indexOf(_connectionSyncViewModel.exchangeStatus);
|
||||
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: (ExchangeApiMode mode) {
|
||||
_connectionSyncViewModel.setExchangeApiMode(mode);
|
||||
},
|
||||
isSeparated: false,
|
||||
),
|
||||
);
|
||||
}),
|
||||
ListItemRegularRow(
|
||||
keyValue: "domain_lookups",
|
||||
label: S.of(context).domain_looks_up,
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.domainLookupsPage)
|
||||
),
|
||||
if(_connectionSyncViewModel.hasRescan)
|
||||
ListItemRegularRow(
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: (ExchangeApiMode mode) {
|
||||
_connectionSyncViewModel.setExchangeApiMode(mode);
|
||||
},
|
||||
isSeparated: false,
|
||||
),
|
||||
);
|
||||
}),
|
||||
ListItemRegularRow(
|
||||
keyValue: "domain_lookups",
|
||||
label: S.of(context).domain_looks_up,
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.domainLookupsPage)),
|
||||
if (_connectionSyncViewModel.hasRescan)
|
||||
ListItemRegularRow(
|
||||
keyValue: "rescan",
|
||||
label: S.of(context).rescan,
|
||||
onTap: ()=>Navigator.of(context).pushNamed(Routes.rescan)
|
||||
)
|
||||
],
|
||||
}
|
||||
)
|
||||
),
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.rescan))
|
||||
],
|
||||
})),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -61,9 +61,9 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
|
||||
}
|
||||
|
||||
if ((!widget.dashboardViewModel.isMoneroViewOnly &&
|
||||
item.name(context) == S.of(context).export_outputs) ||
|
||||
(!widget.dashboardViewModel.hasMweb &&
|
||||
item.name(context) == S.of(context).litecoin_mweb_settings)) {
|
||||
item.name(context) == S.of(context).export_outputs) ||
|
||||
(!widget.dashboardViewModel.hasMweb &&
|
||||
item.name(context) == S.of(context).litecoin_mweb_settings)) {
|
||||
return Container();
|
||||
}
|
||||
|
||||
@@ -103,11 +103,9 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
|
||||
key: _settingsNavigatorKey,
|
||||
initialRoute: Routes.empty_no_route,
|
||||
onGenerateRoute: (settings) => Router.createRoute(settings),
|
||||
onGenerateInitialRoutes:
|
||||
(NavigatorState navigator, String initialRouteName) {
|
||||
onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) {
|
||||
return [
|
||||
navigator
|
||||
.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!
|
||||
navigator.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!
|
||||
];
|
||||
},
|
||||
),
|
||||
|
||||
@@ -27,7 +27,6 @@ import 'package:image_picker/image_picker.dart';
|
||||
class DisplaySettingsPage extends StatelessWidget {
|
||||
DisplaySettingsPage(this._displaySettingsViewModel);
|
||||
|
||||
|
||||
final DisplaySettingsViewModel _displaySettingsViewModel;
|
||||
|
||||
@override
|
||||
@@ -38,198 +37,197 @@ class DisplaySettingsPage extends StatelessWidget {
|
||||
leadingIcon: Icon(Icons.arrow_back_ios_new),
|
||||
onLeadingPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
content: Column(
|
||||
spacing: 16,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (responsiveLayoutUtil.shouldRenderMobileUI &&
|
||||
DeviceInfo.instance.isMobile) ...[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 14, top: 14),
|
||||
child: Text(
|
||||
S.of(context).appearance,
|
||||
style: Theme.of(context).textTheme.labelLarge?.copyWith(
|
||||
content: Column(
|
||||
spacing: 16,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (responsiveLayoutUtil.shouldRenderMobileUI && DeviceInfo.instance.isMobile) ...[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 14, top: 14),
|
||||
child: Text(
|
||||
S.of(context).appearance,
|
||||
style: Theme.of(context).textTheme.labelLarge?.copyWith(
|
||||
height: 0.2,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
shape: RoundedSuperellipseBorder(borderRadius: BorderRadius.circular(18))),
|
||||
child: Column(
|
||||
children: [
|
||||
SettingsChoicesCell(
|
||||
ChoicesListItem<ThemeMode>(
|
||||
title: "",
|
||||
items: ThemeMode.values,
|
||||
selectedItem: _displaySettingsViewModel.themeMode,
|
||||
onItemSelected: (ThemeMode themeMode) =>
|
||||
_displaySettingsViewModel.setThemeMode(themeMode),
|
||||
displayItem: (ThemeMode themeMode) {
|
||||
return themeMode.name[0].toUpperCase() +
|
||||
themeMode.name.substring(1).toLowerCase();
|
||||
},
|
||||
),
|
||||
useGenericColor: false,
|
||||
padding: EdgeInsets.all(14),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
shape: RoundedSuperellipseBorder(
|
||||
borderRadius: BorderRadius.circular(18))),
|
||||
child: Column(
|
||||
children: [
|
||||
SettingsChoicesCell(
|
||||
ChoicesListItem<ThemeMode>(
|
||||
title: "",
|
||||
items: ThemeMode.values,
|
||||
selectedItem: _displaySettingsViewModel.themeMode,
|
||||
onItemSelected: (ThemeMode themeMode) =>
|
||||
_displaySettingsViewModel.setThemeMode(themeMode),
|
||||
displayItem: (ThemeMode themeMode) {
|
||||
return themeMode.name[0].toUpperCase() +
|
||||
themeMode.name.substring(1).toLowerCase();
|
||||
},
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
shape: RoundedSuperellipseBorder(borderRadius: BorderRadius.circular(18))),
|
||||
child: Column(
|
||||
children: [
|
||||
Semantics(
|
||||
label: S.of(context).color_theme,
|
||||
child: SettingsThemeChoicesCell(_displaySettingsViewModel),
|
||||
),
|
||||
useGenericColor: false,
|
||||
padding: EdgeInsets.all(14),
|
||||
),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
shape: RoundedSuperellipseBorder(
|
||||
borderRadius: BorderRadius.circular(18))),
|
||||
child: Column(
|
||||
children: [
|
||||
Semantics(
|
||||
label: S.of(context).color_theme,
|
||||
child: SettingsThemeChoicesCell(_displaySettingsViewModel),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
Observer(
|
||||
builder: (_) => NewListSections(
|
||||
sections: {
|
||||
"": [
|
||||
ListItemToggle(
|
||||
keyValue: "apps",
|
||||
label: S.of(context).apps,
|
||||
value: _displaySettingsViewModel.shouldShowMarketPlaceInDashboard,
|
||||
onChanged: (val) {
|
||||
_displaySettingsViewModel.setShouldShowMarketPlaceInDashbaord(val);
|
||||
}),
|
||||
ListItemToggle(
|
||||
keyValue: "display_settings_show_address_book_popup",
|
||||
label: S.of(context).show_address_book_popup,
|
||||
value: _displaySettingsViewModel.showAddressBookPopup,
|
||||
onChanged: (val) {
|
||||
_displaySettingsViewModel.setShowAddressBookPopup(val);
|
||||
}),
|
||||
ListItemToggle(
|
||||
keyValue: "display_settings_disable_buy_button",
|
||||
label: S.of(context).disable_buy,
|
||||
value: _displaySettingsViewModel.disableTradeOption,
|
||||
onChanged: (val) {
|
||||
_displaySettingsViewModel.setDisableTradeOption(val);
|
||||
}),
|
||||
if (_displaySettingsViewModel.showZcashCardSetting)
|
||||
ListItemToggle(
|
||||
keyValue: "display_settings_show_zcashcard",
|
||||
label: S.of(context).show_zcash_card,
|
||||
value: _displaySettingsViewModel.showZcashCard,
|
||||
onChanged: (val) {
|
||||
_displaySettingsViewModel.setShowZcashCard(val);
|
||||
}),
|
||||
ListItemSelector(
|
||||
keyValue: "display_settings_sync_status_display",
|
||||
label: S.of(context).sync_status_display_mode,
|
||||
options: [_displaySettingsViewModel.syncStatusDisplayMode.title],
|
||||
onTap: () async {
|
||||
final items = SyncStatusDisplayMode.values.toList();
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
Observer(
|
||||
builder: (_) => NewListSections(
|
||||
sections: {
|
||||
"": [
|
||||
ListItemToggle(
|
||||
keyValue: "apps",
|
||||
label: S.of(context).apps,
|
||||
value: _displaySettingsViewModel.shouldShowMarketPlaceInDashboard,
|
||||
onChanged: (val) {
|
||||
_displaySettingsViewModel.setShouldShowMarketPlaceInDashbaord(val);
|
||||
}),
|
||||
ListItemToggle(
|
||||
keyValue: "display_settings_show_address_book_popup",
|
||||
label: S.of(context).show_address_book_popup,
|
||||
value: _displaySettingsViewModel.showAddressBookPopup,
|
||||
onChanged: (val) {
|
||||
_displaySettingsViewModel.setShowAddressBookPopup(val);
|
||||
}),
|
||||
ListItemToggle(
|
||||
keyValue: "display_settings_disable_buy_button",
|
||||
label: S.of(context).disable_buy,
|
||||
value: _displaySettingsViewModel.disableTradeOption,
|
||||
onChanged: (val) {
|
||||
_displaySettingsViewModel.setDisableTradeOption(val);
|
||||
}),
|
||||
if (_displaySettingsViewModel.showZcashCardSetting)
|
||||
ListItemToggle(
|
||||
keyValue: "display_settings_show_zcashcard",
|
||||
label: S.of(context).show_zcash_card,
|
||||
value: _displaySettingsViewModel.showZcashCard,
|
||||
onChanged: (val) {
|
||||
_displaySettingsViewModel.setShowZcashCard(val);
|
||||
}),
|
||||
ListItemSelector(
|
||||
keyValue: "display_settings_sync_status_display",
|
||||
label: S.of(context).sync_status_display_mode,
|
||||
options: [_displaySettingsViewModel.syncStatusDisplayMode.title],
|
||||
onTap: () async {
|
||||
final items = SyncStatusDisplayMode.values.toList();
|
||||
|
||||
final selectedAtIndex =
|
||||
final selectedAtIndex =
|
||||
items.indexOf(_displaySettingsViewModel.syncStatusDisplayMode);
|
||||
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: (SyncStatusDisplayMode mode) {
|
||||
_displaySettingsViewModel.setSyncStatusDisplayMode(mode);
|
||||
},
|
||||
displayItem: (SyncStatusDisplayMode mode) => mode.title,
|
||||
isSeparated: false,
|
||||
),
|
||||
);
|
||||
}),
|
||||
if (_displaySettingsViewModel.showDisplayAmountsInSatoshiSetting)
|
||||
ListItemRegularRow(
|
||||
keyValue: "display_settings_bitcoin_amount_display",
|
||||
label: S.of(context).bitcoin_amount_display,
|
||||
trailingText: _displaySettingsViewModel.displayAmountsInSatoshi.title,
|
||||
onTap: () async {
|
||||
final items = BitcoinAmountDisplayMode.all;
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: (SyncStatusDisplayMode mode) {
|
||||
_displaySettingsViewModel.setSyncStatusDisplayMode(mode);
|
||||
},
|
||||
displayItem: (SyncStatusDisplayMode mode) => mode.title,
|
||||
isSeparated: false,
|
||||
),
|
||||
);
|
||||
}),
|
||||
if (_displaySettingsViewModel.showDisplayAmountsInSatoshiSetting)
|
||||
ListItemRegularRow(
|
||||
keyValue: "display_settings_bitcoin_amount_display",
|
||||
label: S.of(context).bitcoin_amount_display,
|
||||
trailingText: _displaySettingsViewModel.displayAmountsInSatoshi.title,
|
||||
onTap: () async {
|
||||
final items = BitcoinAmountDisplayMode.all;
|
||||
|
||||
final selectedAtIndex =
|
||||
final selectedAtIndex =
|
||||
items.indexOf(_displaySettingsViewModel.displayAmountsInSatoshi);
|
||||
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: _displaySettingsViewModel.setDisplayAmountsInSatoshi,
|
||||
displayItem: (BitcoinAmountDisplayMode mode) => mode.title,
|
||||
isSeparated: false,
|
||||
),
|
||||
);
|
||||
}),
|
||||
if (!_displaySettingsViewModel.disabledFiatApiMode)
|
||||
ListItemSelector(
|
||||
keyValue: "display_settings_fiat_currency",
|
||||
label: S.of(context).settings_currency,
|
||||
options: [_displaySettingsViewModel.fiatCurrency.title],
|
||||
onTap: () => FiatCurrencyPickerSheet.show(
|
||||
context: context,
|
||||
selected: _displaySettingsViewModel.fiatCurrency,
|
||||
onSelected: _displaySettingsViewModel.setFiatCurrency,
|
||||
)),
|
||||
ListItemSelector(
|
||||
keyValue: "display_settings_language",
|
||||
label: S.of(context).settings_change_language,
|
||||
options: [LanguageService.list[_displaySettingsViewModel.languageCode] ?? ''],
|
||||
onTap: () async {
|
||||
final items = LanguageService.list.keys.toList();
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: _displaySettingsViewModel.setDisplayAmountsInSatoshi,
|
||||
displayItem: (BitcoinAmountDisplayMode mode) => mode.title,
|
||||
isSeparated: false,
|
||||
),
|
||||
);
|
||||
}),
|
||||
if (!_displaySettingsViewModel.disabledFiatApiMode)
|
||||
ListItemSelector(
|
||||
keyValue: "display_settings_fiat_currency",
|
||||
label: S.of(context).settings_currency,
|
||||
options: [_displaySettingsViewModel.fiatCurrency.title],
|
||||
onTap: () => FiatCurrencyPickerSheet.show(
|
||||
context: context,
|
||||
selected: _displaySettingsViewModel.fiatCurrency,
|
||||
onSelected: _displaySettingsViewModel.setFiatCurrency,
|
||||
)),
|
||||
ListItemSelector(
|
||||
keyValue: "display_settings_language",
|
||||
label: S.of(context).settings_change_language,
|
||||
options: [LanguageService.list[_displaySettingsViewModel.languageCode] ?? ''],
|
||||
onTap: () async {
|
||||
final items = LanguageService.list.keys.toList();
|
||||
|
||||
final selectedAtIndex =
|
||||
final selectedAtIndex =
|
||||
items.indexOf(_displaySettingsViewModel.languageCode);
|
||||
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
displayItem: (dynamic code) {
|
||||
return LanguageService.list[code] ?? '';
|
||||
},
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: _displaySettingsViewModel.onLanguageSelected,
|
||||
images: LanguageService.list.keys
|
||||
.map((e) => Image.asset(
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (_) => Picker(
|
||||
displayItem: (dynamic code) {
|
||||
return LanguageService.list[code] ?? '';
|
||||
},
|
||||
items: items,
|
||||
selectedAtIndex: selectedAtIndex,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
onItemSelected: _displaySettingsViewModel.onLanguageSelected,
|
||||
images: LanguageService.list.keys
|
||||
.map((e) => Image.asset(
|
||||
"assets/images/flags/${LanguageService.localeCountryCode[e]}.png"))
|
||||
.toList(),
|
||||
hintText: S.of(context).search_language,
|
||||
matchingCriteria: (String code, String searchText) {
|
||||
return LanguageService.list[code]?.toLowerCase().contains(searchText) ?? false;
|
||||
},
|
||||
isSeparated: true,
|
||||
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
},
|
||||
),
|
||||
),
|
||||
if (FeatureFlag.customBackgroundEnabled)
|
||||
StandardListRow(
|
||||
title: "Custom background",
|
||||
isSelected: false,
|
||||
onTap: (_) => _pickImage(context),
|
||||
),
|
||||
],
|
||||
.toList(),
|
||||
hintText: S.of(context).search_language,
|
||||
matchingCriteria: (String code, String searchText) {
|
||||
return LanguageService.list[code]
|
||||
?.toLowerCase()
|
||||
.contains(searchText) ??
|
||||
false;
|
||||
},
|
||||
isSeparated: true,
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
if (FeatureFlag.customBackgroundEnabled)
|
||||
StandardListRow(
|
||||
title: "Custom background",
|
||||
isSelected: false,
|
||||
onTap: (_) => _pickImage(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Function to pick an image from the gallery
|
||||
|
||||
@@ -25,11 +25,13 @@ class DomainLookupsPage extends BasePage {
|
||||
.map(
|
||||
(source) => SettingsSwitcherCell(
|
||||
title: source.label,
|
||||
leading: source.iconPath.isNotEmpty ? CakeImageWidget(
|
||||
imageUrl: source.iconPath,
|
||||
width: 24,
|
||||
height: 24,
|
||||
) : SizedBox(width: 24, height: 24),
|
||||
leading: source.iconPath.isNotEmpty
|
||||
? CakeImageWidget(
|
||||
imageUrl: source.iconPath,
|
||||
width: 24,
|
||||
height: 24,
|
||||
)
|
||||
: SizedBox(width: 24, height: 24),
|
||||
value: _connectionsSyncViewModel.lookupValue(source),
|
||||
onValueChange: (_, bool value) =>
|
||||
_connectionsSyncViewModel.setLookupValue(source, value),
|
||||
|
||||
@@ -15,4 +15,4 @@ class ItemHeaders {
|
||||
static const termsAndConditions = 'Terms and conditions';
|
||||
static const faq = 'FAQ';
|
||||
static const version = 'Version';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@ class _ManageNodesPageState extends State<ManageNodesPage> {
|
||||
ModernButton(
|
||||
size: 36,
|
||||
icon: Icon(Icons.add),
|
||||
onPressed: ()async {
|
||||
onPressed: () async {
|
||||
final res = await Navigator.of(context)
|
||||
.pushNamed(widget.isPow ? Routes.newPowNode : Routes.newNode);
|
||||
if(res != null && res is Node) {
|
||||
.pushNamed(widget.isPow ? Routes.newPowNode : Routes.newNode);
|
||||
if (res != null && res is Node) {
|
||||
widget.nodeListViewModel.nodes.add(res);
|
||||
}
|
||||
})
|
||||
@@ -75,12 +75,11 @@ class _ManageNodesPageState extends State<ManageNodesPage> {
|
||||
// horizontal: 0,
|
||||
node: widget.nodeListViewModel.currentNode,
|
||||
speed: widget.nodeListViewModel.nodeSpeedFor(widget.nodeListViewModel.currentNode),
|
||||
onEditComplete: (res)async{
|
||||
if(res != null && res is Node) {
|
||||
widget.nodeListViewModel.nodes.removeWhere((item)=>item.id == res.id);
|
||||
onEditComplete: (res) async {
|
||||
if (res != null && res is Node) {
|
||||
widget.nodeListViewModel.nodes.removeWhere((item) => item.id == res.id);
|
||||
widget.nodeListViewModel.nodes.add(res);
|
||||
}
|
||||
|
||||
},
|
||||
onTap: () {},
|
||||
isSelected: true,
|
||||
@@ -93,7 +92,7 @@ class _ManageNodesPageState extends State<ManageNodesPage> {
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
borderRadius: BorderRadius.circular(18)),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
child: Observer(
|
||||
builder: (BuildContext context) {
|
||||
int itemsCount = widget.nodeListViewModel.nonCurrentNodes.length;
|
||||
@@ -119,11 +118,11 @@ class _ManageNodesPageState extends State<ManageNodesPage> {
|
||||
isPow: widget.isPow,
|
||||
speed: widget.nodeListViewModel.nodeSpeedFor(node),
|
||||
onEditComplete: (res) async {
|
||||
if(res != null && res is Node) {
|
||||
widget.nodeListViewModel.nodes.removeWhere((item)=>item.id == res.id);
|
||||
if (res != null && res is Node) {
|
||||
widget.nodeListViewModel.nodes
|
||||
.removeWhere((item) => item.id == res.id);
|
||||
widget.nodeListViewModel.nodes.add(res);
|
||||
}
|
||||
|
||||
},
|
||||
onTap: () async {
|
||||
await showPopUp<void>(
|
||||
|
||||
@@ -38,7 +38,8 @@ class MwebLogsPage extends BasePage {
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Text(
|
||||
snapshot.data!,
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(fontFamily: 'Monospace'),
|
||||
style:
|
||||
Theme.of(context).textTheme.bodyMedium!.copyWith(fontFamily: 'Monospace'),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -103,11 +104,10 @@ class MwebLogsPage extends BasePage {
|
||||
}
|
||||
|
||||
Future<void> _saveFile() async {
|
||||
String? outputFile = await FilePicker.platform
|
||||
.saveFile(
|
||||
dialogTitle: 'Save Your File to desired location',
|
||||
fileName: "debug.log",
|
||||
lockParentWindow: true);
|
||||
String? outputFile = await FilePicker.platform.saveFile(
|
||||
dialogTitle: 'Save Your File to desired location',
|
||||
fileName: "debug.log",
|
||||
lockParentWindow: true);
|
||||
|
||||
if (outputFile == null) return;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/view_model/settings/mweb_settings_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MwebNodePage extends StatefulWidget {
|
||||
const MwebNodePage(this.mwebSettingsViewModelBase, {super.key});
|
||||
|
||||
@@ -30,30 +31,28 @@ class _MwebNodePageState extends State<MwebNodePage> {
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: ModalPageWrapper(
|
||||
topBar: ModalTopBar(
|
||||
topBar: ModalTopBar(
|
||||
title: S.current.litecoin_mweb_settings,
|
||||
onLeadingPressed: Navigator.of(context).pop,
|
||||
leadingIcon: Icon(Icons.arrow_back_ios_new)),
|
||||
content: Container(
|
||||
child: NewListSections(
|
||||
controllers: {
|
||||
widget.mwebSettingsViewModelBase.mwebNodeUri: _nodeUriController,
|
||||
},
|
||||
sections: {
|
||||
'main': [
|
||||
ListItemTextField(
|
||||
keyValue: widget.mwebSettingsViewModelBase.mwebNodeUri,
|
||||
label: S.current.node_address,
|
||||
validator: NodePathValidator(),
|
||||
),
|
||||
]
|
||||
}),
|
||||
),
|
||||
bottomContent: LoadingPrimaryButton(
|
||||
onPressed: () => save(context),
|
||||
text: S.of(context).save,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||
content: Container(
|
||||
child: NewListSections(controllers: {
|
||||
widget.mwebSettingsViewModelBase.mwebNodeUri: _nodeUriController,
|
||||
}, sections: {
|
||||
'main': [
|
||||
ListItemTextField(
|
||||
keyValue: widget.mwebSettingsViewModelBase.mwebNodeUri,
|
||||
label: S.current.node_address,
|
||||
validator: NodePathValidator(),
|
||||
),
|
||||
]
|
||||
}),
|
||||
),
|
||||
bottomContent: LoadingPrimaryButton(
|
||||
onPressed: () => save(context),
|
||||
text: S.of(context).save,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -41,7 +41,7 @@ class MwebSettingsPage extends BasePage {
|
||||
title: S.current.litecoin_mweb_scanning,
|
||||
handler: (BuildContext context) => Navigator.of(context).pushNamed(Routes.rescan),
|
||||
),
|
||||
SettingsCellWithArrow(
|
||||
SettingsCellWithArrow(
|
||||
title: S.current.litecoin_mweb_logs,
|
||||
handler: (BuildContext context) => Navigator.of(context).pushNamed(Routes.mwebLogs),
|
||||
),
|
||||
|
||||
@@ -149,7 +149,8 @@ class OtherSettingsPage extends BasePage {
|
||||
Navigator.of(context).pushNamed(Routes.signPage);
|
||||
}),
|
||||
],
|
||||
if (_otherSettingsViewModel.walletType == WalletType.bitcoin) "btc_logging": [
|
||||
if (_otherSettingsViewModel.walletType == WalletType.bitcoin)
|
||||
"btc_logging": [
|
||||
ListItemRegularRow(
|
||||
keyValue: "export_lightning_logs",
|
||||
label: S.of(context).export_lightning_logs,
|
||||
@@ -158,72 +159,74 @@ class OtherSettingsPage extends BasePage {
|
||||
keyValue: "export_payjoin_logs",
|
||||
label: S.of(context).export_payjoin_logs,
|
||||
onTap: () => onExportPJLog(context)),
|
||||
],
|
||||
"dev": FeatureFlag.hasDevOptions == false ? [] : [
|
||||
if (_otherSettingsViewModel.walletType == WalletType.monero)
|
||||
ListItemRegularRow(
|
||||
keyValue: "[dev] monero background sync",
|
||||
label: "[dev] monero background sync",
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devMoneroBackgroundSync)),
|
||||
if ([WalletType.monero, WalletType.wownero, WalletType.zano]
|
||||
.contains(_otherSettingsViewModel.walletType))
|
||||
ListItemRegularRow(
|
||||
keyValue: "[dev] xmr call profiler",
|
||||
label: "[dev] xmr call profiler",
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devMoneroCallProfiler)),
|
||||
if ([WalletType.monero].contains(_otherSettingsViewModel.walletType))
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] xmr wallet cache debug',
|
||||
label: '[dev] xmr wallet cache debug',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devMoneroWalletCacheDebug)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] shared preferences',
|
||||
label: '[dev] shared preferences',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devSharedPreferences)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] secure storage preferences',
|
||||
label: '[dev] secure storage preferences',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devSecurePreferences)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] background sync logs',
|
||||
label: '[dev] background sync logs',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devBackgroundSyncLogs)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] socket health logs',
|
||||
label: '[dev] socket health logs',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devSocketHealthLogs)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] network requests logs',
|
||||
label: '[dev] network requests logs',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devNetworkRequests)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] exchange provider logs',
|
||||
label: '[dev] exchange provider logs',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devExchangeProviderLogs)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] *QR tools',
|
||||
label: '[dev] *QR tools',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devExchangeProviderLogs)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] browse sqlite db',
|
||||
label: '[dev] browse sqlite db',
|
||||
onTap: () async {
|
||||
final data = await dumpDb();
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => JsonExplorerPage(data: data, title: 'sqlite db'),
|
||||
),
|
||||
);
|
||||
}),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] fake corrupt sqlite db',
|
||||
label: '[dev] fake corrupt sqlite db',
|
||||
onTap: () async {
|
||||
final dbDebugMarker = await sqliteDebugMarkerFile();
|
||||
dbDebugMarker.create();
|
||||
}
|
||||
),
|
||||
]
|
||||
],
|
||||
"dev": FeatureFlag.hasDevOptions == false
|
||||
? []
|
||||
: [
|
||||
if (_otherSettingsViewModel.walletType == WalletType.monero)
|
||||
ListItemRegularRow(
|
||||
keyValue: "[dev] monero background sync",
|
||||
label: "[dev] monero background sync",
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devMoneroBackgroundSync)),
|
||||
if ([WalletType.monero, WalletType.wownero, WalletType.zano]
|
||||
.contains(_otherSettingsViewModel.walletType))
|
||||
ListItemRegularRow(
|
||||
keyValue: "[dev] xmr call profiler",
|
||||
label: "[dev] xmr call profiler",
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devMoneroCallProfiler)),
|
||||
if ([WalletType.monero].contains(_otherSettingsViewModel.walletType))
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] xmr wallet cache debug',
|
||||
label: '[dev] xmr wallet cache debug',
|
||||
onTap: () =>
|
||||
Navigator.of(context).pushNamed(Routes.devMoneroWalletCacheDebug)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] shared preferences',
|
||||
label: '[dev] shared preferences',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devSharedPreferences)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] secure storage preferences',
|
||||
label: '[dev] secure storage preferences',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devSecurePreferences)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] background sync logs',
|
||||
label: '[dev] background sync logs',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devBackgroundSyncLogs)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] socket health logs',
|
||||
label: '[dev] socket health logs',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devSocketHealthLogs)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] network requests logs',
|
||||
label: '[dev] network requests logs',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devNetworkRequests)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] exchange provider logs',
|
||||
label: '[dev] exchange provider logs',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devExchangeProviderLogs)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] *QR tools',
|
||||
label: '[dev] *QR tools',
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.devExchangeProviderLogs)),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] browse sqlite db',
|
||||
label: '[dev] browse sqlite db',
|
||||
onTap: () async {
|
||||
final data = await dumpDb();
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => JsonExplorerPage(data: data, title: 'sqlite db'),
|
||||
),
|
||||
);
|
||||
}),
|
||||
ListItemRegularRow(
|
||||
keyValue: '[dev] fake corrupt sqlite db',
|
||||
label: '[dev] fake corrupt sqlite db',
|
||||
onTap: () async {
|
||||
final dbDebugMarker = await sqliteDebugMarkerFile();
|
||||
dbDebugMarker.create();
|
||||
}),
|
||||
]
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,44 +38,43 @@ class PrivacyPage extends BasePage {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
NewListSections(
|
||||
sections: {
|
||||
"1": [
|
||||
if (_privacySettingsViewModel.isAutoGenerateSubaddressesVisible)
|
||||
ListItemToggle(
|
||||
keyValue: "auto_generate_subaddresses",
|
||||
label: _privacySettingsViewModel.isMoneroWallet
|
||||
? S.of(context).auto_generate_subaddresses
|
||||
: S.of(context).auto_generate_addresses,
|
||||
value: _privacySettingsViewModel.isAutoGenerateSubaddressesEnabled,
|
||||
onChanged: (val) {
|
||||
_privacySettingsViewModel.setAutoGenerateSubaddresses(val);
|
||||
}),
|
||||
NewListSections(sections: {
|
||||
"1": [
|
||||
if (_privacySettingsViewModel.isAutoGenerateSubaddressesVisible)
|
||||
ListItemToggle(
|
||||
keyValue: "save_recipient_address",
|
||||
label: S.of(context).settings_save_recipient_address,
|
||||
value: _privacySettingsViewModel.shouldSaveRecipientAddress,
|
||||
keyValue: "auto_generate_subaddresses",
|
||||
label: _privacySettingsViewModel.isMoneroWallet
|
||||
? S.of(context).auto_generate_subaddresses
|
||||
: S.of(context).auto_generate_addresses,
|
||||
value: _privacySettingsViewModel.isAutoGenerateSubaddressesEnabled,
|
||||
onChanged: (val) {
|
||||
_privacySettingsViewModel.setShouldSaveRecipientAddress(val);
|
||||
_privacySettingsViewModel.setAutoGenerateSubaddresses(val);
|
||||
}),
|
||||
if (_privacySettingsViewModel.canUsePayjoin)
|
||||
ListItemToggle(
|
||||
keyValue: "use_payjoin",
|
||||
label: S.of(context).use_payjoin,
|
||||
value: _privacySettingsViewModel.usePayjoin,
|
||||
onChanged: (val) {
|
||||
_privacySettingsViewModel.setUsePayjoin(val);
|
||||
}),
|
||||
if (_privacySettingsViewModel.canUseLightning)
|
||||
ListItemToggle(
|
||||
keyValue: "enable_lightning",
|
||||
label: S.of(context).enable_lightning,
|
||||
value: _privacySettingsViewModel.useLightning,
|
||||
onChanged: (val) {
|
||||
_privacySettingsViewModel.setUseLightning(val);
|
||||
}),
|
||||
],
|
||||
"": [
|
||||
ListItemToggle(
|
||||
keyValue: "save_recipient_address",
|
||||
label: S.of(context).settings_save_recipient_address,
|
||||
value: _privacySettingsViewModel.shouldSaveRecipientAddress,
|
||||
onChanged: (val) {
|
||||
_privacySettingsViewModel.setShouldSaveRecipientAddress(val);
|
||||
}),
|
||||
if (_privacySettingsViewModel.canUsePayjoin)
|
||||
ListItemToggle(
|
||||
keyValue: "use_payjoin",
|
||||
label: S.of(context).use_payjoin,
|
||||
value: _privacySettingsViewModel.usePayjoin,
|
||||
onChanged: (val) {
|
||||
_privacySettingsViewModel.setUsePayjoin(val);
|
||||
}),
|
||||
if (_privacySettingsViewModel.canUseLightning)
|
||||
ListItemToggle(
|
||||
keyValue: "enable_lightning",
|
||||
label: S.of(context).enable_lightning,
|
||||
value: _privacySettingsViewModel.useLightning,
|
||||
onChanged: (val) {
|
||||
_privacySettingsViewModel.setUseLightning(val);
|
||||
}),
|
||||
],
|
||||
"": [
|
||||
if (_privacySettingsViewModel.isBitcoin)
|
||||
ListItemRegularRow(
|
||||
iconPath: "assets/new-ui/settings_row_icons/silent-payments.svg",
|
||||
@@ -83,23 +82,22 @@ class PrivacyPage extends BasePage {
|
||||
label: S.of(context).silent_payments,
|
||||
onTap: () =>
|
||||
Navigator.of(context).pushNamed(Routes.silentPaymentsSettings)),
|
||||
if (_privacySettingsViewModel.hasMWEB)
|
||||
ListItemRegularRow(
|
||||
iconPath: "assets/new-ui/settings_row_icons/mweb.svg",
|
||||
keyValue: "mweb",
|
||||
label: "MWEB",
|
||||
onTap: () =>
|
||||
Navigator.of(context).pushNamed(Routes.mwebSettings)),
|
||||
if (_privacySettingsViewModel.hasCoinControl)
|
||||
if (_privacySettingsViewModel.hasMWEB)
|
||||
ListItemRegularRow(
|
||||
iconPath: "assets/new-ui/settings_row_icons/mweb.svg",
|
||||
keyValue: "mweb",
|
||||
label: "MWEB",
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.mwebSettings)),
|
||||
if (_privacySettingsViewModel.hasCoinControl)
|
||||
ListItemRegularRow(
|
||||
iconPath: "assets/new-ui/settings_row_icons/coin-control.svg",
|
||||
keyValue: "coin_control",
|
||||
label: "Coin Control",
|
||||
onTap: () =>
|
||||
Navigator.of(context).pushNamed(Routes.unspentCoinsList, arguments: CoinControlPageArgs(canEdit: false, coinTypeToSpendFrom: null))),
|
||||
onTap: () => Navigator.of(context).pushNamed(Routes.unspentCoinsList,
|
||||
arguments:
|
||||
CoinControlPageArgs(canEdit: false, coinTypeToSpendFrom: null))),
|
||||
],
|
||||
}
|
||||
),
|
||||
}),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
||||
@@ -73,8 +73,8 @@ class SecurityBackupPage extends BasePage {
|
||||
isAuthenticatedSuccessfully);
|
||||
}
|
||||
} else {
|
||||
_securitySettingsViewModel.setAllowBiometricalAuthentication(
|
||||
isAuthenticatedSuccessfully);
|
||||
_securitySettingsViewModel
|
||||
.setAllowBiometricalAuthentication(isAuthenticatedSuccessfully);
|
||||
}
|
||||
},
|
||||
conditionToDetermineIfToUse2FA: _securitySettingsViewModel
|
||||
@@ -85,13 +85,13 @@ class SecurityBackupPage extends BasePage {
|
||||
}
|
||||
}),
|
||||
if (DeviceInfo.instance.isMobile)
|
||||
ListItemToggle(
|
||||
keyValue: "display_settings_prevent_screen_capture",
|
||||
label: S.of(context).prevent_screenshots,
|
||||
value: _securitySettingsViewModel.isAppSecure,
|
||||
onChanged: (val) {
|
||||
_securitySettingsViewModel.setIsAppSecure(val);
|
||||
}),
|
||||
ListItemToggle(
|
||||
keyValue: "display_settings_prevent_screen_capture",
|
||||
label: S.of(context).prevent_screenshots,
|
||||
value: _securitySettingsViewModel.isAppSecure,
|
||||
onChanged: (val) {
|
||||
_securitySettingsViewModel.setIsAppSecure(val);
|
||||
}),
|
||||
if (FeatureFlag.duressPinEnabled)
|
||||
ListItemToggle(
|
||||
keyValue: "security_backup_page_duress_pin_button_key",
|
||||
@@ -114,8 +114,7 @@ class SecurityBackupPage extends BasePage {
|
||||
if (confirmation) {
|
||||
Navigator.of(context).pushNamed(
|
||||
Routes.setupDuressPin,
|
||||
arguments:
|
||||
(PinCodeState<PinCodeWidget> pinCtx, String _) async {
|
||||
arguments: (PinCodeState<PinCodeWidget> pinCtx, String _) async {
|
||||
pinCtx.close();
|
||||
_securitySettingsViewModel.setEnableDuressPin(true);
|
||||
},
|
||||
|
||||
@@ -105,11 +105,10 @@ class SilentPaymentsLogPage extends BasePage {
|
||||
}
|
||||
|
||||
Future<void> _saveFile() async {
|
||||
String? outputFile = await FilePicker.platform
|
||||
.saveFile(
|
||||
dialogTitle: 'Save Your File to desired location',
|
||||
fileName: "debug.log",
|
||||
lockParentWindow: true);
|
||||
String? outputFile = await FilePicker.platform.saveFile(
|
||||
dialogTitle: 'Save Your File to desired location',
|
||||
fileName: "debug.log",
|
||||
lockParentWindow: true);
|
||||
|
||||
if (outputFile == null) return;
|
||||
|
||||
|
||||
@@ -19,7 +19,11 @@ class SilentPaymentsSettingsPage extends StatelessWidget {
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
child: Column(
|
||||
children: [
|
||||
ModalTopBar(title: S.current.silent_payments_settings,leadingIcon: Icon(Icons.arrow_back_ios_new),onLeadingPressed: Navigator.of(context).pop,),
|
||||
ModalTopBar(
|
||||
title: S.current.silent_payments_settings,
|
||||
leadingIcon: Icon(Icons.arrow_back_ios_new),
|
||||
onLeadingPressed: Navigator.of(context).pop,
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Observer(builder: (_) {
|
||||
@@ -27,14 +31,14 @@ class SilentPaymentsSettingsPage extends StatelessWidget {
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
if(!FeatureFlag.hasNewUi)
|
||||
SettingsSwitcherCell(
|
||||
title: S.current.silent_payments_display_card,
|
||||
value: _silentPaymentsSettingsViewModel.silentPaymentsCardDisplay,
|
||||
onValueChange: (_, bool value) {
|
||||
_silentPaymentsSettingsViewModel.setSilentPaymentsCardDisplay(value);
|
||||
},
|
||||
),
|
||||
if (!FeatureFlag.hasNewUi)
|
||||
SettingsSwitcherCell(
|
||||
title: S.current.silent_payments_display_card,
|
||||
value: _silentPaymentsSettingsViewModel.silentPaymentsCardDisplay,
|
||||
onValueChange: (_, bool value) {
|
||||
_silentPaymentsSettingsViewModel.setSilentPaymentsCardDisplay(value);
|
||||
},
|
||||
),
|
||||
SettingsSwitcherCell(
|
||||
title: S.current.silent_payments_always_scan,
|
||||
value: _silentPaymentsSettingsViewModel.silentPaymentsAlwaysScan,
|
||||
@@ -44,7 +48,8 @@ class SilentPaymentsSettingsPage extends StatelessWidget {
|
||||
),
|
||||
SettingsCellWithArrow(
|
||||
title: S.current.silent_payments_scanning,
|
||||
handler: (BuildContext context) => Navigator.of(context).pushNamed(Routes.rescan),
|
||||
handler: (BuildContext context) =>
|
||||
Navigator.of(context).pushNamed(Routes.rescan),
|
||||
),
|
||||
SettingsCellWithArrow(
|
||||
title: S.current.silent_payments_logs,
|
||||
|
||||
@@ -44,9 +44,8 @@ class SettingsChoicesCell extends StatelessWidget {
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
width: 1.5,
|
||||
),
|
||||
color: useGenericColor
|
||||
? Theme.of(context).colorScheme.surfaceContainerHighest
|
||||
: null,
|
||||
color:
|
||||
useGenericColor ? Theme.of(context).colorScheme.surfaceContainerHighest : null,
|
||||
),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
@@ -106,4 +105,4 @@ class SettingsChoicesCell extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@ class SettingsPickerRaw extends StatelessWidget {
|
||||
// TODO: implement build
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,11 +58,13 @@ class SettingsThemeChoicesCell extends StatelessWidget {
|
||||
curve: Curves.easeInOut,
|
||||
margin: EdgeInsets.only(right: 24),
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedSuperellipseBorder(borderRadius: BorderRadius.circular(cellRadius),
|
||||
side: BorderSide(
|
||||
color: isSelected ? Theme.of(context).colorScheme.primary : Colors.transparent,
|
||||
strokeAlign: BorderSide.strokeAlignOutside)
|
||||
)),
|
||||
shape: RoundedSuperellipseBorder(
|
||||
borderRadius: BorderRadius.circular(cellRadius),
|
||||
side: BorderSide(
|
||||
color: isSelected
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Colors.transparent,
|
||||
strokeAlign: BorderSide.strokeAlignOutside))),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(cellRadius),
|
||||
child: CakeImageWidget(
|
||||
@@ -97,8 +99,8 @@ class SettingsThemeChoicesCell extends StatelessWidget {
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 14),
|
||||
child: Container(height: 1, color: Theme.of(context).colorScheme.outlineVariant)
|
||||
),
|
||||
child: Container(
|
||||
height: 1, color: Theme.of(context).colorScheme.outlineVariant)),
|
||||
SizedBox(height: cellHeight),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -123,10 +125,14 @@ class SettingsThemeChoicesCell extends StatelessWidget {
|
||||
duration: Duration(milliseconds: 350),
|
||||
opacity: isSelected ? 1 : 0,
|
||||
child: Container(
|
||||
width:28,height:28,decoration: BoxDecoration(borderRadius: BorderRadius.circular(99999999),border: Border.all(color:Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface))
|
||||
),
|
||||
width: 28,
|
||||
height: 28,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(99999999),
|
||||
border: Border.all(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface))),
|
||||
),
|
||||
AnimatedScale(
|
||||
duration: Duration(milliseconds: 350),
|
||||
@@ -153,19 +159,19 @@ class SettingsThemeChoicesCell extends StatelessWidget {
|
||||
if (_displaySettingsViewModel.currentTheme is BlackTheme)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 12, bottom: 4),
|
||||
child: Container(height: 1, color: Theme.of(context).colorScheme.outlineVariant)
|
||||
),
|
||||
child:
|
||||
Container(height: 1, color: Theme.of(context).colorScheme.outlineVariant)),
|
||||
if (_displaySettingsViewModel.currentTheme is BlackTheme)
|
||||
SettingsSwitcherCell(
|
||||
height: 40,
|
||||
title: S.current.oled_mode,
|
||||
value: _displaySettingsViewModel.isBlackThemeOledEnabled,
|
||||
onValueChange: (_, bool value) {
|
||||
_displaySettingsViewModel.setBlackThemeOled(value);
|
||||
},
|
||||
padding: EdgeInsets.zero,
|
||||
switchBackgroundColor: currentTheme.colorScheme.secondaryContainer,
|
||||
),
|
||||
SettingsSwitcherCell(
|
||||
height: 40,
|
||||
title: S.current.oled_mode,
|
||||
value: _displaySettingsViewModel.isBlackThemeOledEnabled,
|
||||
onValueChange: (_, bool value) {
|
||||
_displaySettingsViewModel.setBlackThemeOled(value);
|
||||
},
|
||||
padding: EdgeInsets.zero,
|
||||
switchBackgroundColor: currentTheme.colorScheme.secondaryContainer,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -26,8 +26,8 @@ class WalletConnectTile extends StatelessWidget {
|
||||
child: Text(
|
||||
S.current.walletConnect,
|
||||
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
|
||||
Reference in New Issue
Block a user