Ignore `textScaleFactor` deprecation (#4209)
Ignore `textScaleFactor` deprecation, as suggested in https://github.com/flutter/flutter/issues/128825
diff --git a/packages/flutter_markdown/lib/src/_functions_io.dart b/packages/flutter_markdown/lib/src/_functions_io.dart
index 7c35ba4..b3fa99e 100644
--- a/packages/flutter_markdown/lib/src/_functions_io.dart
+++ b/packages/flutter_markdown/lib/src/_functions_io.dart
@@ -66,7 +66,8 @@
}
return result.copyWith(
- textScaleFactor: MediaQuery.textScaleFactorOf(context),
+ textScaleFactor:
+ MediaQuery.textScaleFactorOf(context), // ignore: deprecated_member_use
);
};
diff --git a/packages/flutter_markdown/lib/src/_functions_web.dart b/packages/flutter_markdown/lib/src/_functions_web.dart
index a58a9ce..8283886 100644
--- a/packages/flutter_markdown/lib/src/_functions_web.dart
+++ b/packages/flutter_markdown/lib/src/_functions_web.dart
@@ -68,7 +68,8 @@
}
return result.copyWith(
- textScaleFactor: MediaQuery.textScaleFactorOf(context),
+ textScaleFactor:
+ MediaQuery.textScaleFactorOf(context), // ignore: deprecated_member_use
);
};
diff --git a/packages/flutter_markdown/lib/src/builder.dart b/packages/flutter_markdown/lib/src/builder.dart
index 475c510..b688427 100644
--- a/packages/flutter_markdown/lib/src/builder.dart
+++ b/packages/flutter_markdown/lib/src/builder.dart
@@ -829,7 +829,8 @@
if (selectable) {
return SelectableText.rich(
text!,
- textScaleFactor: styleSheet.textScaleFactor,
+ textScaleFactor:
+ styleSheet.textScaleFactor, // ignore: deprecated_member_use
textAlign: textAlign ?? TextAlign.start,
onTap: onTapText,
key: k,
@@ -837,7 +838,8 @@
} else {
return RichText(
text: text!,
- textScaleFactor: styleSheet.textScaleFactor!,
+ textScaleFactor:
+ styleSheet.textScaleFactor!, // ignore: deprecated_member_use
textAlign: textAlign ?? TextAlign.start,
key: k,
);
diff --git a/packages/flutter_markdown/test/text_scale_factor_test.dart b/packages/flutter_markdown/test/text_scale_factor_test.dart
index 3710b3e..41b5ec7 100644
--- a/packages/flutter_markdown/test/text_scale_factor_test.dart
+++ b/packages/flutter_markdown/test/text_scale_factor_test.dart
@@ -25,7 +25,7 @@
);
final RichText richText = tester.widget(find.byType(RichText));
- expect(richText.textScaleFactor, 2.0);
+ expect(richText.textScaleFactor, 2.0); // ignore: deprecated_member_use
},
);
@@ -36,7 +36,8 @@
await tester.pumpWidget(
boilerplate(
const MediaQuery(
- data: MediaQueryData(textScaleFactor: 2.0),
+ data: MediaQueryData(
+ textScaleFactor: 2.0), // ignore: deprecated_member_use
child: MarkdownBody(
data: data,
),
@@ -45,7 +46,7 @@
);
final RichText richText = tester.widget(find.byType(RichText));
- expect(richText.textScaleFactor, 2.0);
+ expect(richText.textScaleFactor, 2.0); // ignore: deprecated_member_use
},
);
@@ -56,7 +57,8 @@
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,
@@ -67,7 +69,8 @@
final SelectableText selectableText =
tester.widget(find.byType(SelectableText));
- expect(selectableText.textScaleFactor, 2.0);
+ expect(selectableText.textScaleFactor,
+ 2.0); // ignore: deprecated_member_use
},
);
});
diff --git a/packages/rfw/lib/src/flutter/core_widgets.dart b/packages/rfw/lib/src/flutter/core_widgets.dart
index 0ff1b12..99a9f7a 100644
--- a/packages/rfw/lib/src/flutter/core_widgets.dart
+++ b/packages/rfw/lib/src/flutter/core_widgets.dart
@@ -644,7 +644,7 @@
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
maxLines: source.v<int>(['maxLines']),
semanticsLabel: source.v<String>(['semanticsLabel']),
textWidthBasis: ArgumentDecoders.enumValue<TextWidthBasis>(TextWidthBasis.values, source, ['textWidthBasis']),