From 7f6c096e96a5386bb7029b2c3170ecdf7bac2118 Mon Sep 17 00:00:00 2001 From: Taha Tesser Date: Fri, 14 Jan 2022 20:45:19 +0200 Subject: [PATCH] Provide Appbar's `foregroundColor` to package license page titles (#95685) --- packages/flutter/lib/src/material/about.dart | 6 ++++-- packages/flutter/test/material/about_test.dart | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart index 391b3f50c4..847a469313 100644 --- a/packages/flutter/lib/src/material/about.dart +++ b/packages/flutter/lib/src/material/about.dart @@ -920,12 +920,14 @@ class _PackageLicensePageTitle extends StatelessWidget { @override Widget build(BuildContext context) { + final Color? color = Theme.of(context).appBarTheme.foregroundColor; + return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(title, style: theme.headline6), - Text(subtitle, style: theme.subtitle2), + Text(title, style: theme.headline6?.copyWith(color: color)), + Text(subtitle, style: theme.subtitle2?.copyWith(color: color)), ], ); } diff --git a/packages/flutter/test/material/about_test.dart b/packages/flutter/test/material/about_test.dart index 0795865379..31167cbbde 100644 --- a/packages/flutter/test/material/about_test.dart +++ b/packages/flutter/test/material/about_test.dart @@ -289,11 +289,11 @@ void main() { const TextStyle titleTextStyle = TextStyle( fontSize: 20, - color: Colors.black, + color: Colors.indigo, ); const TextStyle subtitleTextStyle = TextStyle( fontSize: 15, - color: Colors.red, + color: Colors.indigo, ); await tester.pumpWidget( @@ -315,6 +315,7 @@ void main() { headline6: titleTextStyle, subtitle2: subtitleTextStyle, ), + foregroundColor: Colors.indigo, ), ), home: const Center(