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/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,27 +109,53 @@ class _DesktopExchangeViewState extends ConsumerState<DesktopExchangeView> {
right: 24,
bottom: 24,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
child: Column(
children: [
Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
child: Text(
"Exchange details",
style: STextStyles.desktopTextExtraExtraSmall(context),
),
),
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 SizedBox(
height: 16,
),
const RoundedWhiteContainer(
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Expanded(
child: RoundedWhiteContainer(
padding: EdgeInsets.all(24),
child: ExchangeForm(),
),
],
),
),
const SizedBox(
width: 16,
@ -143,6 +172,9 @@ class _DesktopExchangeViewState extends ConsumerState<DesktopExchangeView> {
],
),
),
],
),
),
),
);
}

View file

@ -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<DesktopTradeHistory> {
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(