mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
Refactor WalletConnect UI components and enhance transaction approval and signing flow (#3233)
* Refactor WalletConnect UI components and enhance transaction approval and signing flow * Refactor WalletConnect UI components and enhance transaction approval and signing flow * Remove unused ui components * Enhance pairing details page and remove unused ui components * adjust buttons on details page * Add warning banner for scam dApps on connection requests * General cleanup * Parse and display estimated network fee for WalletConnect approval requests * Revamp WalletConnect pair listing view * Remove unused action buttons and walletkit methods * update svg and sync with dev
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:vector_graphics/vector_graphics.dart';
|
||||
|
||||
@@ -15,7 +13,9 @@ class CakeImageWidget extends StatelessWidget {
|
||||
this.errorWidget,
|
||||
this.color,
|
||||
this.colorFilter,
|
||||
this.borderRadius = 24.0, this.alignment, this.allowDrawingOutsideViewBox,
|
||||
this.borderRadius = 24.0,
|
||||
this.alignment,
|
||||
this.allowDrawingOutsideViewBox,
|
||||
});
|
||||
|
||||
final String? imageUrl;
|
||||
@@ -38,8 +38,8 @@ class CakeImageWidget extends StatelessWidget {
|
||||
|
||||
final isSvg = imageUrl!.toLowerCase().endsWith('.svg');
|
||||
final isAsset = imageUrl!.startsWith('assets/');
|
||||
final effectiveColorFilter = colorFilter ??
|
||||
(color != null ? ColorFilter.mode(color!, BlendMode.srcIn) : null);
|
||||
final effectiveColorFilter =
|
||||
colorFilter ?? (color != null ? ColorFilter.mode(color!, BlendMode.srcIn) : null);
|
||||
|
||||
Widget imageWidget;
|
||||
if (isAsset) {
|
||||
@@ -49,8 +49,7 @@ class CakeImageWidget extends StatelessWidget {
|
||||
width: width,
|
||||
alignment: alignment ?? Alignment.center,
|
||||
allowDrawingOutsideViewBox: allowDrawingOutsideViewBox ?? false,
|
||||
colorFilter:
|
||||
effectiveColorFilter,
|
||||
colorFilter: effectiveColorFilter,
|
||||
fit: fit ?? BoxFit.contain, errorBuilder: (context, e, trace) {
|
||||
return SvgPicture.asset(
|
||||
imageUrl!,
|
||||
@@ -59,8 +58,7 @@ class CakeImageWidget extends StatelessWidget {
|
||||
allowDrawingOutsideViewBox: allowDrawingOutsideViewBox ?? false,
|
||||
width: width,
|
||||
errorBuilder: (_, __, ___) => SizedBox(height: height, width: width),
|
||||
colorFilter:
|
||||
effectiveColorFilter,
|
||||
colorFilter: effectiveColorFilter,
|
||||
fit: fit ?? BoxFit.contain,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -23,7 +23,9 @@ class ListItemRegularRowWidget extends StatelessWidget {
|
||||
this.trailingIconSize,
|
||||
this.bottomWidget,
|
||||
this.trailingWidget,
|
||||
this.copyableText
|
||||
this.copyableText,
|
||||
this.leadingIconErrorWidget,
|
||||
this.leadingIconSize,
|
||||
});
|
||||
|
||||
final String keyValue;
|
||||
@@ -42,6 +44,8 @@ class ListItemRegularRowWidget extends StatelessWidget {
|
||||
final Color? foregroundColor;
|
||||
final double? trailingIconSize;
|
||||
final String? copyableText;
|
||||
final Widget? leadingIconErrorWidget;
|
||||
final double? leadingIconSize;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -78,8 +82,9 @@ class ListItemRegularRowWidget extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(right: 12.0),
|
||||
child: CakeImageWidget(
|
||||
imageUrl: iconPath!,
|
||||
width: 24,
|
||||
height: 24,
|
||||
width: leadingIconSize ?? 24,
|
||||
height: leadingIconSize ?? 24,
|
||||
errorWidget: leadingIconErrorWidget,
|
||||
)),
|
||||
Flexible(
|
||||
child: Column(
|
||||
|
||||
@@ -107,6 +107,8 @@ class NewListSections extends StatelessWidget {
|
||||
trailingIconSize: item.trailingIconSize,
|
||||
trailingWidget: item.trailingWidget,
|
||||
bottomWidget: item.bottomWidget,
|
||||
leadingIconErrorWidget: item.leadingIconErrorWidget,
|
||||
leadingIconSize: item.leadingIconSize,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user