mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-18 05:51:34 +02:00
fix(buy/sell-flow): add buy/sell toggle to DesktopExchangeCardsSection
The desktop exchange screen was only showing the buy flow with no way to switch to sell. This change adds the missing toggle to the DesktopExchangeCardsSection and links it up in the buy/sell page
This commit is contained in:
@@ -490,11 +490,19 @@ class BuySellPage extends BasePage {
|
||||
return DesktopExchangeCardsSection(
|
||||
firstExchangeCard: fiatExchangeCard,
|
||||
secondExchangeCard: cryptoExchangeCard,
|
||||
onBuyTap: () => null,
|
||||
onSellTap: () =>
|
||||
buySellViewModel.isBuyAction ? buySellViewModel.changeBuySellAction() : null,
|
||||
isBuySellOption: true,
|
||||
);
|
||||
} else {
|
||||
return DesktopExchangeCardsSection(
|
||||
firstExchangeCard: cryptoExchangeCard,
|
||||
secondExchangeCard: fiatExchangeCard,
|
||||
onBuyTap: () =>
|
||||
!buySellViewModel.isBuyAction ? buySellViewModel.changeBuySellAction() : null,
|
||||
onSellTap: () => null,
|
||||
isBuySellOption: true,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
import 'package:cake_wallet/src/screens/exchange/widgets/mobile_exchange_cards_section.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DesktopExchangeCardsSection extends StatelessWidget {
|
||||
final Widget firstExchangeCard;
|
||||
final Widget secondExchangeCard;
|
||||
|
||||
const DesktopExchangeCardsSection({
|
||||
Key? key,
|
||||
required this.firstExchangeCard,
|
||||
required this.secondExchangeCard,
|
||||
this.isBuySellOption = false,
|
||||
this.onBuyTap,
|
||||
this.onSellTap,
|
||||
}) : super(key: key);
|
||||
|
||||
final Widget firstExchangeCard;
|
||||
final Widget secondExchangeCard;
|
||||
final bool isBuySellOption;
|
||||
final VoidCallback? onBuyTap;
|
||||
final VoidCallback? onSellTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FocusTraversalGroup(
|
||||
@@ -18,7 +25,18 @@ class DesktopExchangeCardsSection extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 55, left: 24, right: 24),
|
||||
child: firstExchangeCard,
|
||||
child: Column(
|
||||
children: [
|
||||
if (isBuySellOption)
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
BuySellOptionButtons(onBuyTap: onBuyTap, onSellTap: onSellTap),
|
||||
],
|
||||
),
|
||||
firstExchangeCard,
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 29, left: 24, right: 24),
|
||||
|
||||
Reference in New Issue
Block a user