Skip to content

Commit 005bcff

Browse files
committed
fix: PR review issues
- Dead V1 fields left behind. - Opacity widget triggers a saveLayer() - Tiny nit in TxItemSkeleton
1 parent 750c246 commit 005bcff

2 files changed

Lines changed: 23 additions & 39 deletions

File tree

mobile-app/lib/features/components/skeleton.dart

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:quantus_sdk/quantus_sdk.dart';
23
import 'package:resonance_network_wallet/v2/theme/app_colors.dart';
34

45
/// A skeleton widget with shimmer animation for loading states
@@ -54,24 +55,21 @@ class _SkeletonState extends State<Skeleton> with SingleTickerProviderStateMixin
5455
width: widget.width,
5556
height: widget.height,
5657
decoration: BoxDecoration(borderRadius: borderRadius, color: context.colors.skeletonBase),
57-
child: Opacity(
58-
opacity: 0.2,
59-
child: Container(
60-
width: widget.width,
61-
height: widget.height,
62-
decoration: BoxDecoration(
63-
borderRadius: borderRadius,
64-
gradient: LinearGradient(
65-
begin: Alignment.centerLeft,
66-
end: Alignment.centerRight,
67-
colors: [
68-
context.colors.skeletonHighlightA,
69-
context.colors.skeletonHighlightB,
70-
context.colors.skeletonHighlightA,
71-
],
72-
stops: const [0.0, 0.5, 1.0],
73-
transform: _SlideGradientTransform(_animation.value),
74-
),
58+
child: Container(
59+
width: widget.width,
60+
height: widget.height,
61+
decoration: BoxDecoration(
62+
borderRadius: borderRadius,
63+
gradient: LinearGradient(
64+
begin: Alignment.centerLeft,
65+
end: Alignment.centerRight,
66+
colors: [
67+
context.colors.skeletonHighlightA.useOpacity(0.2),
68+
context.colors.skeletonHighlightB.useOpacity(0.2),
69+
context.colors.skeletonHighlightA.useOpacity(0.2),
70+
],
71+
stops: const [0.0, 0.5, 1.0],
72+
transform: _SlideGradientTransform(_animation.value),
7573
),
7674
),
7775
),
@@ -97,27 +95,27 @@ class TxItemSkeleton extends StatelessWidget {
9795

9896
@override
9997
Widget build(BuildContext context) {
100-
final double txItemHeight = 32.0;
101-
final double txItemDetailHeight = 12.0;
98+
const double txItemHeight = 32.0;
99+
const double txItemDetailHeight = 12.0;
102100

103-
return Row(
101+
return const Row(
104102
children: [
105103
Skeleton(width: txItemHeight, height: txItemHeight),
106-
const SizedBox(width: 12),
104+
SizedBox(width: 12),
107105
Column(
108106
crossAxisAlignment: CrossAxisAlignment.start,
109107
children: [
110108
Skeleton(width: 64, height: txItemDetailHeight),
111-
const SizedBox(height: 6),
109+
SizedBox(height: 6),
112110
Skeleton(width: 52, height: txItemDetailHeight),
113111
],
114112
),
115-
const Spacer(),
113+
Spacer(),
116114
Column(
117115
crossAxisAlignment: CrossAxisAlignment.end,
118116
children: [
119117
Skeleton(width: 100, height: txItemDetailHeight),
120-
const SizedBox(height: 6),
118+
SizedBox(height: 6),
121119
Skeleton(width: 88, height: txItemDetailHeight),
122120
],
123121
),

mobile-app/lib/features/styles/app_colors_theme.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
3838
final Color buttonSuccess;
3939
final Color buttonNeutral;
4040
final List<Color> buttonPrimary;
41-
final Color skeletonBase;
42-
final Color skeletonHighlight;
4341
final Color accountTagGuardian;
4442
final Color accountTagEntrusted;
4543
final Color accountTagHighSecurity;
@@ -78,8 +76,6 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
7876
required this.buttonSuccess,
7977
required this.buttonNeutral,
8078
required this.buttonPrimary,
81-
required this.skeletonBase,
82-
required this.skeletonHighlight,
8379
required this.accountTagGuardian,
8480
required this.accountTagEntrusted,
8581
required this.accountTagHighSecurity,
@@ -120,8 +116,6 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
120116
buttonSuccess: const Color(0xFF1FFFA7),
121117
buttonNeutral: const Color(0xFFF4F6F9),
122118
buttonPrimary: const [Color(0xFF0000FF), Color(0xFFED4CCE)],
123-
skeletonBase: const Color(0xFF3D3C44),
124-
skeletonHighlight: const Color(0xFF5A5A5A),
125119
accountTagGuardian: const Color(0xFF9747FF),
126120
accountTagEntrusted: const Color(0xFFFFD541),
127121
accountTagHighSecurity: const Color(0xFF4CEDE7),
@@ -162,8 +156,6 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
162156
buttonSuccess: const Color(0xFF1FFFA7),
163157
buttonNeutral: const Color(0xFFF4F6F9),
164158
buttonPrimary: const [Color(0xFF0000FF), Color(0xFFED4CCE)],
165-
skeletonBase: const Color(0xFF3D3C44),
166-
skeletonHighlight: const Color(0xFF5A5A5A),
167159
accountTagGuardian: const Color(0xFF9747FF),
168160
accountTagEntrusted: const Color(0xFFFFD541),
169161
accountTagHighSecurity: const Color(0xFF4CEDE7),
@@ -204,8 +196,6 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
204196
Color? buttonNeutral,
205197
Color? buttonDanger,
206198
Color? buttonSuccess,
207-
Color? skeletonBase,
208-
Color? skeletonHighlight,
209199
Color? accountTagGuardian,
210200
Color? accountTagEntrusted,
211201
Color? accountTagHighSecurity,
@@ -243,8 +233,6 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
243233
buttonNeutral: buttonNeutral ?? this.buttonNeutral,
244234
buttonDanger: buttonDanger ?? this.buttonDanger,
245235
buttonSuccess: buttonSuccess ?? this.buttonSuccess,
246-
skeletonBase: skeletonBase ?? this.skeletonBase,
247-
skeletonHighlight: skeletonHighlight ?? this.skeletonHighlight,
248236
accountTagGuardian: accountTagGuardian ?? this.accountTagGuardian,
249237
accountTagEntrusted: accountTagEntrusted ?? this.accountTagEntrusted,
250238
accountTagHighSecurity: accountTagHighSecurity ?? this.accountTagHighSecurity,
@@ -287,8 +275,6 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
287275
buttonDanger: Color.lerp(buttonDanger, other.buttonDanger, t) ?? buttonDanger,
288276
buttonSuccess: Color.lerp(buttonSuccess, other.buttonSuccess, t) ?? buttonSuccess,
289277
buttonPrimary: other.buttonPrimary,
290-
skeletonBase: Color.lerp(skeletonBase, other.skeletonBase, t) ?? skeletonBase,
291-
skeletonHighlight: Color.lerp(skeletonHighlight, other.skeletonHighlight, t) ?? skeletonHighlight,
292278
accountTagGuardian: Color.lerp(accountTagGuardian, other.accountTagGuardian, t) ?? accountTagGuardian,
293279
accountTagEntrusted: Color.lerp(accountTagEntrusted, other.accountTagEntrusted, t) ?? accountTagEntrusted,
294280
accountTagHighSecurity:

0 commit comments

Comments
 (0)