Refactor "Do not close this window." message out of FusionProgress

This commit is contained in:
sneurlax 2023-10-19 17:05:28 -05:00
parent 8c1df0f2cf
commit 7e9baccedb
3 changed files with 39 additions and 32 deletions

View file

@ -138,8 +138,23 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
padding: const EdgeInsets.all(16),
child: Column(
children: [
// TODO if (_succeeded but roundCount > roundCount)
// show "Fusion completed" as snackBarBackSuccess.
if (_fusionRoundsCompleted == 0)
RoundedContainer(
color: Theme.of(context)
.extension<StackColors>()!
.snackBarBackError,
child: Text(
"Do not close this window. If you exit, "
"the process will be canceled.",
style:
STextStyles.smallMed14(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.snackBarTextError,
),
textAlign: TextAlign.center,
),
),
if (_fusionRoundsCompleted > 0)
Expanded(
child: RoundedContainer(
@ -158,10 +173,9 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
),
),
),
if (_fusionRoundsCompleted > 0)
const SizedBox(
height: 20,
),
const SizedBox(
height: 20,
),
FusionProgress(
walletId: widget.walletId,
),

View file

@ -183,6 +183,22 @@ class _FusionDialogViewState extends ConsumerState<FusionDialogView> {
),
child: Column(
children: [
if (_fusionRoundsCompleted == 0)
RoundedContainer(
color: Theme.of(context)
.extension<StackColors>()!
.snackBarBackError,
child: Text(
"Do not close this window. If you exit, "
"the process will be canceled.",
style: STextStyles.smallMed14(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.snackBarTextError,
),
textAlign: TextAlign.center,
),
),
if (_fusionRoundsCompleted > 0)
/*Expanded(
child: */
@ -201,10 +217,9 @@ class _FusionDialogViewState extends ConsumerState<FusionDialogView> {
),
),
// ),
if (_fusionRoundsCompleted > 0)
const SizedBox(
height: 20,
),
const SizedBox(
height: 20,
),
FusionProgress(
walletId: widget.walletId,
),

View file

@ -21,28 +21,6 @@ class FusionProgress extends ConsumerWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
RoundedContainer(
color: Theme.of(context).extension<StackColors>()!.snackBarBackError,
child: Text(
"Do not close this window. If you exit, "
"the process will be canceled.",
style: Util.isDesktop
? STextStyles.smallMed14(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.snackBarTextError,
)
: STextStyles.w500_14(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.snackBarTextError,
),
textAlign: TextAlign.center,
),
),
const SizedBox(
height: 20,
),
_ProgressItem(
iconAsset: Assets.svg.node,
label: "Connecting to server",