disable chans

This commit is contained in:
julian 2023-03-16 17:10:39 -06:00
parent 77f167171f
commit 8d0ec84ffc
2 changed files with 165 additions and 156 deletions

View file

@ -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<BuildingTransactionDialog> createState() => _RestoringDialogState();
}
class _RestoringDialogState extends State<BuildingTransactionDialog> {
// with TickerProviderStateMixin {
// late AnimationController? _spinController;
// late Animation<double> _spinAnimation;
class _RestoringDialogState extends State<BuildingTransactionDialog>
with TickerProviderStateMixin {
late AnimationController? _spinController;
late Animation<double> _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<BuildingTransactionDialog> {
const SizedBox(
height: 40,
),
if (chan)
Lottie.asset(
Assets.lottie.kiss(widget.coin),
),
// RotationTransition(
// turns: _spinAnimation,
// child: SvgPicture.asset(
// Assets.svg.arrowRotate,
// color:
// Theme.of(context).extension<StackColors>()!.accentColorDark,
// width: 24,
// height: 24,
// ),
// ),
if (!chan)
RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color:
Theme.of(context).extension<StackColors>()!.accentColorDark,
width: 24,
height: 24,
),
),
const SizedBox(
height: 40,
),
@ -98,7 +102,8 @@ class _RestoringDialogState extends State<BuildingTransactionDialog> {
onWillPop: () async {
return false;
},
child: StackDialogBase(
child: chan
? StackDialogBase(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
@ -136,35 +141,34 @@ class _RestoringDialogState extends State<BuildingTransactionDialog> {
),
],
),
)
: StackDialog(
title: "Generating transaction",
icon: RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 24,
height: 24,
),
),
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
.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: "<PLACEHOLDER>",
// icon: RotationTransition(
// turns: _spinAnimation,
// child: SvgPicture.asset(
// Assets.svg.arrowRotate,
// color:
// Theme.of(context).extension<StackColors>()!.accentColorDark,
// width: 24,
// height: 24,
// ),
// ),
// rightButton: TextButton(
// style: Theme.of(context)
// .extension<StackColors>()!
// .getSecondaryEnabledButtonStyle(context),
// child: Text(
// "Cancel",
// style: STextStyles.itemSubtitle12(context),
// ),
// onPressed: () {
// Navigator.of(context).pop();
// onCancel.call();
// },
// ),
// ),
);
}
}

View file

@ -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<SendingTransactionDialog> createState() => _RestoringDialogState();
}
class _RestoringDialogState extends State<SendingTransactionDialog> {
// with TickerProviderStateMixin {
// late AnimationController? _spinController;
// late Animation<double> _spinAnimation;
class _RestoringDialogState extends State<SendingTransactionDialog>
with TickerProviderStateMixin {
late AnimationController? _spinController;
late Animation<double> _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<SendingTransactionDialog> {
const SizedBox(
height: 40,
),
Lottie.asset(
chan
? Lottie.asset(
Assets.lottie.kiss(widget.coin),
)
: RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 24,
height: 24,
),
),
// RotationTransition(
// turns: _spinAnimation,
// child: SvgPicture.asset(
// Assets.svg.arrowRotate,
// color: Theme.of(context)
// .extension<StackColors>()!
// .accentColorDark,
// width: 24,
// height: 24,
// ),
// ),
],
),
),
@ -86,7 +91,8 @@ class _RestoringDialogState extends State<SendingTransactionDialog> {
onWillPop: () async {
return false;
},
child: StackDialogBase(
child: chan
? StackDialogBase(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
@ -104,22 +110,21 @@ class _RestoringDialogState extends State<SendingTransactionDialog> {
),
],
),
)
: StackDialog(
title: "Sending transaction",
icon: RotationTransition(
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 24,
height: 24,
),
),
),
// child: StackDialog(
// title: "Sending transaction",
// // // TODO get message from design team
// // message: "<PLACEHOLDER>",
// icon: RotationTransition(
// turns: _spinAnimation,
// child: SvgPicture.asset(
// Assets.svg.arrowRotate,
// color:
// Theme.of(context).extension<StackColors>()!.accentColorDark,
// width: 24,
// height: 24,
// ),
// ),
// ),
);
}
}