Skip to content

Commit de9654f

Browse files
[various] Clean up deprecated_member_use ignores (#6123)
As of #6111 `deprecated_member_use` is no longer on in the repository, so we no longer need (most; see below) of these annotations. Since we will not be annotating deprecated usage going forward, the associated comments with TODOs have also been removed, for consistency with the new process. This also opportunistically removes `deprecated_member_use_from_same_package` everywhere, since that has been disabled for a long time, so they were cruft. I have ensured that issues are filed for all of these usages, with the new `p: deprecated api` tag, per the new process for tracking deprecated APIs that is now described in the Ecosystem gardener rotation handbook. (In summary: there will be a manual weekly process of checking for new deprecations and filing them, and the [update-stable-in-this-repo process](https://github.com/flutter/flutter/wiki/Updating-Packages-repo-for-a-stable-release) will involve causing anything that is unblocked to be re-triaged.) The only annotations that are left are for cases where we have integration tests testing deprecated APIs in that package, as those are false positives; they are conceptually `deprecated_member_use_from_same_package` and aren't tech debt (or used by clients), but technically are from a different package since integration tests are in the example app. This will prevent them from showing up in the manual weekly check.
1 parent 3c5687c commit de9654f

File tree

25 files changed

+20
-82
lines changed

25 files changed

+20
-82
lines changed

packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ void main() {
1414
(WidgetTester tester) async {
1515
MediaQuery slot(double width) {
1616
return MediaQuery(
17-
// TODO(stuartmorgan): Replace with .fromView once this package requires
18-
// Flutter 3.8+.
19-
// ignore: deprecated_member_use
2017
data: MediaQueryData.fromWindow(WidgetsBinding.instance.window)
2118
.copyWith(size: Size(width, 800)),
2219
child: Directionality(
@@ -420,9 +417,6 @@ AnimatedWidget leftInOut(Widget child, Animation<double> animation) {
420417

421418
MediaQuery slot(double width) {
422419
return MediaQuery(
423-
// TODO(stuartmorgan): Replace with .fromView once this package requires
424-
// Flutter 3.8+.
425-
// ignore: deprecated_member_use
426420
data: MediaQueryData.fromWindow(WidgetsBinding.instance.window)
427421
.copyWith(size: Size(width, 800)),
428422
child: Directionality(

packages/flutter_adaptive_scaffold/test/simulated_layout.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ enum SimulatedLayout {
151151

152152
MediaQuery get slot {
153153
return MediaQuery(
154-
// TODO(stuartmorgan): Replace with .fromView once this package requires
155-
// Flutter 3.8+.
156-
// ignore: deprecated_member_use
157154
data: MediaQueryData.fromWindow(WidgetsBinding.instance.window)
158155
.copyWith(size: Size(_width, _height)),
159156
child: Theme(

packages/flutter_image/lib/network.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ class NetworkImageWithRetry extends ImageProvider<NetworkImageWithRetry> {
101101
@override
102102
ImageStreamCompleter loadBuffer(
103103
NetworkImageWithRetry key,
104-
// TODO(LongCatIsLooong): migrate to use new `loadImage` API.
105-
// https://github.com/flutter/flutter/issues/132856
106-
// ignore: deprecated_member_use
107104
DecoderBufferCallback decode,
108105
) {
109106
return OneFrameImageStreamCompleter(_loadWithRetry(key, decode),

packages/flutter_image/test/network_test.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ void assertThatImageLoadingFails(
142142
) {
143143
final ImageStreamCompleter completer = subject.loadBuffer(
144144
subject,
145-
// TODO(LongCatIsLooong): migrate to use new `instantiateImageCodecWithSize` API.
146-
// https://github.com/flutter/flutter/issues/132856
147-
// ignore: deprecated_member_use
148145
PaintingBinding.instance.instantiateImageCodecFromBuffer,
149146
);
150147
completer.addListener(ImageStreamListener(
@@ -162,9 +159,6 @@ void assertThatImageLoadingSucceeds(
162159
) {
163160
final ImageStreamCompleter completer = subject.loadBuffer(
164161
subject,
165-
// TODO(LongCatIsLooong): migrate to use new `instantiateImageCodecWithSize` API.
166-
// https://github.com/flutter/flutter/issues/132856
167-
// ignore: deprecated_member_use
168162
PaintingBinding.instance.instantiateImageCodecFromBuffer,
169163
);
170164
completer.addListener(ImageStreamListener(

packages/flutter_markdown/lib/src/_functions_io.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?)
6464
}
6565

6666
return result.copyWith(
67-
textScaleFactor:
68-
MediaQuery.textScaleFactorOf(context), // ignore: deprecated_member_use
67+
textScaleFactor: MediaQuery.textScaleFactorOf(context),
6968
);
7069
};
7170

packages/flutter_markdown/lib/src/_functions_web.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ final MarkdownStyleSheet Function(BuildContext, MarkdownStyleSheetBaseTheme?)
6666
}
6767

6868
return result.copyWith(
69-
textScaleFactor:
70-
MediaQuery.textScaleFactorOf(context), // ignore: deprecated_member_use
69+
textScaleFactor: MediaQuery.textScaleFactorOf(context),
7170
);
7271
};
7372

packages/flutter_markdown/lib/src/builder.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,6 @@ class MarkdownBuilder implements md.NodeVisitor {
867867
if (selectable) {
868868
return SelectableText.rich(
869869
text!,
870-
// ignore: deprecated_member_use
871870
textScaleFactor: styleSheet.textScaleFactor,
872871
textAlign: textAlign ?? TextAlign.start,
873872
onTap: onTapText,
@@ -876,7 +875,6 @@ class MarkdownBuilder implements md.NodeVisitor {
876875
} else {
877876
return Text.rich(
878877
text!,
879-
// ignore: deprecated_member_use
880878
textScaleFactor: styleSheet.textScaleFactor,
881879
textAlign: textAlign ?? TextAlign.start,
882880
key: k,

packages/flutter_markdown/test/text_scale_factor_test.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void defineTests() {
2525
);
2626

2727
final RichText richText = tester.widget(find.byType(RichText));
28-
expect(richText.textScaleFactor, 2.0); // ignore: deprecated_member_use
28+
expect(richText.textScaleFactor, 2.0);
2929
},
3030
);
3131

@@ -36,7 +36,6 @@ void defineTests() {
3636
await tester.pumpWidget(
3737
boilerplate(
3838
const MediaQuery(
39-
// ignore: deprecated_member_use
4039
data: MediaQueryData(textScaleFactor: 2.0),
4140
child: MarkdownBody(
4241
data: data,
@@ -46,7 +45,7 @@ void defineTests() {
4645
);
4746

4847
final RichText richText = tester.widget(find.byType(RichText));
49-
expect(richText.textScaleFactor, 2.0); // ignore: deprecated_member_use
48+
expect(richText.textScaleFactor, 2.0);
5049
},
5150
);
5251

@@ -57,7 +56,6 @@ void defineTests() {
5756
await tester.pumpWidget(
5857
boilerplate(
5958
const MediaQuery(
60-
// ignore: deprecated_member_use
6159
data: MediaQueryData(textScaleFactor: 2.0),
6260
child: MarkdownBody(
6361
data: data,
@@ -69,7 +67,6 @@ void defineTests() {
6967

7068
final SelectableText selectableText =
7169
tester.widget(find.byType(SelectableText));
72-
// ignore: deprecated_member_use
7370
expect(selectableText.textScaleFactor, 2.0);
7471
},
7572
);

packages/flutter_markdown/test/utils.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ void expectLinkTap(MarkdownLink? actual, MarkdownLink expected) {
169169
}
170170

171171
String dumpRenderView() {
172-
// TODO(goderbauer): Migrate to rootElement once v3.9.0 is the oldest supported Flutter version.
173-
// ignore: deprecated_member_use
174172
return WidgetsBinding.instance.renderViewElement!.toStringDeep().replaceAll(
175173
RegExp(r'SliverChildListDelegate#\d+', multiLine: true),
176174
'SliverChildListDelegate',

packages/flutter_migrate/lib/src/base/common.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ Future<T> asyncGuard<T>(
150150
// ignore: avoid_catches_without_on_clauses, forwards to Future
151151
handleError(e, s);
152152
}
153-
// ignore: deprecated_member_use
154153
}, onError: (Object e, StackTrace s) {
155154
handleError(e, s);
156155
});

0 commit comments

Comments
 (0)