minor cleanup [skip ci]

This commit is contained in:
OmarHatem 2025-02-12 14:38:51 +03:00
parent 7db23599fa
commit 92fc6a4a60
2 changed files with 80 additions and 97 deletions

View file

@ -39,7 +39,6 @@ class CryptoBalanceWidget extends StatelessWidget {
child: DashBoardRoundedCardWidget(
title: "Invalid monero bindings",
subTitle: dashboardViewModel.getMoneroError.toString(),
onTap: () {},
),
);
}
@ -54,7 +53,6 @@ class CryptoBalanceWidget extends StatelessWidget {
child: DashBoardRoundedCardWidget(
title: "Invalid wownero bindings",
subTitle: dashboardViewModel.getWowneroError.toString(),
onTap: () {},
));
}
return Container();
@ -206,7 +204,6 @@ class CryptoBalanceWidget extends StatelessWidget {
subTitle: "Here are the things that you should note:\n - " +
dashboardViewModel.isMoneroWalletBrokenReasons.join("\n - ") +
"\n\nPlease restart your wallet and if it doesn't help contact our support.",
onTap: () {},
))
],
if (dashboardViewModel.showSilentPaymentsCard) ...[
@ -344,7 +341,6 @@ class CryptoBalanceWidget extends StatelessWidget {
),
],
),
onTap: () => {},
icon: Container(
decoration: BoxDecoration(
color: Colors.white,

View file

@ -6,7 +6,7 @@ import 'package:flutter_svg/flutter_svg.dart';
class DashBoardRoundedCardWidget extends StatelessWidget {
DashBoardRoundedCardWidget({
required this.onTap,
this.onTap,
required this.title,
required this.subTitle,
this.hint,
@ -22,7 +22,7 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
this.marginH,
});
final VoidCallback onTap;
final VoidCallback? onTap;
final VoidCallback? onClose;
final String title;
final String subTitle;
@ -38,104 +38,91 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return InkWell(
//onTap: onTap,
//hoverColor: Colors.transparent,
//splashColor: Colors.transparent,
//highlightColor: Colors.transparent,
child: Stack(
children: [
Container(
margin: EdgeInsets.symmetric(horizontal: marginH ?? 20, vertical: marginV ?? 8),
//padding: EdgeInsets.all(20),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(customBorder ?? 20),
border: Border.all(
color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
),
// boxShadow: [
// BoxShadow(
// color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor
// .withAlpha(50),
// spreadRadius: shadowSpread ?? 3,
// blurRadius: shadowBlur ?? 7,
// )
// ],
),
child: TextButton(
onPressed: onTap,
style: TextButton.styleFrom(
backgroundColor: Theme.of(context)
.extension<SyncIndicatorTheme>()!
.syncedBackgroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(customBorder ?? 20)),
padding: EdgeInsets.all(24)
return Stack(
children: [
Container(
margin: EdgeInsets.symmetric(horizontal: marginH ?? 20, vertical: marginV ?? 8),
//padding: EdgeInsets.all(20),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(customBorder ?? 20),
border: Border.all(
color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
),
// boxShadow: [
// BoxShadow(
// color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor
// .withAlpha(50),
// spreadRadius: shadowSpread ?? 3,
// blurRadius: shadowBlur ?? 7,
// )
// ],
),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
child: TextButton(
onPressed: onTap,
style: TextButton.styleFrom(
backgroundColor:
Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(customBorder ?? 20)),
padding: EdgeInsets.all(24)),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
color: Theme.of(context)
.extension<DashboardPageTheme>()!
.cardTextColor,
fontSize: 24,
fontWeight: FontWeight.w900,
),
softWrap: true,
),
SizedBox(height: 5),
Text(
subTitle,
style: TextStyle(
color: Theme.of(context)
.extension<DashboardPageTheme>()!
.cardTextColor,
fontSize: 24,
fontWeight: FontWeight.w900,
),
softWrap: true,
),
SizedBox(height: 5),
Text(
subTitle,
style: TextStyle(
color: Theme.of(context)
.extension<DashboardPageTheme>()!
.cardTextColor,
fontWeight: FontWeight.w500,
fontFamily: 'Lato'),
softWrap: true,
),
],
),
fontWeight: FontWeight.w500,
fontFamily: 'Lato'),
softWrap: true,
),
],
),
if (image != null)
image!
else if (svgPicture != null)
svgPicture!,
if (icon != null) icon!
],
),
if (hint != null) ...[
SizedBox(height: 10),
hint!,
]
],
),
),
if (image != null) image! else if (svgPicture != null) svgPicture!,
if (icon != null) icon!
],
),
if (hint != null) ...[
SizedBox(height: 10),
hint!,
]
],
),
),
),
if (onClose != null)
Positioned(
top: 10,
right: 10,
child: IconButton(
icon: Icon(Icons.close),
onPressed: onClose,
color: Theme.of(context).extension<DashboardPageTheme>()!.cardTextColor,
),
if (onClose != null)
Positioned(
top: 10,
right: 10,
child: IconButton(
icon: Icon(Icons.close),
onPressed: onClose,
color: Theme.of(context)
.extension<DashboardPageTheme>()!
.cardTextColor,
),
),
],
),
),
],
);
}
}