desktop trade view layout fixes

This commit is contained in:
julian 2023-04-11 11:52:19 -06:00
parent e72f2018d0
commit 6eb9651fbb
2 changed files with 59 additions and 43 deletions

View file

@ -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/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/conditional_parent.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/custom_loading_overlay.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart'; import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'desktop_all_trades_view.dart';
class DesktopExchangeView extends ConsumerStatefulWidget { class DesktopExchangeView extends ConsumerStatefulWidget {
const DesktopExchangeView({Key? key}) : super(key: key); const DesktopExchangeView({Key? key}) : super(key: key);
@ -106,36 +109,65 @@ class _DesktopExchangeViewState extends ConsumerState<DesktopExchangeView> {
right: 24, right: 24,
bottom: 24, bottom: 24,
), ),
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Row(
child: Column( children: [
mainAxisSize: MainAxisSize.min, Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: Text(
children: [
Text(
"Exchange details", "Exchange details",
style: STextStyles.desktopTextExtraExtraSmall(context), 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( const SizedBox(
width: 16, height: 16,
), ),
Expanded( Expanded(
child: Row( child: Row(
children: const [ crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Expanded(
child: RoundedWhiteContainer(
padding: EdgeInsets.all(24),
child: ExchangeForm(),
),
),
const SizedBox(
width: 16,
),
Expanded( Expanded(
child: DesktopTradeHistory(), child: Row(
children: const [
Expanded(
child: DesktopTradeHistory(),
),
],
),
), ),
], ],
), ),

View file

@ -5,7 +5,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:isar/isar.dart'; import 'package:isar/isar.dart';
import 'package:stackwallet/models/isar/models/blockchain_data/transaction.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/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/exchange/trade_sent_from_stack_lookup_provider.dart';
import 'package:stackwallet/providers/global/trades_service_provider.dart'; import 'package:stackwallet/providers/global/trades_service_provider.dart';
import 'package:stackwallet/providers/global/wallets_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/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.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.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -65,35 +63,21 @@ class _DesktopTradeHistoryState extends ConsumerState<DesktopTradeHistory> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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( Expanded(
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,
itemBuilder: (context, index) { itemBuilder: (context, index) {
BorderRadius? radius; BorderRadius? radius;
if (index == tradeCount - 1) { if (index == 0) {
radius = _borderRadiusLast;
} else if (index == 0) {
radius = _borderRadiusFirst; radius = _borderRadiusFirst;
if (tradeCount == 1) {
radius = BorderRadius.circular(
Constants.size.checkboxBorderRadius,
);
}
} else if (index == tradeCount - 1) {
radius = _borderRadiusLast;
} }
return Container( return Container(