From 6eb9651fbbb9e9d17dc84bbbdd2c977100208d97 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 11 Apr 2023 11:52:19 -0600 Subject: [PATCH] desktop trade view layout fixes --- .../desktop_exchange_view.dart | 70 ++++++++++++++----- .../subwidgets/desktop_trade_history.dart | 32 +++------ 2 files changed, 59 insertions(+), 43 deletions(-) diff --git a/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart index e45f2d234..6c09ecd60 100644 --- a/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart +++ b/lib/pages_desktop_specific/desktop_exchange/desktop_exchange_view.dart @@ -8,11 +8,14 @@ import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; +import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart'; import 'package:stackwallet/widgets/custom_loading_overlay.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; +import 'desktop_all_trades_view.dart'; + class DesktopExchangeView extends ConsumerStatefulWidget { const DesktopExchangeView({Key? key}) : super(key: key); @@ -106,36 +109,65 @@ class _DesktopExchangeViewState extends ConsumerState { right: 24, bottom: 24, ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + child: Column( children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( + Row( + children: [ + Expanded( + child: Text( "Exchange details", style: STextStyles.desktopTextExtraExtraSmall(context), ), - const SizedBox( - height: 16, + ), + const SizedBox( + width: 16, + ), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Recent trades", + style: + STextStyles.desktopTextExtraExtraSmall(context), + ), + CustomTextButton( + text: "See all", + onTap: () { + Navigator.of(context).pushNamed( + DesktopAllTradesView.routeName, + ); + }, + ), + ], ), - const RoundedWhiteContainer( - padding: EdgeInsets.all(24), - child: ExchangeForm(), - ), - ], - ), + ), + ], ), const SizedBox( - width: 16, + height: 16, ), Expanded( child: Row( - children: const [ + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Expanded( + child: RoundedWhiteContainer( + padding: EdgeInsets.all(24), + child: ExchangeForm(), + ), + ), + const SizedBox( + width: 16, + ), Expanded( - child: DesktopTradeHistory(), + child: Row( + children: const [ + Expanded( + child: DesktopTradeHistory(), + ), + ], + ), ), ], ), diff --git a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart index a7dcca99f..707976425 100644 --- a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart +++ b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart @@ -5,7 +5,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:isar/isar.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; import 'package:stackwallet/pages/exchange_view/trade_details_view.dart'; -import 'package:stackwallet/pages_desktop_specific/desktop_exchange/desktop_all_trades_view.dart'; import 'package:stackwallet/providers/exchange/trade_sent_from_stack_lookup_provider.dart'; import 'package:stackwallet/providers/global/trades_service_provider.dart'; import 'package:stackwallet/providers/global/wallets_provider.dart'; @@ -13,7 +12,6 @@ import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; -import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -65,35 +63,21 @@ class _DesktopTradeHistoryState extends ConsumerState { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Recent trades", - style: STextStyles.desktopTextExtraExtraSmall(context), - ), - CustomTextButton( - text: "See all", - onTap: () { - Navigator.of(context) - .pushNamed(DesktopAllTradesView.routeName); - }, - ), - ], - ), - const SizedBox( - height: 16, - ), Expanded( child: ListView.separated( shrinkWrap: true, primary: false, itemBuilder: (context, index) { BorderRadius? radius; - if (index == tradeCount - 1) { - radius = _borderRadiusLast; - } else if (index == 0) { + if (index == 0) { radius = _borderRadiusFirst; + if (tradeCount == 1) { + radius = BorderRadius.circular( + Constants.size.checkboxBorderRadius, + ); + } + } else if (index == tradeCount - 1) { + radius = _borderRadiusLast; } return Container(