Files
hash-wallet/lib/new-ui/widgets/new_primary_button.dart
T
90194f7136 CW-1523-AnyPay Redesign (#3383)
* feat: Add network selector and compatible networks screen to send page for EVMs

* feat: add redesigned payanything flow and handle cases for evms, solana and tron

* feat: adding the swap part to the entire flow

* refactor: update navigation and error handling in send and swap flows

* adjust structuring and use the chain badge icons, also fix crypto and currency values not consistent on single network picker

* fix: modify guard for non-evm chains and minor cleanup

* use multipicker layout for receive section, streamline send to available balances and adjust colors as needed

* handle btc case for picker, update style and images across

* fix all pending issues with scanning qr and network handling for both evm and non evm, plus token and amount resolving

* fix all pending issues with scanning qr and network handling for both evm and non evm, plus token and amount resolving

* fix: expand fetch for tokens across networks and fix other issues regarding scanning from homepage

* auto-reformat

* fix conflict

* handle evm qr scan from homepage and add guards for swap and switch flows

* chore: Cleanup

* chore: set estimated fee to 0 when switching wallet

* fix merge conflicts

* fix to review comments and reformatting for lints

* fix: root cause for token bug reported

* chore: cleanup

* feat: add improved anypay swap screen which focuses on the receive amount
fix: fiat input toggle erro (also present on prod)
reformat: anypay related widgets

* feat: add alert for unsupported networks in payment requests

* fix: prevent rate and provider from showing until amount is calculated and loaded
fix: remove send icon in rate widget and align to center
fix: adjust network badge in swap confirm widget

* feat: embed tokens for solana and tron in QR generated for swap from external

* test: add unit tests for Tron, Solana, and ERC681 URI handling and detection

* fix: review comments

* fix: handle more edgecases

* feat: enhance ERC681URI to support raw token amounts and decimals

* refactor: streamline EVM chain ID retrieval in send page and recipient network row

* fix: minor review comments

---------

Co-authored-by: Robert Malikowski <malikowskirobert@gmail.com>
2026-08-11 02:16:12 +02:00

63 lines
1.8 KiB
Dart

import "package:flutter/cupertino.dart";
import "package:flutter/material.dart";
class NewPrimaryButton extends StatelessWidget {
const NewPrimaryButton({
required this.onPressed,
required this.text,
required this.color,
required this.textColor,
this.image,
this.isLoading = false,
this.borderColor = Colors.transparent,
this.disabled = false,
super.key,
});
final VoidCallback onPressed;
final bool isLoading;
final bool disabled;
final Widget? image;
final Color color;
final Color textColor;
final Color borderColor;
final String text;
@override
Widget build(BuildContext context) => SizedBox(
height: 52,
child: TextButton(
onPressed: disabled ? null : onPressed,
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(
disabled ? color.withAlpha(128) : color,
),
shape: WidgetStateProperty.all<RoundedSuperellipseBorder>(
RoundedSuperellipseBorder(
borderRadius: BorderRadius.circular(18),
),
),
),
child: Center(
child: isLoading
? const CupertinoActivityIndicator()
: Row(
spacing: 10,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (image != null) image!,
Text(
text,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontSize: 14,
fontWeight: FontWeight.w600,
color: textColor,
),
),
],
),
),
),
);
}