| 1 | import 'package:cake_wallet/generated/i18n.dart'; |
| 2 | import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart'; |
| 3 | import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart'; |
| 4 | import 'package:cake_wallet/src/widgets/cake_image_widget.dart'; |
| 5 | import 'package:cw_core/crypto_currency.dart'; |
| 6 | import 'package:flutter/material.dart'; |
| 7 | |
| 8 | class NodeSharePage extends StatelessWidget { |
| 9 | const NodeSharePage({super.key, required this.uri, required this.currency}); |
| 10 | |
| 11 | final Uri uri; |
| 12 | final CryptoCurrency currency; |
| 13 | |
| 14 | @override |
| 15 | Widget build(BuildContext context) { |
| 16 | final qrSize = MediaQuery.of(context).size.width * 0.786; |
| 17 | final padding = 16.0; |
| 18 | return Container( |
| 19 | color: Theme.of(context).colorScheme.surface, |
| 20 | child: SafeArea( |
| 21 | child: Column( |
| 22 | mainAxisSize: MainAxisSize.max, |
| 23 | children: [ |
| 24 | ModalTopBar( |
| 25 | title: S.of(context).share, |
| 26 | leadingIcon: Icon(Icons.arrow_back_ios_new), |
| 27 | leadingSemanticLabel: S.of(context).seed_alert_back, |
| 28 | onLeadingPressed: Navigator.of(context).pop, |
| 29 | ), |
| 30 | Expanded( |
| 31 | child: Column( |
| 32 | mainAxisAlignment: MainAxisAlignment.center, |
| 33 | spacing: 40, |
| 34 | children: [ |
| 35 | QrImage( |
| 36 | size: qrSize - padding * 2, |
| 37 | embeddedImagePath: "assets/new-ui/node-qr-icon.svg", |
| 38 | badgeImageOnEmbeddedImagePath: currency.iconPath, |
| 39 | data: uri.toString(), |
| 40 | ), |
| 41 | Padding( |
| 42 | padding: const EdgeInsets.symmetric(horizontal: 36.0), |
| 43 | child: Text(S.of(context).node_share_desc, |
| 44 | textAlign: TextAlign.center, |
| 45 | style: TextStyle( |
| 46 | fontWeight: FontWeight.w500, |
| 47 | color: Theme.of(context).colorScheme.onSurfaceVariant)), |
| 48 | ) |
| 49 | ], |
| 50 | ), |
| 51 | ), |
| 52 | ], |
| 53 | ), |
| 54 | ), |
| 55 | ); |
| 56 | } |
| 57 | } |