WIP: trade details for desktop

This commit is contained in:
julian 2022-11-09 13:12:41 -06:00
parent af47c67231
commit 2aa8dd2bec
2 changed files with 872 additions and 530 deletions

File diff suppressed because it is too large Load diff

View file

@ -7,10 +7,14 @@ import 'package:stackwallet/pages/exchange_view/trade_details_view.dart';
import 'package:stackwallet/pages/wallet_view/sub_widgets/no_transactions_found.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/no_transactions_found.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';
import 'package:stackwallet/route_generator.dart';
import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/services/coins/manager.dart';
import 'package:stackwallet/utilities/constants.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/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:stackwallet/widgets/loading_indicator.dart'; import 'package:stackwallet/widgets/loading_indicator.dart';
import 'package:stackwallet/widgets/trade_card.dart'; import 'package:stackwallet/widgets/trade_card.dart';
import 'package:stackwallet/widgets/transaction_card.dart'; import 'package:stackwallet/widgets/transaction_card.dart';
@ -94,18 +98,79 @@ class _TransactionsListState extends ConsumerState<TransactionsList> {
// this may mess with combined firo transactions // this may mess with combined firo transactions
key: Key(tx.toString() + trade.uuid), // key: Key(tx.toString() + trade.uuid), //
trade: trade, trade: trade,
onTap: () { onTap: () async {
unawaited( if (Util.isDesktop) {
Navigator.of(context).pushNamed( await showDialog<void>(
TradeDetailsView.routeName, context: context,
arguments: Tuple4( builder: (context) => Navigator(
trade.tradeId, initialRoute: TradeDetailsView.routeName,
tx, onGenerateRoute: RouteGenerator.generateRoute,
widget.walletId, onGenerateInitialRoutes: (_, __) {
ref.read(managerProvider).walletName, return [
FadePageRoute(
DesktopDialog(
// maxHeight:
// MediaQuery.of(context).size.height - 64,
maxHeight: double.infinity,
maxWidth: 580,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.only(
left: 32,
bottom: 16,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
"Trade details",
style: STextStyles.desktopH3(context),
),
DesktopDialogCloseButton(
onPressedOverride: Navigator.of(
context,
rootNavigator: true,
).pop,
),
],
),
),
Flexible(
child: TradeDetailsView(
tradeId: trade.tradeId,
transactionIfSentFromStack: tx,
walletName:
ref.read(managerProvider).walletName,
walletId: widget.walletId,
),
),
],
),
),
const RouteSettings(
name: TradeDetailsView.routeName,
),
),
];
},
), ),
), );
); } else {
unawaited(
Navigator.of(context).pushNamed(
TradeDetailsView.routeName,
arguments: Tuple4(
trade.tradeId,
tx,
widget.walletId,
ref.read(managerProvider).walletName,
),
),
);
}
}, },
) )
], ],