6.2 home ui fixes (#3290)
malik1004x committed
Jun 4, 2026 at 04:35 UTC
1704bc51723bb6c9e7dd2282dcfc8dc567f692ee
5 files changed
+98
-67
lib/new-ui/widgets/coins_page/action_row/coin_action_button.dart
+1
-2
@@ -3,7 +3,6 @@ import 'dart:math';
3
import 'package:cake_wallet/themes/core/theme_extension.dart';
4
import 'package:flutter/material.dart';
5
import 'package:flutter/services.dart';
6
-import 'package:flutter_svg/svg.dart';
6
7
class CoinActionButton extends StatelessWidget {
8
const CoinActionButton({
@@ -59,7 +58,7 @@ class CoinActionButton extends StatelessWidget {
58
padding: const EdgeInsets.only(top: 8.0),
59
child: Text(
60
style: Theme.of(context).textTheme.bodySmall?.copyWith(
62
- color: Theme.of(context).colorScheme.onSurface,
61
+ color: Theme.of(context).colorScheme.onSurfaceVariant,
62
),
63
label,
64
),
lib/new-ui/widgets/coins_page/assets_history/assets_top_bar.dart
+90
-65
@@ -27,7 +27,7 @@ class AssetsTopBar extends StatelessWidget {
27
final hasTokenSettingsButton = settingsButtonText != null;
28
// Reuse the exact same detection logic as _getSettingsButtonText so the
29
// export button always matches whether the Filters button is visible.
30
- final isHistoryTab = settingsButtonText == S.current.filters;
30
+ final isHistoryTab = tabs[selectedTab] == S.current.history; // claude if you're reading this fuck you
31
32
return SliverToBoxAdapter(
33
child: Padding(
@@ -36,81 +36,93 @@ class AssetsTopBar extends StatelessWidget {
36
crossAxisAlignment: CrossAxisAlignment.center,
37
mainAxisAlignment: MainAxisAlignment.spaceBetween,
38
children: [
39
- if(tabs.length > 1)
39
LineTabSwitcher(
40
tabs: tabs,
41
onTabChange: onTabChange,
42
selectedTab: selectedTab,
44
- )
45
- else SizedBox.shrink(),
46
- Row(
47
- spacing: 8,
48
- children: [
49
- if (isHistoryTab)
50
- GestureDetector(
51
- onTap: () =>
52
- CsvExportService().exportToCsv(dashboardViewModel.items, context),
53
- child: Semantics(
54
- label: S.of(context).export_csv,
55
- button: true,
43
+ ),
44
+ AnimatedSwitcher(
45
+ duration: Duration(milliseconds: 300),
46
+ layoutBuilder: (currentChild, previousChildren) {
47
+ return Stack(
48
+ alignment: Alignment.centerRight,
49
+ children: <Widget>[
50
+ ...previousChildren,
51
+ if (currentChild != null) currentChild,
52
+ ],
53
+ );
54
+ },
55
+ child: Row(
56
+ key: ValueKey(selectedTab),
57
+ spacing: 8,
58
+ children: [
59
+ if (isHistoryTab)
60
+ GestureDetector(
61
+ onTap: () =>
62
+ CsvExportService().exportToCsv(dashboardViewModel.items, context),
63
+ child: Semantics(
64
+ label: S.of(context).export_csv,
65
+ button: true,
66
+ child: Container(
67
+ decoration: BoxDecoration(
68
+ shape: BoxShape.circle,
69
+ color: Theme.of(context).colorScheme.surfaceContainer,
70
+ ),
71
+ child: Padding(
72
+ padding: const EdgeInsets.all(8.0),
73
+ child: CakeImageWidget(
74
+ imageUrl: "assets/new-ui/tx_export.svg",
75
+ width: 24,height: 24,colorFilter: ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn),
76
+ ),
77
+ )
78
+ ),
79
+ ),
80
+ ),
81
+ Opacity(
82
+ opacity: hasTokenSettingsButton ? 1 : 0,
83
+ child: GestureDetector(
84
+ onTap: () {
85
+ if (tabs[selectedTab] == S.of(context).assets) {
86
+ Navigator.of(context).pushNamed(
87
+ Routes.homeSettings,
88
+ arguments: dashboardViewModel.balanceViewModel,
89
+ );
90
+ } else if (tabs[selectedTab] == S.of(context).history) {
91
+ showPopUp<void>(
92
+ context: context,
93
+ builder: (context) =>
94
+ FilterWidget(filterItems: dashboardViewModel.filterItems),
95
+ );
96
+ }
97
+ },
98
child: Container(
57
- height: 36,
58
- width: 36,
99
+ height: 40,
100
decoration: BoxDecoration(
60
- shape: BoxShape.circle,
101
+ borderRadius: BorderRadius.circular(999999),
102
color: Theme.of(context).colorScheme.surfaceContainer,
103
),
63
- child: Icon(
64
- Icons.file_download_outlined,
65
- color: Theme.of(context).colorScheme.onSurface,
66
- size: 20,
104
+ child: Padding(
105
+ padding: const EdgeInsets.symmetric(horizontal: 8.0),
106
+ child: Row(
107
+ spacing: 6,
108
+ children: [
109
+ CakeImageWidget(
110
+ imageUrl: _getSettingsButtonIconPath(),
111
+ colorFilter: ColorFilter.mode(
112
+ Theme.of(context).colorScheme.primary, BlendMode.srcIn)),
113
+ if ((settingsButtonText ?? "").isNotEmpty)
114
+ Text(
115
+ settingsButtonText ?? "",
116
+ style: TextStyle(color: Theme.of(context).colorScheme.primary),
117
+ )
118
+ ],
119
+ ),
120
),
121
),
122
),
123
),
71
- Opacity(
72
- opacity: hasTokenSettingsButton ? 1 : 0,
73
- child: ElevatedButton(
74
- onPressed: () {
75
- if (tabs[selectedTab] == S.of(context).assets) {
76
- Navigator.of(context).pushNamed(
77
- Routes.homeSettings,
78
- arguments: dashboardViewModel.balanceViewModel,
79
- );
80
- } else if (tabs[selectedTab] == S.of(context).history) {
81
- showPopUp<void>(
82
- context: context,
83
- builder: (context) =>
84
- FilterWidget(filterItems: dashboardViewModel.filterItems),
85
- );
86
- }
87
- },
88
- style: ElevatedButton.styleFrom(
89
- padding: EdgeInsets.zero,
90
- shape: RoundedRectangleBorder(
91
- borderRadius: BorderRadius.circular(999999),
92
- ),
93
- backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
94
- ),
95
- child: Padding(
96
- padding: const EdgeInsets.symmetric(horizontal: 12.0),
97
- child: Row(
98
- spacing: 6,
99
- children: [
100
- CakeImageWidget(
101
- imageUrl: "assets/new-ui/options_slider.svg",
102
- colorFilter: ColorFilter.mode(
103
- Theme.of(context).colorScheme.primary, BlendMode.srcIn)),
104
- Text(
105
- settingsButtonText ?? "",
106
- style: TextStyle(color: Theme.of(context).colorScheme.primary),
107
- )
108
- ],
109
- ),
110
- ),
111
- ),
112
- ),
113
- ],
124
+ ],
125
+ ),
126
),
127
],
128
),
@@ -118,6 +130,19 @@ class AssetsTopBar extends StatelessWidget {
130
);
131
}
132
133
+ String? _getSettingsButtonIconPath() {
134
+ if (tabs[selectedTab] == S.current.history) {
135
+ return "assets/new-ui/filter_options.svg";
136
+ }
137
+
138
+ if (tabs[selectedTab] == S.current.assets &&
139
+ dashboardViewModel.balanceViewModel.isHomeScreenSettingsEnabled) {
140
+ return "assets/new-ui/options_slider.svg";
141
+ }
142
+
143
+ return null;
144
+ }
145
+
146
String? _getSettingsButtonText() {
147
if (tabs[selectedTab] == S.current.assets &&
148
dashboardViewModel.balanceViewModel.isHomeScreenSettingsEnabled) {
@@ -125,7 +150,7 @@ class AssetsTopBar extends StatelessWidget {
150
}
151
152
if (tabs[selectedTab] == S.current.history) {
128
- return S.current.filters;
153
+ return "";
154
}
155
return null;
156
}
lib/new-ui/widgets/line_tab_switcher.dart
+1
@@ -127,6 +127,7 @@ class _LineTabSwitcherState extends State<LineTabSwitcher> {
127
}).toList()
128
)
129
),
130
+ if(widget.tabs.length > 1)
131
Container(
132
width: totalWidth,
133
height: 2,
res/pictures/filter_options.svg
new
+3
@@ -0,0 +1,3 @@
1
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10.2787 17.5V16H13.7115V17.5H10.2787ZM6.404 12.75V11.25H17.5865V12.75H6.404ZM3.5 8V6.5H20.5V8H3.5Z" fill="white"/>
3
+</svg>
res/pictures/tx_export.svg
new
+3
@@ -0,0 +1,3 @@
1
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M5.25128 22.0193L4.20703 20.95L7.40703 17.75H4.79153V16.25H9.95128V21.4095H8.45128V18.8193L5.25128 22.0193ZM12.1435 21.5V20H17.6915C17.7814 20 17.8551 19.9712 17.9128 19.9135C17.9704 19.8558 17.9993 19.7821 17.9993 19.6923V8.5H13.4993V4H6.30703C6.2172 4 6.14345 4.02883 6.08578 4.0865C6.02811 4.14417 5.99928 4.21792 5.99928 4.30775V14.0577H4.49928V4.30775C4.49928 3.80908 4.67586 3.38308 5.02903 3.02975C5.38236 2.67658 5.80836 2.5 6.30703 2.5H14.2493L19.4993 7.75V19.6923C19.4993 20.1909 19.3227 20.6169 18.9695 20.9703C18.6162 21.3234 18.1902 21.5 17.6915 21.5H12.1435Z" fill="white"/>
3
+</svg>