mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-07 08:04:04 +01:00
feat(send): animated hash-bag on the "Transaction Sent" screen
Replace the static success illustration with HashBagSuccessAnimation: the money sack sits at the bottom and #/$/₿ glyphs erupt from its mouth, rising and fading on a loop. Glyphs are PNG assets (the app bundles no font with a ₿ glyph). InfoPage gains an overridable buildIllustration() hook (default unchanged: static HashImageWidget); only TransactionSuccessPage overrides it, so every other InfoPage is untouched. NOTE: written without a local Flutter build (Dart pub can't resolve here) — verify on the next CI/device build. Self-contained and revertible; the static hash_bag.png remains the fallback via imageLightPath/imageDarkPath.
This commit is contained in:
@@ -21,6 +21,12 @@ abstract class InfoPage extends BasePage {
|
||||
Key? get buttonKey;
|
||||
void Function(BuildContext) get onPressed;
|
||||
|
||||
/// The illustration shown at the top of the page. Defaults to the static
|
||||
/// image at [imageLightPath]/[imageDarkPath]; subclasses can override to
|
||||
/// supply an animated widget instead.
|
||||
Widget buildIllustration(BuildContext context, String image) =>
|
||||
HashImageWidget(imageUrl: image);
|
||||
|
||||
@override
|
||||
bool get gradientBackground => true;
|
||||
|
||||
@@ -56,7 +62,7 @@ abstract class InfoPage extends BasePage {
|
||||
),
|
||||
child: AspectRatio(
|
||||
aspectRatio: 0.9,
|
||||
child: HashImageWidget(imageUrl: image),
|
||||
child: buildIllustration(context, image),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:hash_wallet/generated/i18n.dart';
|
||||
import 'package:hash_wallet/src/screens/Info_page.dart';
|
||||
import 'package:hash_wallet/src/widgets/hash_bag_success_animation.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class TransactionSuccessPage extends InfoPage {
|
||||
@@ -11,6 +12,10 @@ class TransactionSuccessPage extends InfoPage {
|
||||
|
||||
final String content;
|
||||
|
||||
@override
|
||||
Widget buildIllustration(BuildContext context, String image) =>
|
||||
const HashBagSuccessAnimation();
|
||||
|
||||
@override
|
||||
bool get onWillPop => false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user