From 0062294488559010d4cd8a22f681100cbc3662b6 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 2 Jan 2023 13:16:59 -0600 Subject: [PATCH] disable wownero on desktop and xmr on windows --- .../add_wallet_view/add_wallet_view.dart | 12 +++++++++++- .../settings/settings_menu/nodes_settings.dart | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart index b9b04cec8..a0190cfef 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/sub_widgets/add_wallet_text.dart'; @@ -37,11 +39,19 @@ class _AddWalletViewState extends State { final List coins = [...Coin.values]; + final bool isDesktop = Util.isDesktop; + @override void initState() { _searchFieldController = TextEditingController(); _searchFocusNode = FocusNode(); coins.remove(Coin.firoTestNet); + if (isDesktop) { + coins.remove(Coin.wownero); + if (Platform.isWindows) { + coins.remove(Coin.monero); + } + } super.initState(); } @@ -56,7 +66,7 @@ class _AddWalletViewState extends State { Widget build(BuildContext context) { debugPrint("BUILD: $runtimeType"); - if (Util.isDesktop) { + if (isDesktop) { return DesktopScaffold( appBar: const DesktopAppBar( isCompactHeight: false, diff --git a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart index a7e95d33a..8840383d7 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -46,10 +48,18 @@ class _NodesSettings extends ConsumerState { .toList(); } + final bool isDesktop = Util.isDesktop; + @override void initState() { _coins = _coins.toList(); _coins.remove(Coin.firoTestNet); + if (isDesktop) { + _coins.remove(Coin.wownero); + if (Platform.isWindows) { + _coins.remove(Coin.monero); + } + } searchNodeController = TextEditingController(); searchNodeFocusNode = FocusNode(); @@ -128,8 +138,8 @@ class _NodesSettings extends ConsumerState { Constants.size.circularBorderRadius, ), child: TextField( - autocorrect: Util.isDesktop ? false : true, - enableSuggestions: Util.isDesktop ? false : true, + autocorrect: !isDesktop, + enableSuggestions: !isDesktop, controller: searchNodeController, focusNode: searchNodeFocusNode, onChanged: (newString) {