minor cleanup [skip ci]
OmarHatem committed
Feb 12, 2025 at 14:38 UTC
92fc6a4a60caa8e3703985f6daa2a1293e16b00d
2 files changed
+80
-97
lib/src/screens/dashboard/pages/balance/crypto_balance_widget.dart
-4
@@ -39,7 +39,6 @@ class CryptoBalanceWidget extends StatelessWidget {
39
child: DashBoardRoundedCardWidget(
40
title: "Invalid monero bindings",
41
subTitle: dashboardViewModel.getMoneroError.toString(),
42
- onTap: () {},
42
),
43
);
44
}
@@ -54,7 +53,6 @@ class CryptoBalanceWidget extends StatelessWidget {
53
child: DashBoardRoundedCardWidget(
54
title: "Invalid wownero bindings",
55
subTitle: dashboardViewModel.getWowneroError.toString(),
57
- onTap: () {},
56
));
57
}
58
return Container();
@@ -206,7 +204,6 @@ class CryptoBalanceWidget extends StatelessWidget {
204
subTitle: "Here are the things that you should note:\n - " +
205
dashboardViewModel.isMoneroWalletBrokenReasons.join("\n - ") +
206
"\n\nPlease restart your wallet and if it doesn't help contact our support.",
209
- onTap: () {},
207
))
208
],
209
if (dashboardViewModel.showSilentPaymentsCard) ...[
@@ -344,7 +341,6 @@ class CryptoBalanceWidget extends StatelessWidget {
341
),
342
],
343
),
347
- onTap: () => {},
344
icon: Container(
345
decoration: BoxDecoration(
346
color: Colors.white,
lib/src/widgets/dashboard_card_widget.dart
+80
-93
@@ -6,7 +6,7 @@ import 'package:flutter_svg/flutter_svg.dart';
6
7
class DashBoardRoundedCardWidget extends StatelessWidget {
8
DashBoardRoundedCardWidget({
9
- required this.onTap,
9
+ this.onTap,
10
required this.title,
11
required this.subTitle,
12
this.hint,
@@ -22,7 +22,7 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
22
this.marginH,
23
});
24
25
- final VoidCallback onTap;
25
+ final VoidCallback? onTap;
26
final VoidCallback? onClose;
27
final String title;
28
final String subTitle;
@@ -38,104 +38,91 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
38
39
@override
40
Widget build(BuildContext context) {
41
- return InkWell(
42
- //onTap: onTap,
43
- //hoverColor: Colors.transparent,
44
- //splashColor: Colors.transparent,
45
- //highlightColor: Colors.transparent,
46
- child: Stack(
47
- children: [
48
- Container(
49
- margin: EdgeInsets.symmetric(horizontal: marginH ?? 20, vertical: marginV ?? 8),
50
- //padding: EdgeInsets.all(20),
51
- width: double.infinity,
52
- decoration: BoxDecoration(
53
- borderRadius: BorderRadius.circular(customBorder ?? 20),
54
- border: Border.all(
55
- color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
56
- ),
57
- // boxShadow: [
58
- // BoxShadow(
59
- // color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor
60
- // .withAlpha(50),
61
- // spreadRadius: shadowSpread ?? 3,
62
- // blurRadius: shadowBlur ?? 7,
63
- // )
64
- // ],
65
- ),
66
- child: TextButton(
67
- onPressed: onTap,
68
- style: TextButton.styleFrom(
69
- backgroundColor: Theme.of(context)
70
- .extension<SyncIndicatorTheme>()!
71
- .syncedBackgroundColor,
72
- shape: RoundedRectangleBorder(
73
- borderRadius: BorderRadius.circular(customBorder ?? 20)),
74
- padding: EdgeInsets.all(24)
41
+ return Stack(
42
+ children: [
43
+ Container(
44
+ margin: EdgeInsets.symmetric(horizontal: marginH ?? 20, vertical: marginV ?? 8),
45
+ //padding: EdgeInsets.all(20),
46
+ width: double.infinity,
47
+ decoration: BoxDecoration(
48
+ borderRadius: BorderRadius.circular(customBorder ?? 20),
49
+ border: Border.all(
50
+ color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
51
+ ),
52
+ // boxShadow: [
53
+ // BoxShadow(
54
+ // color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor
55
+ // .withAlpha(50),
56
+ // spreadRadius: shadowSpread ?? 3,
57
+ // blurRadius: shadowBlur ?? 7,
58
+ // )
59
+ // ],
60
),
76
- child: Column(
77
- children: [
78
- Row(
79
- crossAxisAlignment: CrossAxisAlignment.start,
80
- children: [
81
- Expanded(
82
- child: Column(
83
- crossAxisAlignment: CrossAxisAlignment.start,
84
- children: [
85
- Text(
86
- title,
87
- style: TextStyle(
61
+ child: TextButton(
62
+ onPressed: onTap,
63
+ style: TextButton.styleFrom(
64
+ backgroundColor:
65
+ Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
66
+ shape: RoundedRectangleBorder(
67
+ borderRadius: BorderRadius.circular(customBorder ?? 20)),
68
+ padding: EdgeInsets.all(24)),
69
+ child: Column(
70
+ children: [
71
+ Row(
72
+ crossAxisAlignment: CrossAxisAlignment.start,
73
+ children: [
74
+ Expanded(
75
+ child: Column(
76
+ crossAxisAlignment: CrossAxisAlignment.start,
77
+ children: [
78
+ Text(
79
+ title,
80
+ style: TextStyle(
81
+ color: Theme.of(context)
82
+ .extension<DashboardPageTheme>()!
83
+ .cardTextColor,
84
+ fontSize: 24,
85
+ fontWeight: FontWeight.w900,
86
+ ),
87
+ softWrap: true,
88
+ ),
89
+ SizedBox(height: 5),
90
+ Text(
91
+ subTitle,
92
+ style: TextStyle(
93
color: Theme.of(context)
94
.extension<DashboardPageTheme>()!
95
.cardTextColor,
91
- fontSize: 24,
92
- fontWeight: FontWeight.w900,
93
- ),
94
- softWrap: true,
95
- ),
96
- SizedBox(height: 5),
97
- Text(
98
- subTitle,
99
- style: TextStyle(
100
- color: Theme.of(context)
101
- .extension<DashboardPageTheme>()!
102
- .cardTextColor,
103
- fontWeight: FontWeight.w500,
104
- fontFamily: 'Lato'),
105
- softWrap: true,
106
- ),
107
- ],
108
- ),
96
+ fontWeight: FontWeight.w500,
97
+ fontFamily: 'Lato'),
98
+ softWrap: true,
99
+ ),
100
+ ],
101
),
110
- if (image != null)
111
- image!
112
- else if (svgPicture != null)
113
- svgPicture!,
114
- if (icon != null) icon!
115
- ],
116
- ),
117
- if (hint != null) ...[
118
- SizedBox(height: 10),
119
- hint!,
120
- ]
121
- ],
122
- ),
102
+ ),
103
+ if (image != null) image! else if (svgPicture != null) svgPicture!,
104
+ if (icon != null) icon!
105
+ ],
106
+ ),
107
+ if (hint != null) ...[
108
+ SizedBox(height: 10),
109
+ hint!,
110
+ ]
111
+ ],
112
),
113
+ ),
114
+ ),
115
+ if (onClose != null)
116
+ Positioned(
117
+ top: 10,
118
+ right: 10,
119
+ child: IconButton(
120
+ icon: Icon(Icons.close),
121
+ onPressed: onClose,
122
+ color: Theme.of(context).extension<DashboardPageTheme>()!.cardTextColor,
123
),
125
- if (onClose != null)
126
- Positioned(
127
- top: 10,
128
- right: 10,
129
- child: IconButton(
130
- icon: Icon(Icons.close),
131
- onPressed: onClose,
132
- color: Theme.of(context)
133
- .extension<DashboardPageTheme>()!
134
- .cardTextColor,
135
- ),
136
- ),
137
- ],
138
- ),
124
+ ),
125
+ ],
126
);
127
}
128
}