mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-26 00:58:50 +00:00
creating trade overlay
This commit is contained in:
parent
4283ce9360
commit
89e609254f
1 changed files with 29 additions and 2 deletions
|
@ -16,6 +16,7 @@ import 'package:stackwallet/utilities/clipboard_interface.dart';
|
|||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
|
||||
|
@ -222,6 +223,26 @@ class _Step3ViewState extends ConsumerState<Step3View> {
|
|||
Expanded(
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
unawaited(
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (_) => WillPopScope(
|
||||
onWillPop: () async => false,
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.overlay
|
||||
.withOpacity(0.6),
|
||||
child: const CustomLoadingOverlay(
|
||||
message: "Creating a trade",
|
||||
eventBus: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
ChangeNowResponse<ExchangeTransaction>
|
||||
response;
|
||||
if (model.rateType ==
|
||||
|
@ -251,6 +272,10 @@ class _Step3ViewState extends ConsumerState<Step3View> {
|
|||
}
|
||||
|
||||
if (response.value == null) {
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
unawaited(showDialog<void>(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
|
@ -273,8 +298,6 @@ class _Step3ViewState extends ConsumerState<Step3View> {
|
|||
.getTransactionStatus(
|
||||
id: response.value!.id);
|
||||
|
||||
debugPrint("WTF: $statusResponse");
|
||||
|
||||
String status = "Waiting";
|
||||
if (statusResponse.value != null) {
|
||||
status = statusResponse.value!.status.name;
|
||||
|
@ -290,6 +313,10 @@ class _Step3ViewState extends ConsumerState<Step3View> {
|
|||
status += " for deposit";
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
unawaited(NotificationApi.showNotification(
|
||||
changeNowId: model.trade!.id,
|
||||
title: status,
|
||||
|
|
Loading…
Reference in a new issue