mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-26 00:58:50 +00:00
desktop trade history scroll fix
This commit is contained in:
parent
157829a933
commit
467d43d9f3
2 changed files with 217 additions and 167 deletions
|
@ -63,19 +63,9 @@ class _DesktopExchangeViewState extends State<DesktopExchangeView> {
|
|||
width: 16,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Exchange details",
|
||||
style: STextStyles.desktopTextExtraExtraSmall(context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
const RoundedWhiteContainer(
|
||||
padding: EdgeInsets.all(0),
|
||||
child: Row(
|
||||
children: const [
|
||||
Expanded(
|
||||
child: DesktopTradeHistory(),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'package:stackwallet/pages/exchange_view/trade_details_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';
|
||||
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/rounded_white_container.dart';
|
||||
|
@ -24,6 +25,28 @@ class DesktopTradeHistory extends ConsumerStatefulWidget {
|
|||
}
|
||||
|
||||
class _DesktopTradeHistoryState extends ConsumerState<DesktopTradeHistory> {
|
||||
BorderRadius get _borderRadiusFirst {
|
||||
return BorderRadius.only(
|
||||
topLeft: Radius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
topRight: Radius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
BorderRadius get _borderRadiusLast {
|
||||
return BorderRadius.only(
|
||||
bottomLeft: Radius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
bottomRight: Radius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final trades =
|
||||
|
@ -33,17 +56,42 @@ class _DesktopTradeHistoryState extends ConsumerState<DesktopTradeHistory> {
|
|||
final hasHistory = tradeCount > 0;
|
||||
|
||||
if (hasHistory) {
|
||||
return ListView.separated(
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Exchange details",
|
||||
style: STextStyles.desktopTextExtraExtraSmall(context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
itemBuilder: (context, index) {
|
||||
return TradeCard(
|
||||
BorderRadius? radius;
|
||||
if (index == tradeCount - 1) {
|
||||
radius = _borderRadiusLast;
|
||||
} else if (index == 0) {
|
||||
radius = _borderRadiusFirst;
|
||||
}
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||
borderRadius: radius,
|
||||
),
|
||||
child: TradeCard(
|
||||
key: Key("tradeCard_${trades[index].uuid}"),
|
||||
trade: trades[index],
|
||||
onTap: () async {
|
||||
final String tradeId = trades[index].tradeId;
|
||||
|
||||
final lookup = ref.read(tradeSentFromStackLookupProvider).all;
|
||||
final lookup =
|
||||
ref.read(tradeSentFromStackLookupProvider).all;
|
||||
|
||||
debugPrint("ALL: $lookup");
|
||||
|
||||
|
@ -54,7 +102,9 @@ class _DesktopTradeHistoryState extends ConsumerState<DesktopTradeHistory> {
|
|||
.read(tradeSentFromStackLookupProvider)
|
||||
.getWalletIdsForTradeId(tradeId);
|
||||
|
||||
if (txid != null && walletIds != null && walletIds.isNotEmpty) {
|
||||
if (txid != null &&
|
||||
walletIds != null &&
|
||||
walletIds.isNotEmpty) {
|
||||
final manager = ref
|
||||
.read(walletsChangeNotifierProvider)
|
||||
.getManager(walletIds.first);
|
||||
|
@ -90,14 +140,17 @@ class _DesktopTradeHistoryState extends ConsumerState<DesktopTradeHistory> {
|
|||
),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Trade details",
|
||||
style: STextStyles.desktopH3(context),
|
||||
style: STextStyles.desktopH3(
|
||||
context),
|
||||
),
|
||||
DesktopDialogCloseButton(
|
||||
onPressedOverride: Navigator.of(
|
||||
onPressedOverride:
|
||||
Navigator.of(
|
||||
context,
|
||||
rootNavigator: true,
|
||||
).pop,
|
||||
|
@ -150,14 +203,17 @@ class _DesktopTradeHistoryState extends ConsumerState<DesktopTradeHistory> {
|
|||
),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Trade details",
|
||||
style: STextStyles.desktopH3(context),
|
||||
style: STextStyles.desktopH3(
|
||||
context),
|
||||
),
|
||||
DesktopDialogCloseButton(
|
||||
onPressedOverride: Navigator.of(
|
||||
onPressedOverride:
|
||||
Navigator.of(
|
||||
context,
|
||||
rootNavigator: true,
|
||||
).pop,
|
||||
|
@ -187,6 +243,7 @@ class _DesktopTradeHistoryState extends ConsumerState<DesktopTradeHistory> {
|
|||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) {
|
||||
|
@ -196,6 +253,9 @@ class _DesktopTradeHistoryState extends ConsumerState<DesktopTradeHistory> {
|
|||
);
|
||||
},
|
||||
itemCount: tradeCount,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return RoundedWhiteContainer(
|
||||
|
|
Loading…
Reference in a new issue