Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/flutter_markdown/lib/src/_functions_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?)
}

return result.copyWith(
textScaleFactor: MediaQuery.textScaleFactorOf(context),
textScaleFactor: MediaQuery.textScaleFactorOf(context), // ignore: deprecated_member_use
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_markdown/lib/src/_functions_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?)
}

return result.copyWith(
textScaleFactor: MediaQuery.textScaleFactorOf(context),
textScaleFactor: MediaQuery.textScaleFactorOf(context), // ignore: deprecated_member_use
);
};

Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_markdown/lib/src/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -829,15 +829,15 @@ class MarkdownBuilder implements md.NodeVisitor {
if (selectable) {
return SelectableText.rich(
text!,
textScaleFactor: styleSheet.textScaleFactor,
textScaleFactor: styleSheet.textScaleFactor, // ignore: deprecated_member_use
textAlign: textAlign ?? TextAlign.start,
onTap: onTapText,
key: k,
);
} else {
return RichText(
text: text!,
textScaleFactor: styleSheet.textScaleFactor!,
textScaleFactor: styleSheet.textScaleFactor!, // ignore: deprecated_member_use
textAlign: textAlign ?? TextAlign.start,
key: k,
);
Expand Down
10 changes: 5 additions & 5 deletions packages/flutter_markdown/test/text_scale_factor_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void defineTests() {
);

final RichText richText = tester.widget(find.byType(RichText));
expect(richText.textScaleFactor, 2.0);
expect(richText.textScaleFactor, 2.0); // ignore: deprecated_member_use
},
);

Expand All @@ -36,7 +36,7 @@ void defineTests() {
await tester.pumpWidget(
boilerplate(
const MediaQuery(
data: MediaQueryData(textScaleFactor: 2.0),
data: MediaQueryData(textScaleFactor: 2.0), // ignore: deprecated_member_use
child: MarkdownBody(
data: data,
),
Expand All @@ -45,7 +45,7 @@ void defineTests() {
);

final RichText richText = tester.widget(find.byType(RichText));
expect(richText.textScaleFactor, 2.0);
expect(richText.textScaleFactor, 2.0); // ignore: deprecated_member_use
},
);

Expand All @@ -56,7 +56,7 @@ void defineTests() {
await tester.pumpWidget(
boilerplate(
const MediaQuery(
data: MediaQueryData(textScaleFactor: 2.0),
data: MediaQueryData(textScaleFactor: 2.0), // ignore: deprecated_member_use
child: MarkdownBody(
data: data,
selectable: true,
Expand All @@ -67,7 +67,7 @@ void defineTests() {

final SelectableText selectableText =
tester.widget(find.byType(SelectableText));
expect(selectableText.textScaleFactor, 2.0);
expect(selectableText.textScaleFactor, 2.0); // ignore: deprecated_member_use
},
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/rfw/lib/src/flutter/core_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ Map<String, LocalWidgetBuilder> get _coreWidgetsDefinitions => <String, LocalWid
locale: ArgumentDecoders.locale(source, ['locale']),
softWrap: source.v<bool>(['softWrap']),
overflow: ArgumentDecoders.enumValue<TextOverflow>(TextOverflow.values, source, ['overflow']),
textScaleFactor: source.v<double>(['textScaleFactor']),
textScaleFactor: source.v<double>(['textScaleFactor']), // ignore: deprecated_member_use
Copy link
Contributor Author

@LongCatIsLooong LongCatIsLooong Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how this is going to be migrated, since textScaler is essentially a function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would something like textScaler: TextScaler.linear(source.v<double>(['textScaleFactor'])) work?

maxLines: source.v<int>(['maxLines']),
semanticsLabel: source.v<String>(['semanticsLabel']),
textWidthBasis: ArgumentDecoders.enumValue<TextWidthBasis>(TextWidthBasis.values, source, ['textWidthBasis']),
Expand Down