From e44d44522a29c32685b53482849bb83cf08b8f5c Mon Sep 17 00:00:00 2001 From: Godwin David Date: Tue, 21 May 2024 10:44:41 +0100 Subject: [PATCH 1/2] Fix the theme text issues --- example/lib/main.dart | 2 +- lib/src/widgets/birthday_widget.dart | 3 ++- lib/src/widgets/checkout/checkout_widget.dart | 12 +++++++++--- lib/src/widgets/custom_dialog.dart | 5 +++-- lib/src/widgets/otp_widget.dart | 3 ++- lib/src/widgets/pin_widget.dart | 3 ++- lib/src/widgets/sucessful_widget.dart | 6 ++++-- 7 files changed, 23 insertions(+), 11 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 87a7123e..55075ef5 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -156,7 +156,7 @@ class _HomePageState extends State { primaryColorLight: Colors.white, primaryColorDark: navyBlue, textTheme: Theme.of(context).textTheme.copyWith( - bodyText2: TextStyle( + bodyMedium: TextStyle( color: lightBlue, ), ), diff --git a/lib/src/widgets/birthday_widget.dart b/lib/src/widgets/birthday_widget.dart index 20449a42..968516f2 100644 --- a/lib/src/widgets/birthday_widget.dart +++ b/lib/src/widgets/birthday_widget.dart @@ -45,7 +45,8 @@ class _BirthdayWidgetState extends BaseState { textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.w500, - color: context.textTheme().headline6?.color, + // color: context.textTheme().headline6?.color, + color: Theme.of(context).textTheme.headlineSmall?.color, fontSize: 15.0, ), ), diff --git a/lib/src/widgets/checkout/checkout_widget.dart b/lib/src/widgets/checkout/checkout_widget.dart index 6e467620..40562953 100644 --- a/lib/src/widgets/checkout/checkout_widget.dart +++ b/lib/src/widgets/checkout/checkout_widget.dart @@ -188,7 +188,11 @@ class _CheckoutWidgetState extends BaseState Text( 'Pay', style: TextStyle( - fontSize: 14.0, color: context.textTheme().headline1?.color), + fontSize: 14.0, + // color: context.textTheme().headline1?.color, + + color: Theme.of(context).textTheme.headlineLarge?.color, + ), ), SizedBox( width: 5.0, @@ -197,7 +201,9 @@ class _CheckoutWidgetState extends BaseState child: Text(Utils.formatAmount(_charge.amount), style: TextStyle( fontSize: 15.0, - color: context.textTheme().headline6?.color, + // color: context.textTheme().headline6?.color, + color: + Theme.of(context).textTheme.headlineSmall?.color, fontWeight: FontWeight.bold))) ], ) @@ -421,7 +427,7 @@ class _CheckoutWidgetState extends BaseState if (_response!.card != null) { _response!.card!.nullifyNumber(); } - Navigator.of(context).pop(_response); + Navigator.of(context).pop(_response); }, ); diff --git a/lib/src/widgets/custom_dialog.dart b/lib/src/widgets/custom_dialog.dart index 4faa5333..b6809128 100644 --- a/lib/src/widgets/custom_dialog.dart +++ b/lib/src/widgets/custom_dialog.dart @@ -33,7 +33,8 @@ class CustomAlertDialog extends StatelessWidget { children.add(new Padding( padding: titlePadding!, child: new DefaultTextStyle( - style: context.textTheme().headline6!, + // style: context.textTheme().headline6!, + style: context.textTheme().headlineSmall!, child: new Semantics(child: title, namesRoute: true), ), )); @@ -43,7 +44,7 @@ class CustomAlertDialog extends StatelessWidget { child: new Padding( padding: contentPadding, child: new DefaultTextStyle( - style: context.textTheme().subtitle1!, + style: context.textTheme().titleSmall!, child: content, ), ), diff --git a/lib/src/widgets/otp_widget.dart b/lib/src/widgets/otp_widget.dart index f0f74a70..7e749793 100644 --- a/lib/src/widgets/otp_widget.dart +++ b/lib/src/widgets/otp_widget.dart @@ -42,7 +42,8 @@ class _OtpWidgetState extends BaseState { textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.w500, - color: context.textTheme().headline6?.color, + // color: context.textTheme().headline6?.color, + color: Theme.of(context).textTheme.headlineSmall?.color, fontSize: 15.0, ), ), diff --git a/lib/src/widgets/pin_widget.dart b/lib/src/widgets/pin_widget.dart index 124dabd8..4e2f6418 100644 --- a/lib/src/widgets/pin_widget.dart +++ b/lib/src/widgets/pin_widget.dart @@ -38,7 +38,8 @@ class _PinWidgetState extends BaseState { textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.w500, - color: context.textTheme().headline6?.color, + color: Theme.of(context).textTheme.headlineSmall?.color, + // color: context.textTheme().headline6?.color, fontSize: 15.0, ), ), diff --git a/lib/src/widgets/sucessful_widget.dart b/lib/src/widgets/sucessful_widget.dart index dc669431..3d4d9cdf 100644 --- a/lib/src/widgets/sucessful_widget.dart +++ b/lib/src/widgets/sucessful_widget.dart @@ -86,7 +86,8 @@ class _SuccessfulWidgetState extends State Text( 'Payment Successful', style: TextStyle( - color: context.textTheme().headline6?.color, + // color: context.textTheme().headline6?.color, + color: Theme.of(context).textTheme.headlineSmall?.color, fontWeight: FontWeight.w500, fontSize: 16.0, ), @@ -98,7 +99,8 @@ class _SuccessfulWidgetState extends State ? new Container() : new Text('You paid ${Utils.formatAmount(widget.amount)}', style: TextStyle( - color: context.textTheme().headline6?.color, + // color: context.textTheme().headline6?.color, + color: Theme.of(context).textTheme.headlineSmall?.color, fontWeight: FontWeight.normal, fontSize: 14.0, )), From eaa6a87c1c984010c99cd464ef119a0266078cb9 Mon Sep 17 00:00:00 2001 From: godwin Date: Tue, 22 Oct 2024 09:09:28 +0100 Subject: [PATCH 2/2] fix the intl version to 0.19.0 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index f76392a8..142bdf4d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ dependencies: flutter: sdk: flutter http: ^0.13.5 - intl: ^0.17.0 + intl: ^0.19.0 meta: ^1.8.0 async: ^2.9.0