style update

This commit is contained in:
Thibault Deckers 2022-10-05 17:03:26 +02:00
parent 6df9456372
commit edcfd10848
26 changed files with 49 additions and 31 deletions

View file

@ -128,7 +128,7 @@ class LicenseRow extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme; final textTheme = Theme.of(context).textTheme;
final bodyTextStyle = textTheme.bodyText2!; final bodyTextStyle = textTheme.bodyMedium!;
final subColor = bodyTextStyle.color!.withOpacity(.6); final subColor = bodyTextStyle.color!.withOpacity(.6);
return Padding( return Padding(

View file

@ -29,8 +29,8 @@ class EntryListDetailsTheme extends StatelessWidget {
final textScaleFactor = mq.textScaleFactor; final textScaleFactor = mq.textScaleFactor;
final textTheme = Theme.of(context).textTheme; final textTheme = Theme.of(context).textTheme;
final titleStyle = textTheme.bodyText2!; final titleStyle = textTheme.bodyMedium!;
final captionStyle = textTheme.caption!; final captionStyle = textTheme.bodySmall!;
final titleLineHeight = (RenderParagraph( final titleLineHeight = (RenderParagraph(
TextSpan(text: 'Fake Title', style: titleStyle), TextSpan(text: 'Fake Title', style: titleStyle),

View file

@ -8,6 +8,7 @@ import 'package:aves/services/accessibility_service.dart';
import 'package:aves/theme/durations.dart'; import 'package:aves/theme/durations.dart';
import 'package:aves/theme/icons.dart'; import 'package:aves/theme/icons.dart';
import 'package:aves/widgets/common/action_mixins/overlay_snack_bar.dart'; import 'package:aves/widgets/common/action_mixins/overlay_snack_bar.dart';
import 'package:aves/widgets/common/basic/animated_text.dart';
import 'package:aves/widgets/common/basic/circle.dart'; import 'package:aves/widgets/common/basic/circle.dart';
import 'package:aves/widgets/common/extensions/build_context.dart'; import 'package:aves/widgets/common/extensions/build_context.dart';
import 'package:aves/widgets/viewer/entry_viewer_page.dart'; import 'package:aves/widgets/viewer/entry_viewer_page.dart';
@ -343,7 +344,8 @@ class _FeedbackMessageState extends State<_FeedbackMessage> with SingleTickerPro
Widget build(BuildContext context) { Widget build(BuildContext context) {
final text = Text(widget.message); final text = Text(widget.message);
final theme = Theme.of(context); final theme = Theme.of(context);
final contentTextStyle = theme.snackBarTheme.contentTextStyle ?? ThemeData(brightness: theme.brightness).textTheme.subtitle1; final contentTextStyle = theme.snackBarTheme.contentTextStyle ?? ThemeData(brightness: theme.brightness).textTheme.titleMedium!;
final timerChangeShadowColor = theme.colorScheme.primary;
return _remainingDurationMillis == null return _remainingDurationMillis == null
? text ? text
: Row( : Row(
@ -362,9 +364,25 @@ class _FeedbackMessageState extends State<_FeedbackMessage> with SingleTickerPro
// progress color is provided by the caller, // progress color is provided by the caller,
// because we cannot use the app context theme here // because we cannot use the app context theme here
foreground: widget.progressColor, foreground: widget.progressColor,
center: Text( center: AnimatedText(
'${(remainingDurationMillis / 1000).ceil()}', '${(remainingDurationMillis / 1000).ceil()}',
style: contentTextStyle, style: contentTextStyle.copyWith(
shadows: [
Shadow(
color: timerChangeShadowColor.withOpacity(0),
blurRadius: 0,
)
],
),
changedStyle: contentTextStyle.copyWith(
shadows: [
Shadow(
color: timerChangeShadowColor,
blurRadius: 5,
)
],
),
duration: context.read<DurationsData>().formTextStyleTransition,
), ),
); );
}, },

View file

@ -66,7 +66,7 @@ class SourceStateSubtitle extends StatelessWidget {
final theme = Theme.of(context); final theme = Theme.of(context);
return DefaultTextStyle.merge( return DefaultTextStyle.merge(
style: theme.textTheme.caption!.copyWith(fontFeatures: const [FontFeature.disable('smcp')]), style: theme.textTheme.bodySmall!.copyWith(fontFeatures: const [FontFeature.disable('smcp')]),
child: ValueListenableBuilder<ProgressEvent>( child: ValueListenableBuilder<ProgressEvent>(
valueListenable: source.progressNotifier, valueListenable: source.progressNotifier,
builder: (context, progress, snapshot) { builder: (context, progress, snapshot) {

View file

@ -82,7 +82,7 @@ class _PopupMenuItemExpansionPanelState<T> extends State<PopupMenuItemExpansionP
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context); final theme = Theme.of(context);
var style = PopupMenuTheme.of(context).textStyle ?? theme.textTheme.subtitle1!; var style = PopupMenuTheme.of(context).textStyle ?? theme.textTheme.titleMedium!;
if (!widget.enabled) { if (!widget.enabled) {
style = style.copyWith(color: theme.disabledColor); style = style.copyWith(color: theme.disabledColor);
} }

View file

@ -52,7 +52,7 @@ class _QueryBarState extends State<QueryBar> {
); );
return DefaultTextStyle( return DefaultTextStyle(
style: Theme.of(context).textTheme.bodyText2!, style: Theme.of(context).textTheme.bodyMedium!,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

View file

@ -29,7 +29,7 @@ class SliderListTile extends StatelessWidget {
), ),
), ),
child: DefaultTextStyle( child: DefaultTextStyle(
style: Theme.of(context).textTheme.subtitle1!, style: Theme.of(context).textTheme.titleMedium!,
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 16, bottom: 8), padding: const EdgeInsets.only(top: 16, bottom: 8),
child: Column( child: Column(

View file

@ -14,7 +14,7 @@ class AvesCaption extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context); final theme = Theme.of(context);
final subtitleStyle = theme.textTheme.caption!; final subtitleStyle = theme.textTheme.bodySmall!;
final subtitleChangeShadowColor = theme.colorScheme.onPrimary; final subtitleChangeShadowColor = theme.colorScheme.onPrimary;
return AnimatedText( return AnimatedText(
// provide key to refresh on theme brightness change // provide key to refresh on theme brightness change

View file

@ -35,7 +35,7 @@ class Attribution extends StatelessWidget {
selectable: true, selectable: true,
styleSheet: MarkdownStyleSheet( styleSheet: MarkdownStyleSheet(
a: TextStyle(color: theme.colorScheme.secondary), a: TextStyle(color: theme.colorScheme.secondary),
p: theme.textTheme.caption!.merge(const TextStyle(fontSize: InfoRowGroup.fontSize)), p: theme.textTheme.bodySmall!.merge(const TextStyle(fontSize: InfoRowGroup.fontSize)),
), ),
onTapLink: (text, href, title) async { onTapLink: (text, href, title) async {
if (href != null) { if (href != null) {

View file

@ -148,7 +148,7 @@ class _RenameEntrySetPageState extends State<RenameEntrySetPage> {
children: [ children: [
Text( Text(
sourceName, sourceName,
style: TextStyle(color: Theme.of(context).textTheme.caption!.color), style: TextStyle(color: Theme.of(context).textTheme.bodySmall!.color),
softWrap: false, softWrap: false,
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
maxLines: 1, maxLines: 1,

View file

@ -449,7 +449,7 @@ class _CoverSelectionDialogState extends State<CoverSelectionDialog> {
}.fold('', (previousValue, element) => '$previousValue\n$element'); }.fold('', (previousValue, element) => '$previousValue\n$element');
final para = RenderParagraph( final para = RenderParagraph(
TextSpan(text: _optionLines, style: Theme.of(context).textTheme.subtitle1!), TextSpan(text: _optionLines, style: Theme.of(context).textTheme.titleMedium!),
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
textScaleFactor: MediaQuery.textScaleFactorOf(context), textScaleFactor: MediaQuery.textScaleFactorOf(context),
)..layout(const BoxConstraints(), parentUsesSize: true); )..layout(const BoxConstraints(), parentUsesSize: true);

View file

@ -265,7 +265,7 @@ class _AddressRowState extends State<_AddressRow> {
// addresses can include non-latin scripts with inconsistent line height, // addresses can include non-latin scripts with inconsistent line height,
// which is especially an issue for relayout/painting of heavy Google map, // which is especially an issue for relayout/painting of heavy Google map,
// so we give extra height to give breathing room to the text and stabilize layout // so we give extra height to give breathing room to the text and stabilize layout
height: Theme.of(context).textTheme.bodyText2!.fontSize! * context.select<MediaQueryData, double>((mq) => mq.textScaleFactor) * 2, height: Theme.of(context).textTheme.bodyMedium!.fontSize! * context.select<MediaQueryData, double>((mq) => mq.textScaleFactor) * 2,
child: ValueListenableBuilder<String?>( child: ValueListenableBuilder<String?>(
valueListenable: _addressLineNotifier, valueListenable: _addressLineNotifier,
builder: (context, addressLine, child) { builder: (context, addressLine, child) {

View file

@ -167,7 +167,7 @@ class CoveredFilterChip<T extends CollectionFilter> extends StatelessWidget {
); );
} }
Color _detailColor(BuildContext context) => Theme.of(context).textTheme.caption!.color!; Color _detailColor(BuildContext context) => Theme.of(context).textTheme.bodySmall!.color!;
Widget _buildDetails(BuildContext context, CollectionSource source, T filter) { Widget _buildDetails(BuildContext context, CollectionSource source, T filter) {
final locale = context.l10n.localeName; final locale = context.l10n.localeName;

View file

@ -33,9 +33,9 @@ class FilterListDetailsTheme extends StatelessWidget {
final textScaleFactor = mq.textScaleFactor; final textScaleFactor = mq.textScaleFactor;
final textTheme = Theme.of(context).textTheme; final textTheme = Theme.of(context).textTheme;
final titleStyleBase = textTheme.bodyText2!; final titleStyleBase = textTheme.bodyMedium!;
final titleStyle = titleStyleBase.copyWith(fontSize: titleStyleBase.fontSize! * textScaleFactor); final titleStyle = titleStyleBase.copyWith(fontSize: titleStyleBase.fontSize! * textScaleFactor);
final captionStyle = textTheme.caption!; final captionStyle = textTheme.bodySmall!;
final titleIconSize = AvesFilterChip.iconSize * textScaleFactor; final titleIconSize = AvesFilterChip.iconSize * textScaleFactor;
final titleLineHeight = (RenderParagraph( final titleLineHeight = (RenderParagraph(

View file

@ -110,7 +110,7 @@ class _AddressRowState extends State<_AddressRow> {
// addresses can include non-latin scripts with inconsistent line height, // addresses can include non-latin scripts with inconsistent line height,
// which is especially an issue for relayout/painting of heavy Google map, // which is especially an issue for relayout/painting of heavy Google map,
// so we give extra height to give breathing room to the text and stabilize layout // so we give extra height to give breathing room to the text and stabilize layout
height: Theme.of(context).textTheme.bodyText2!.fontSize! * context.select<MediaQueryData, double>((mq) => mq.textScaleFactor) * 2, height: Theme.of(context).textTheme.bodyMedium!.fontSize! * context.select<MediaQueryData, double>((mq) => mq.textScaleFactor) * 2,
child: ValueListenableBuilder<String?>( child: ValueListenableBuilder<String?>(
valueListenable: _addressLineNotifier, valueListenable: _addressLineNotifier,
builder: (context, addressLine, child) { builder: (context, addressLine, child) {

View file

@ -39,12 +39,12 @@ class SettingsCollectionTile extends StatelessWidget {
children: [ children: [
Text( Text(
l10n.settingsCollectionTile, l10n.settingsCollectionTile,
style: textTheme.subtitle1!, style: textTheme.titleMedium!,
), ),
if (hasSubtitle) if (hasSubtitle)
Text( Text(
l10n.drawerCollectionAll, l10n.drawerCollectionAll,
style: textTheme.bodyText2!.copyWith(color: textTheme.caption!.color), style: textTheme.bodyMedium!.copyWith(color: textTheme.bodySmall!.color),
), ),
], ],
), ),

View file

@ -49,7 +49,7 @@ class ActionButton extends StatelessWidget {
); );
} }
static TextStyle _textStyle(BuildContext context) => Theme.of(context).textTheme.caption!; static TextStyle _textStyle(BuildContext context) => Theme.of(context).textTheme.bodySmall!;
static double _width(BuildContext context) => OverlayButton.getSize(context) + padding * 2; static double _width(BuildContext context) => OverlayButton.getSize(context) + padding * 2;

View file

@ -227,7 +227,7 @@ class _QuickActionEditorBodyState<T extends Object> extends State<QuickActionEdi
? Center( ? Center(
child: Text( child: Text(
context.l10n.settingsViewerQuickActionEmpty, context.l10n.settingsViewerQuickActionEmpty,
style: theme.textTheme.caption, style: theme.textTheme.bodySmall,
), ),
) )
: const SizedBox(), : const SizedBox(),

View file

@ -44,7 +44,7 @@ class _CrumbLineState extends State<CrumbLine> {
directory.getVolumeDescription(context), directory.getVolumeDescription(context),
...pContext.split(directory.relativeDir), ...pContext.split(directory.relativeDir),
]; ];
final crumbStyle = Theme.of(context).textTheme.bodyText2; final crumbStyle = Theme.of(context).textTheme.bodyMedium;
final crumbColor = crumbStyle!.color!.withOpacity(.4); final crumbColor = crumbStyle!.color!.withOpacity(.4);
return DefaultTextStyle( return DefaultTextStyle(
style: crumbStyle.copyWith( style: crumbStyle.copyWith(

View file

@ -105,7 +105,7 @@ class _SettingsPageState extends State<SettingsPage> with FeedbackMixin {
data: theme.copyWith( data: theme.copyWith(
textTheme: theme.textTheme.copyWith( textTheme: theme.textTheme.copyWith(
// dense style font for tile subtitles, without modifying title font // dense style font for tile subtitles, without modifying title font
bodyText2: const TextStyle(fontSize: 12), bodyMedium: const TextStyle(fontSize: 12),
), ),
), ),
child: AnimationLimiter( child: AnimationLimiter(

View file

@ -28,7 +28,7 @@ class _VideoSettingsPageState extends State<VideoSettingsPage> {
data: theme.copyWith( data: theme.copyWith(
textTheme: theme.textTheme.copyWith( textTheme: theme.textTheme.copyWith(
// dense style font for tile subtitles, without modifying title font // dense style font for tile subtitles, without modifying title font
bodyText2: const TextStyle(fontSize: 12), bodyMedium: const TextStyle(fontSize: 12),
), ),
), ),
child: SafeArea( child: SafeArea(

View file

@ -330,7 +330,7 @@ class _HistogramState extends State<Histogram> with AutomaticKeepAliveClientMixi
Text( Text(
numberFormat.format(count), numberFormat.format(count),
style: TextStyle( style: TextStyle(
color: Theme.of(context).textTheme.caption!.color, color: Theme.of(context).textTheme.bodySmall!.color,
), ),
textAlign: TextAlign.end, textAlign: TextAlign.end,
), ),

View file

@ -104,7 +104,7 @@ class FilterTable<T extends Comparable> extends StatelessWidget {
Text( Text(
numberFormat.format(count), numberFormat.format(count),
style: TextStyle( style: TextStyle(
color: theme.textTheme.caption!.color, color: theme.textTheme.bodySmall!.color,
), ),
textAlign: TextAlign.end, textAlign: TextAlign.end,
), ),

View file

@ -136,7 +136,7 @@ class _MimeDonutState extends State<MimeDonut> with AutomaticKeepAliveClientMixi
Text( Text(
numberFormat.format(d.entryCount), numberFormat.format(d.entryCount),
style: TextStyle( style: TextStyle(
color: Theme.of(context).textTheme.caption!.color, color: Theme.of(context).textTheme.bodySmall!.color,
), ),
), ),
], ],

View file

@ -50,7 +50,7 @@ class InfoRowGroup extends StatefulWidget {
static const valueStyle = TextStyle(fontSize: fontSize); static const valueStyle = TextStyle(fontSize: fontSize);
static final _keyStyle = valueStyle.copyWith(height: 2.0); static final _keyStyle = valueStyle.copyWith(height: 2.0);
static TextStyle keyStyle(BuildContext context) => Theme.of(context).textTheme.caption!.merge(_keyStyle); static TextStyle keyStyle(BuildContext context) => Theme.of(context).textTheme.bodySmall!.merge(_keyStyle);
const InfoRowGroup({ const InfoRowGroup({
super.key, super.key,

View file

@ -145,7 +145,7 @@ class ViewerDetailOverlayContent extends StatelessWidget {
builder: (context, child) { builder: (context, child) {
final positionTitle = _PositionTitleRow(entry: pageEntry, collectionPosition: position, multiPageController: multiPageController); final positionTitle = _PositionTitleRow(entry: pageEntry, collectionPosition: position, multiPageController: multiPageController);
return DefaultTextStyle( return DefaultTextStyle(
style: Theme.of(context).textTheme.bodyText2!.copyWith( style: Theme.of(context).textTheme.bodyMedium!.copyWith(
shadows: _shadows(context), shadows: _shadows(context),
), ),
softWrap: false, softWrap: false,