Skip to content

Commit e44d445

Browse files
committed
Fix the theme text issues
1 parent 98d93d3 commit e44d445

File tree

7 files changed

+23
-11
lines changed

7 files changed

+23
-11
lines changed

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class _HomePageState extends State<HomePage> {
156156
primaryColorLight: Colors.white,
157157
primaryColorDark: navyBlue,
158158
textTheme: Theme.of(context).textTheme.copyWith(
159-
bodyText2: TextStyle(
159+
bodyMedium: TextStyle(
160160
color: lightBlue,
161161
),
162162
),

lib/src/widgets/birthday_widget.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class _BirthdayWidgetState extends BaseState<BirthdayWidget> {
4545
textAlign: TextAlign.center,
4646
style: TextStyle(
4747
fontWeight: FontWeight.w500,
48-
color: context.textTheme().headline6?.color,
48+
// color: context.textTheme().headline6?.color,
49+
color: Theme.of(context).textTheme.headlineSmall?.color,
4950
fontSize: 15.0,
5051
),
5152
),

lib/src/widgets/checkout/checkout_widget.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ class _CheckoutWidgetState extends BaseState<CheckoutWidget>
188188
Text(
189189
'Pay',
190190
style: TextStyle(
191-
fontSize: 14.0, color: context.textTheme().headline1?.color),
191+
fontSize: 14.0,
192+
// color: context.textTheme().headline1?.color,
193+
194+
color: Theme.of(context).textTheme.headlineLarge?.color,
195+
),
192196
),
193197
SizedBox(
194198
width: 5.0,
@@ -197,7 +201,9 @@ class _CheckoutWidgetState extends BaseState<CheckoutWidget>
197201
child: Text(Utils.formatAmount(_charge.amount),
198202
style: TextStyle(
199203
fontSize: 15.0,
200-
color: context.textTheme().headline6?.color,
204+
// color: context.textTheme().headline6?.color,
205+
color:
206+
Theme.of(context).textTheme.headlineSmall?.color,
201207
fontWeight: FontWeight.bold)))
202208
],
203209
)
@@ -421,7 +427,7 @@ class _CheckoutWidgetState extends BaseState<CheckoutWidget>
421427
if (_response!.card != null) {
422428
_response!.card!.nullifyNumber();
423429
}
424-
Navigator.of(context).pop(_response);
430+
Navigator.of(context).pop(_response);
425431
},
426432
);
427433

lib/src/widgets/custom_dialog.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class CustomAlertDialog extends StatelessWidget {
3333
children.add(new Padding(
3434
padding: titlePadding!,
3535
child: new DefaultTextStyle(
36-
style: context.textTheme().headline6!,
36+
// style: context.textTheme().headline6!,
37+
style: context.textTheme().headlineSmall!,
3738
child: new Semantics(child: title, namesRoute: true),
3839
),
3940
));
@@ -43,7 +44,7 @@ class CustomAlertDialog extends StatelessWidget {
4344
child: new Padding(
4445
padding: contentPadding,
4546
child: new DefaultTextStyle(
46-
style: context.textTheme().subtitle1!,
47+
style: context.textTheme().titleSmall!,
4748
child: content,
4849
),
4950
),

lib/src/widgets/otp_widget.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class _OtpWidgetState extends BaseState<OtpWidget> {
4242
textAlign: TextAlign.center,
4343
style: TextStyle(
4444
fontWeight: FontWeight.w500,
45-
color: context.textTheme().headline6?.color,
45+
// color: context.textTheme().headline6?.color,
46+
color: Theme.of(context).textTheme.headlineSmall?.color,
4647
fontSize: 15.0,
4748
),
4849
),

lib/src/widgets/pin_widget.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class _PinWidgetState extends BaseState<PinWidget> {
3838
textAlign: TextAlign.center,
3939
style: TextStyle(
4040
fontWeight: FontWeight.w500,
41-
color: context.textTheme().headline6?.color,
41+
color: Theme.of(context).textTheme.headlineSmall?.color,
42+
// color: context.textTheme().headline6?.color,
4243
fontSize: 15.0,
4344
),
4445
),

lib/src/widgets/sucessful_widget.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ class _SuccessfulWidgetState extends State<SuccessfulWidget>
8686
Text(
8787
'Payment Successful',
8888
style: TextStyle(
89-
color: context.textTheme().headline6?.color,
89+
// color: context.textTheme().headline6?.color,
90+
color: Theme.of(context).textTheme.headlineSmall?.color,
9091
fontWeight: FontWeight.w500,
9192
fontSize: 16.0,
9293
),
@@ -98,7 +99,8 @@ class _SuccessfulWidgetState extends State<SuccessfulWidget>
9899
? new Container()
99100
: new Text('You paid ${Utils.formatAmount(widget.amount)}',
100101
style: TextStyle(
101-
color: context.textTheme().headline6?.color,
102+
// color: context.textTheme().headline6?.color,
103+
color: Theme.of(context).textTheme.headlineSmall?.color,
102104
fontWeight: FontWeight.normal,
103105
fontSize: 14.0,
104106
)),

0 commit comments

Comments
 (0)