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
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;
final bodyTextStyle = textTheme.bodyText2!;
final bodyTextStyle = textTheme.bodyMedium!;
final subColor = bodyTextStyle.color!.withOpacity(.6);
return Padding(

View file

@ -29,8 +29,8 @@ class EntryListDetailsTheme extends StatelessWidget {
final textScaleFactor = mq.textScaleFactor;
final textTheme = Theme.of(context).textTheme;
final titleStyle = textTheme.bodyText2!;
final captionStyle = textTheme.caption!;
final titleStyle = textTheme.bodyMedium!;
final captionStyle = textTheme.bodySmall!;
final titleLineHeight = (RenderParagraph(
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/icons.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/extensions/build_context.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) {
final text = Text(widget.message);
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
? text
: Row(
@ -362,9 +364,25 @@ class _FeedbackMessageState extends State<_FeedbackMessage> with SingleTickerPro
// progress color is provided by the caller,
// because we cannot use the app context theme here
foreground: widget.progressColor,
center: Text(
center: AnimatedText(
'${(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);
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>(
valueListenable: source.progressNotifier,
builder: (context, progress, snapshot) {

View file

@ -82,7 +82,7 @@ class _PopupMenuItemExpansionPanelState<T> extends State<PopupMenuItemExpansionP
@override
Widget build(BuildContext 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) {
style = style.copyWith(color: theme.disabledColor);
}

View file

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

View file

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

View file

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

View file

@ -35,7 +35,7 @@ class Attribution extends StatelessWidget {
selectable: true,
styleSheet: MarkdownStyleSheet(
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 {
if (href != null) {

View file

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

View file

@ -449,7 +449,7 @@ class _CoverSelectionDialogState extends State<CoverSelectionDialog> {
}.fold('', (previousValue, element) => '$previousValue\n$element');
final para = RenderParagraph(
TextSpan(text: _optionLines, style: Theme.of(context).textTheme.subtitle1!),
TextSpan(text: _optionLines, style: Theme.of(context).textTheme.titleMedium!),
textDirection: TextDirection.ltr,
textScaleFactor: MediaQuery.textScaleFactorOf(context),
)..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,
// 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
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?>(
valueListenable: _addressLineNotifier,
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) {
final locale = context.l10n.localeName;

View file

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

View file

@ -110,7 +110,7 @@ class _AddressRowState extends State<_AddressRow> {
// addresses can include non-latin scripts with inconsistent line height,
// 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
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?>(
valueListenable: _addressLineNotifier,
builder: (context, addressLine, child) {

View file

@ -39,12 +39,12 @@ class SettingsCollectionTile extends StatelessWidget {
children: [
Text(
l10n.settingsCollectionTile,
style: textTheme.subtitle1!,
style: textTheme.titleMedium!,
),
if (hasSubtitle)
Text(
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;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -136,7 +136,7 @@ class _MimeDonutState extends State<MimeDonut> with AutomaticKeepAliveClientMixi
Text(
numberFormat.format(d.entryCount),
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 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({
super.key,

View file

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