From 8d0ec84ffce7b82df56404cc17a1fe9df94c3868 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 16 Mar 2023 17:10:39 -0600 Subject: [PATCH] disable chans --- .../building_transaction_dialog.dart | 192 +++++++++--------- .../sending_transaction_dialog.dart | 129 ++++++------ 2 files changed, 165 insertions(+), 156 deletions(-) diff --git a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart index dcff027c2..d02db57d2 100644 --- a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart +++ b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:lottie/lottie.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -22,34 +23,36 @@ class BuildingTransactionDialog extends StatefulWidget { State createState() => _RestoringDialogState(); } -class _RestoringDialogState extends State { - // with TickerProviderStateMixin { - // late AnimationController? _spinController; - // late Animation _spinAnimation; +class _RestoringDialogState extends State + with TickerProviderStateMixin { + late AnimationController? _spinController; + late Animation _spinAnimation; late final VoidCallback onCancel; + final bool chan = false; + @override void initState() { onCancel = widget.onCancel; - // _spinController = AnimationController( - // duration: const Duration(seconds: 2), - // vsync: this, - // )..repeat(); - // - // _spinAnimation = CurvedAnimation( - // parent: _spinController!, - // curve: Curves.linear, - // ); + _spinController = AnimationController( + duration: const Duration(seconds: 2), + vsync: this, + )..repeat(); + + _spinAnimation = CurvedAnimation( + parent: _spinController!, + curve: Curves.linear, + ); super.initState(); } @override void dispose() { - // _spinController?.dispose(); - // _spinController = null; + _spinController?.dispose(); + _spinController = null; super.dispose(); } @@ -67,20 +70,21 @@ class _RestoringDialogState extends State { const SizedBox( height: 40, ), - - Lottie.asset( - Assets.lottie.kiss(widget.coin), - ), - // RotationTransition( - // turns: _spinAnimation, - // child: SvgPicture.asset( - // Assets.svg.arrowRotate, - // color: - // Theme.of(context).extension()!.accentColorDark, - // width: 24, - // height: 24, - // ), - // ), + if (chan) + Lottie.asset( + Assets.lottie.kiss(widget.coin), + ), + if (!chan) + RotationTransition( + turns: _spinAnimation, + child: SvgPicture.asset( + Assets.svg.arrowRotate, + color: + Theme.of(context).extension()!.accentColorDark, + width: 24, + height: 24, + ), + ), const SizedBox( height: 40, ), @@ -98,73 +102,73 @@ class _RestoringDialogState extends State { onWillPop: () async { return false; }, - child: StackDialogBase( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisSize: MainAxisSize.min, - children: [ - Lottie.asset( - Assets.lottie.kiss(widget.coin), - ), - Text( - "Generating transaction", - textAlign: TextAlign.center, - style: STextStyles.pageTitleH2(context), - ), - const SizedBox( - height: 32, - ), - Row( - children: [ - const Spacer(), - Expanded( - child: TextButton( - style: Theme.of(context) - .extension()! - .getSecondaryEnabledButtonStyle(context), - child: Text( - "Cancel", - style: STextStyles.itemSubtitle12(context), - ), - onPressed: () { - Navigator.of(context).pop(); - onCancel.call(); - }, + child: chan + ? StackDialogBase( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + children: [ + Lottie.asset( + Assets.lottie.kiss(widget.coin), ), - ) - ], + Text( + "Generating transaction", + textAlign: TextAlign.center, + style: STextStyles.pageTitleH2(context), + ), + const SizedBox( + height: 32, + ), + Row( + children: [ + const Spacer(), + Expanded( + child: TextButton( + style: Theme.of(context) + .extension()! + .getSecondaryEnabledButtonStyle(context), + child: Text( + "Cancel", + style: STextStyles.itemSubtitle12(context), + ), + onPressed: () { + Navigator.of(context).pop(); + onCancel.call(); + }, + ), + ) + ], + ), + ], + ), + ) + : StackDialog( + title: "Generating transaction", + icon: RotationTransition( + turns: _spinAnimation, + child: SvgPicture.asset( + Assets.svg.arrowRotate, + color: Theme.of(context) + .extension()! + .accentColorDark, + width: 24, + height: 24, + ), + ), + rightButton: TextButton( + style: Theme.of(context) + .extension()! + .getSecondaryEnabledButtonStyle(context), + child: Text( + "Cancel", + style: STextStyles.itemSubtitle12(context), + ), + onPressed: () { + Navigator.of(context).pop(); + onCancel.call(); + }, + ), ), - ], - ), - ), - // child: StackDialog( - // title: "Generating transaction", - // // // TODO get message from design team - // // message: "", - // icon: RotationTransition( - // turns: _spinAnimation, - // child: SvgPicture.asset( - // Assets.svg.arrowRotate, - // color: - // Theme.of(context).extension()!.accentColorDark, - // width: 24, - // height: 24, - // ), - // ), - // rightButton: TextButton( - // style: Theme.of(context) - // .extension()! - // .getSecondaryEnabledButtonStyle(context), - // child: Text( - // "Cancel", - // style: STextStyles.itemSubtitle12(context), - // ), - // onPressed: () { - // Navigator.of(context).pop(); - // onCancel.call(); - // }, - // ), - // ), ); } } diff --git a/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart b/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart index a8df68d6f..a84256558 100644 --- a/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart +++ b/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart @@ -1,8 +1,10 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:lottie/lottie.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -19,30 +21,32 @@ class SendingTransactionDialog extends StatefulWidget { State createState() => _RestoringDialogState(); } -class _RestoringDialogState extends State { - // with TickerProviderStateMixin { - // late AnimationController? _spinController; - // late Animation _spinAnimation; +class _RestoringDialogState extends State + with TickerProviderStateMixin { + late AnimationController? _spinController; + late Animation _spinAnimation; + + final bool chan = false; @override void initState() { - // _spinController = AnimationController( - // duration: const Duration(seconds: 2), - // vsync: this, - // )..repeat(); - // - // _spinAnimation = CurvedAnimation( - // parent: _spinController!, - // curve: Curves.linear, - // ); + _spinController = AnimationController( + duration: const Duration(seconds: 2), + vsync: this, + )..repeat(); + + _spinAnimation = CurvedAnimation( + parent: _spinController!, + curve: Curves.linear, + ); super.initState(); } @override void dispose() { - // _spinController?.dispose(); - // _spinController = null; + _spinController?.dispose(); + _spinController = null; super.dispose(); } @@ -63,20 +67,21 @@ class _RestoringDialogState extends State { const SizedBox( height: 40, ), - Lottie.asset( - Assets.lottie.kiss(widget.coin), - ), - // RotationTransition( - // turns: _spinAnimation, - // child: SvgPicture.asset( - // Assets.svg.arrowRotate, - // color: Theme.of(context) - // .extension()! - // .accentColorDark, - // width: 24, - // height: 24, - // ), - // ), + chan + ? Lottie.asset( + Assets.lottie.kiss(widget.coin), + ) + : RotationTransition( + turns: _spinAnimation, + child: SvgPicture.asset( + Assets.svg.arrowRotate, + color: Theme.of(context) + .extension()! + .accentColorDark, + width: 24, + height: 24, + ), + ), ], ), ), @@ -86,40 +91,40 @@ class _RestoringDialogState extends State { onWillPop: () async { return false; }, - child: StackDialogBase( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisSize: MainAxisSize.min, - children: [ - Lottie.asset( - Assets.lottie.kiss(widget.coin), + child: chan + ? StackDialogBase( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + children: [ + Lottie.asset( + Assets.lottie.kiss(widget.coin), + ), + Text( + "Sending transaction", + textAlign: TextAlign.center, + style: STextStyles.pageTitleH2(context), + ), + const SizedBox( + height: 32, + ), + ], + ), + ) + : StackDialog( + title: "Sending transaction", + icon: RotationTransition( + turns: _spinAnimation, + child: SvgPicture.asset( + Assets.svg.arrowRotate, + color: Theme.of(context) + .extension()! + .accentColorDark, + width: 24, + height: 24, + ), + ), ), - Text( - "Sending transaction", - textAlign: TextAlign.center, - style: STextStyles.pageTitleH2(context), - ), - const SizedBox( - height: 32, - ), - ], - ), - ), - // child: StackDialog( - // title: "Sending transaction", - // // // TODO get message from design team - // // message: "", - // icon: RotationTransition( - // turns: _spinAnimation, - // child: SvgPicture.asset( - // Assets.svg.arrowRotate, - // color: - // Theme.of(context).extension()!.accentColorDark, - // width: 24, - // height: 24, - // ), - // ), - // ), ); } }