mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
* refactor: cleanup cake_pay folder * refactor: add My Cards tab on the main screen * ui: add user card item * refactor: cakePay purchase flow * feat: add user card info * refactor: auth flow * refactor: theme data * revert * Update qr_widget.dart * fix: update with new themes * minor fixes * feat: put redemption flow under a feature flag * feat: implement simulated purchasing flow in debug mode * feat: support LTC and MWEB payments * Update savings_page.dart * fix: UI fixes * add Cake Pay transaction sent bottom sheet * localization * Update cake_pay_buy_card_page.dart * addressing review comments * fix marge conflicts
174 lines
5.9 KiB
Dart
174 lines
5.9 KiB
Dart
import 'package:auto_size_text/auto_size_text.dart';
|
|
import 'package:cake_wallet/src/widgets/simple_checkbox.dart';
|
|
|
|
|
|
|
|
import 'package:cake_wallet/utils/image_utill.dart';
|
|
|
|
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
|
import 'package:cake_wallet/themes/core/material_base_theme.dart';
|
|
|
|
|
|
import 'package:cake_wallet/routes.dart';
|
|
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
|
import 'package:cake_wallet/themes/core/material_base_theme.dart';
|
|
import 'package:flutter/gestures.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'base_bottom_sheet_widget.dart';
|
|
|
|
class LoadingBottomSheet extends BaseBottomSheet {
|
|
LoadingBottomSheet(
|
|
{required String titleText, String? titleIconPath})
|
|
: super(titleText: titleText, titleIconPath: titleIconPath, footerType: FooterType.none, maxHeight: 900);
|
|
|
|
@override
|
|
Widget contentWidget(BuildContext context) {
|
|
return SizedBox(
|
|
height: 300,
|
|
child: Center(child: CircularProgressIndicator()),
|
|
);
|
|
}
|
|
}
|
|
|
|
class InfoBottomSheet extends BaseBottomSheet {
|
|
InfoBottomSheet({
|
|
required String titleText,
|
|
String? titleIconPath,
|
|
required this.currentTheme,
|
|
required this.footerType,
|
|
this.contentImage,
|
|
this.contentImageColor,
|
|
this.contentImageSize,
|
|
this.height = 200,
|
|
this.content,
|
|
this.bottomActionPanel,
|
|
this.singleActionButtonText,
|
|
this.onSingleActionButtonPressed,
|
|
this.singleActionButtonKey,
|
|
this.doubleActionLeftButtonText,
|
|
this.doubleActionRightButtonText,
|
|
this.onLeftActionButtonPressed,
|
|
this.onRightActionButtonPressed,
|
|
this.leftActionButtonKey,
|
|
this.rightActionButtonKey,
|
|
this.showDisclaimerText = true,
|
|
Key? key,
|
|
}) : super(
|
|
titleText: titleText,
|
|
titleIconPath: titleIconPath,
|
|
maxHeight: 900,
|
|
currentTheme: currentTheme,
|
|
footerType: footerType,
|
|
singleActionButtonText: singleActionButtonText,
|
|
onSingleActionButtonPressed: onSingleActionButtonPressed,
|
|
singleActionButtonKey: singleActionButtonKey,
|
|
doubleActionLeftButtonText: doubleActionLeftButtonText,
|
|
doubleActionRightButtonText: doubleActionRightButtonText,
|
|
onLeftActionButtonPressed: onLeftActionButtonPressed,
|
|
onRightActionButtonPressed: onRightActionButtonPressed,
|
|
leftActionButtonKey: leftActionButtonKey,
|
|
rightActionButtonKey: rightActionButtonKey,
|
|
key: key);
|
|
|
|
final MaterialThemeBase currentTheme;
|
|
final FooterType footerType;
|
|
final String? contentImage;
|
|
final Color? contentImageColor;
|
|
final String? content;
|
|
final Widget? bottomActionPanel;
|
|
final String? singleActionButtonText;
|
|
final VoidCallback? onSingleActionButtonPressed;
|
|
final Key? singleActionButtonKey;
|
|
final String? doubleActionLeftButtonText;
|
|
final String? doubleActionRightButtonText;
|
|
final VoidCallback? onLeftActionButtonPressed;
|
|
final VoidCallback? onRightActionButtonPressed;
|
|
final Key? rightActionButtonKey;
|
|
final Key? leftActionButtonKey;
|
|
final double height;
|
|
final double? contentImageSize;
|
|
final bool showDisclaimerText;
|
|
|
|
|
|
@override
|
|
Widget contentWidget(BuildContext context) {
|
|
return SizedBox(
|
|
height: height,
|
|
child: Column(
|
|
children: [
|
|
if (contentImage != null)
|
|
Expanded(
|
|
flex: 4,
|
|
child: ImageUtil.getImageFromPath(
|
|
imagePath: contentImage!,
|
|
svgImageColor: contentImageColor,
|
|
fit: BoxFit.contain,
|
|
borderRadius: 10,
|
|
),
|
|
)
|
|
else
|
|
Container(),
|
|
if (content != null)
|
|
Expanded(
|
|
flex: 2,
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const Spacer(flex: 2),
|
|
Expanded(
|
|
flex: 6,
|
|
child: AutoSizeText(
|
|
content!,
|
|
textAlign: TextAlign.center,
|
|
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w500,
|
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
decoration: TextDecoration.none,
|
|
),
|
|
),
|
|
),
|
|
const Spacer(flex: 2),
|
|
],
|
|
),
|
|
),
|
|
bottomActionPanel ?? const SizedBox(),
|
|
if (showDisclaimerText)
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 20, bottom: 10),
|
|
child: RichText(
|
|
textAlign: TextAlign.center,
|
|
text: TextSpan(
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
),
|
|
children: [
|
|
TextSpan(
|
|
text: 'By continuing you agree to this ',
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
TextSpan(
|
|
text: 'disclaimer',
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
decoration: TextDecoration.underline,
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
recognizer: TapGestureRecognizer()
|
|
..onTap = () => Navigator.pushNamed(context, Routes.readThirdPartyDisclaimer),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|