Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
justinenerio committed Sep 13, 2024
1 parent 5f3f6d5 commit 3cf45c4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 52 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ class _StellarRecoveryNoticeState extends State<StellarRecoveryNotice> {
? ListenableBuilder(
listenable: sl<StellarRecoveryService>(),
builder: (context, child) {
Widget notice(Widget child, {bool animated = false}) =>
_RecoveryNoticeContent(
Widget notice(Widget child) => _RecoveryNoticeContent(
onClosePressed: _handleHideNoticePressed,
showAnimation: animated,
child: child,
);

Expand All @@ -57,10 +55,9 @@ class _StellarRecoveryNoticeState extends State<StellarRecoveryNotice> {
RecoveryPending() => notice(
_Pending(onRecoverPressed: _handleRecoverPressed),
),
RecoveryProcessing() =>
notice(const _Processing(), animated: true),
RecoveryProcessing() => notice(const _Processing()),
RecoveryCompleted(:final amount) =>
notice(_Completed(amount: amount), animated: true),
notice(_Completed(amount: amount)),
RecoveryFailed() => notice(
_Failed(onRecoverPressed: _handleRecoverPressed),
),
Expand Down Expand Up @@ -140,12 +137,10 @@ class _RecoveryNoticeContent extends StatelessWidget {
const _RecoveryNoticeContent({
required this.onClosePressed,
required this.child,
required this.showAnimation,
});

final VoidCallback onClosePressed;
final Widget child;
final bool showAnimation;

@override
Widget build(BuildContext context) => DefaultTextStyle(
Expand All @@ -159,45 +154,36 @@ class _RecoveryNoticeContent extends StatelessWidget {
child: Center(
child: SizedBox(
width: 360,
child: Stack(
children: [
if (showAnimation) Assets.gifs.recoveryAnimation.image(),
CpInfoWidget(
message: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 4.0,
vertical: 2,
),
child: Center(child: child),
),
child: CpInfoWidget(
message: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 4.0,
vertical: 2,
),
GestureDetector(
onTap: onClosePressed,
child: SizedBox.square(
dimension: 12,
child: Assets.icons.closeButtonIcon.svg(
color: Colors.white,
),
),
),
],
child: Center(child: child),
),
),
infoRadius: 12,
iconSize: 12,
variant: showAnimation
? CpInfoVariant.transparent
: CpInfoVariant.black,
padding: const EdgeInsets.symmetric(
vertical: 12,
horizontal: 16,
GestureDetector(
onTap: onClosePressed,
child: SizedBox.square(
dimension: 12,
child: Assets.icons.closeButtonIcon.svg(
color: Colors.white,
),
),
),
),
],
],
),
infoRadius: 12,
iconSize: 12,
variant: CpInfoVariant.black,
padding:
const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
),
),
),
Expand Down
9 changes: 1 addition & 8 deletions packages/espressocash_app/lib/ui/info_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'colors.dart';
import 'info_icon.dart';
import 'rounded_rectangle.dart';

enum CpInfoVariant { light, dark, black, transparent }
enum CpInfoVariant { light, dark, black }

class CpInfoWidget extends StatelessWidget {
const CpInfoWidget({
Expand All @@ -28,7 +28,6 @@ class CpInfoWidget extends StatelessWidget {
return CpColors.backgroundAccentColor;
case CpInfoVariant.dark:
return CpColors.darkBackgroundColor;
case CpInfoVariant.transparent:
case CpInfoVariant.black:
return Colors.black;
}
Expand Down Expand Up @@ -77,12 +76,6 @@ class CpInfoWidget extends StatelessWidget {
padding: padding,
child: content,
);
case CpInfoVariant.transparent:
return CpRoundedRectangle(
backgroundColor: Colors.transparent,
padding: padding,
child: content,
);
}
}
}

0 comments on commit 3cf45c4

Please sign in to comment.