mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-19 00:54:33 +00:00
hide exchange menu items contextually
WHY doesn't this work tho?
This commit is contained in:
parent
9b692f9703
commit
a080e65ee5
1 changed files with 11 additions and 10 deletions
|
@ -17,6 +17,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
|
||||||
import '../app_config.dart';
|
import '../app_config.dart';
|
||||||
import '../providers/desktop/current_desktop_menu_item.dart';
|
import '../providers/desktop/current_desktop_menu_item.dart';
|
||||||
|
import '../providers/providers.dart';
|
||||||
import '../themes/stack_colors.dart';
|
import '../themes/stack_colors.dart';
|
||||||
import '../utilities/assets.dart';
|
import '../utilities/assets.dart';
|
||||||
import '../utilities/text_styles.dart';
|
import '../utilities/text_styles.dart';
|
||||||
|
@ -114,6 +115,10 @@ class _DesktopMenuState extends ConsumerState<DesktopMenu> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final prefs = ref.watch(prefsChangeNotifierProvider);
|
||||||
|
|
||||||
|
final showExchange = prefs.showExchange;
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
color: Theme.of(context).extension<StackColors>()!.popupBG,
|
color: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
|
@ -188,11 +193,9 @@ class _DesktopMenuState extends ConsumerState<DesktopMenu> {
|
||||||
onChanged: updateSelectedMenuItem,
|
onChanged: updateSelectedMenuItem,
|
||||||
controller: controllers[0],
|
controller: controllers[0],
|
||||||
),
|
),
|
||||||
if (AppConfig.hasFeature(AppFeature.swap))
|
if (AppConfig.hasFeature(AppFeature.swap) && showExchange)
|
||||||
const SizedBox(
|
const SizedBox(height: 2),
|
||||||
height: 2,
|
if (AppConfig.hasFeature(AppFeature.swap) && showExchange)
|
||||||
),
|
|
||||||
if (AppConfig.hasFeature(AppFeature.swap))
|
|
||||||
DesktopMenuItem(
|
DesktopMenuItem(
|
||||||
duration: duration,
|
duration: duration,
|
||||||
icon: const DesktopExchangeIcon(),
|
icon: const DesktopExchangeIcon(),
|
||||||
|
@ -201,11 +204,9 @@ class _DesktopMenuState extends ConsumerState<DesktopMenu> {
|
||||||
onChanged: updateSelectedMenuItem,
|
onChanged: updateSelectedMenuItem,
|
||||||
controller: controllers[1],
|
controller: controllers[1],
|
||||||
),
|
),
|
||||||
if (AppConfig.hasFeature(AppFeature.buy))
|
if (AppConfig.hasFeature(AppFeature.buy) && showExchange)
|
||||||
const SizedBox(
|
const SizedBox(height: 2),
|
||||||
height: 2,
|
if (AppConfig.hasFeature(AppFeature.buy) && showExchange)
|
||||||
),
|
|
||||||
if (AppConfig.hasFeature(AppFeature.buy))
|
|
||||||
DesktopMenuItem(
|
DesktopMenuItem(
|
||||||
duration: duration,
|
duration: duration,
|
||||||
icon: const DesktopBuyIcon(),
|
icon: const DesktopBuyIcon(),
|
||||||
|
|
Loading…
Reference in a new issue