From 3acd45d403ae4977b0e427facab8d18e54e06a53 Mon Sep 17 00:00:00 2001 From: tuxpizza Date: Fri, 20 Dec 2024 05:00:49 -0500 Subject: [PATCH] Make more components TextButtons --- lib/src/screens/support/support_page.dart | 6 +- lib/src/widgets/dashboard_card_widget.dart | 110 +++++++++++---------- lib/src/widgets/option_tile.dart | 27 ++--- 3 files changed, 78 insertions(+), 65 deletions(-) diff --git a/lib/src/screens/support/support_page.dart b/lib/src/screens/support/support_page.dart index 88154e91d..2dd098813 100644 --- a/lib/src/screens/support/support_page.dart +++ b/lib/src/screens/support/support_page.dart @@ -42,7 +42,7 @@ class SupportPage extends BasePage { child: Column( children: [ Padding( - padding: EdgeInsets.only(top: 24), + padding: EdgeInsets.only(top: 20), child: OptionTile( icon: Icon( Icons.support_agent, @@ -61,7 +61,7 @@ class SupportPage extends BasePage { ), ), Padding( - padding: EdgeInsets.only(top: 24), + padding: EdgeInsets.only(top: 20), child: OptionTile( icon: Icon( Icons.find_in_page, @@ -74,7 +74,7 @@ class SupportPage extends BasePage { ), ), Padding( - padding: EdgeInsets.only(top: 24), + padding: EdgeInsets.only(top: 20), child: OptionTile( icon: Icon( Icons.contact_support, diff --git a/lib/src/widgets/dashboard_card_widget.dart b/lib/src/widgets/dashboard_card_widget.dart index dc223eb02..5914f81c3 100644 --- a/lib/src/widgets/dashboard_card_widget.dart +++ b/lib/src/widgets/dashboard_card_widget.dart @@ -31,67 +31,73 @@ 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( - padding: EdgeInsets.all(20), - width: double.infinity, - decoration: BoxDecoration( - color: Theme.of(context).extension()!.syncedBackgroundColor, - borderRadius: BorderRadius.circular(customBorder ?? 20), - border: Border.all( - color: Theme.of(context).extension()!.cardBorderColor, + TextButton( + onPressed: onTap, + style: TextButton.styleFrom( + backgroundColor: Theme.of(context) + .extension()! + .syncedBackgroundColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(customBorder ?? 20)), + side: BorderSide( + color: Theme.of(context) + .extension()! + .cardBorderColor), + 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()!.cardTextColor, - fontSize: 24, - fontWeight: FontWeight.w900, - ), - softWrap: true, - ), - SizedBox(height: 5), - Text( - subTitle, - style: TextStyle( + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle( color: Theme.of(context) .extension()! .cardTextColor, - fontWeight: FontWeight.w500, - fontFamily: 'Lato'), - softWrap: true, - ), - ], + fontSize: 24, + fontWeight: FontWeight.w900, + ), + softWrap: true, + ), + SizedBox(height: 5), + Text( + subTitle, + style: TextStyle( + color: Theme.of(context) + .extension()! + .cardTextColor, + 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, @@ -99,7 +105,9 @@ class DashBoardRoundedCardWidget extends StatelessWidget { child: IconButton( icon: Icon(Icons.close), onPressed: onClose, - color: Theme.of(context).extension()!.cardTextColor, + color: Theme.of(context) + .extension()! + .cardTextColor, ), ), ], diff --git a/lib/src/widgets/option_tile.dart b/lib/src/widgets/option_tile.dart index c2d8b9506..c26987658 100644 --- a/lib/src/widgets/option_tile.dart +++ b/lib/src/widgets/option_tile.dart @@ -19,16 +19,17 @@ class OptionTile extends StatelessWidget { @override Widget build(BuildContext context) { - return GestureDetector( - onTap: onPressed, - child: Container( - width: double.infinity, - padding: EdgeInsets.all(24), - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(12)), - color: Theme.of(context).cardColor, + return Container( + width: double.infinity, + padding: EdgeInsets.only(left: 6, right: 6), + alignment: Alignment.center, + child: TextButton( + style: TextButton.styleFrom( + backgroundColor: Theme.of(context).cardColor, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + padding: EdgeInsets.all(24) ), + onPressed: onPressed, child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, @@ -48,7 +49,9 @@ class OptionTile extends StatelessWidget { style: TextStyle( fontSize: 20, fontWeight: FontWeight.w500, - color: Theme.of(context).extension()!.titleColor, + color: Theme.of(context) + .extension()! + .titleColor, ), ), Padding( @@ -58,7 +61,9 @@ class OptionTile extends StatelessWidget { style: TextStyle( fontSize: 14, fontWeight: FontWeight.normal, - color: Theme.of(context).extension()!.descriptionColor, + color: Theme.of(context) + .extension()! + .descriptionColor, ), ), )