Skip to content

Commit f4790cf

Browse files
authored
[various] Remove all traces of the _ambiguate workaround (flutter#6449)
It's no longer needed - for now. Fixes flutter/flutter#111841.
1 parent d1a3d99 commit f4790cf

File tree

11 files changed

+24
-42
lines changed

11 files changed

+24
-42
lines changed

packages/camera/camera_avfoundation/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.9.14+2
2+
3+
* Removes `_ambiguate` methods from example code.
4+
15
## 0.9.14+1
26

37
* Fixes bug where max resolution preset does not produce highest available resolution on iOS.

packages/camera/camera_avfoundation/example/lib/main.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
7575
@override
7676
void initState() {
7777
super.initState();
78-
_ambiguate(WidgetsBinding.instance)?.addObserver(this);
78+
WidgetsBinding.instance.addObserver(this);
7979

8080
_flashModeControlRowAnimationController = AnimationController(
8181
duration: const Duration(milliseconds: 300),
@@ -105,7 +105,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
105105

106106
@override
107107
void dispose() {
108-
_ambiguate(WidgetsBinding.instance)?.removeObserver(this);
108+
WidgetsBinding.instance.removeObserver(this);
109109
_flashModeControlRowAnimationController.dispose();
110110
_exposureModeControlRowAnimationController.dispose();
111111
super.dispose();
@@ -580,7 +580,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
580580
}
581581

582582
if (_cameras.isEmpty) {
583-
_ambiguate(SchedulerBinding.instance)?.addPostFrameCallback((_) async {
583+
SchedulerBinding.instance.addPostFrameCallback((_) async {
584584
showInSnackBar('No camera found.');
585585
});
586586
return const Text('None');
@@ -1064,9 +1064,3 @@ Future<void> main() async {
10641064
}
10651065
runApp(const CameraApp());
10661066
}
1067-
1068-
/// This allows a value of type T or T? to be treated as a value of type T?.
1069-
///
1070-
/// We use this so that APIs that have become non-nullable can still be used
1071-
/// with `!` and `?` on the stable branch.
1072-
T? _ambiguate<T>(T? value) => value;

packages/camera/camera_avfoundation/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: iOS implementation of the camera plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_avfoundation
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
55

6-
version: 0.9.14+1
6+
version: 0.9.14+2
77

88
environment:
99
sdk: ^3.2.3

packages/flutter_markdown/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.22+1
2+
3+
* Removes `_ambiguate` methods from code.
4+
15
## 0.6.22
26

37
* Introduces a new `MarkdownElementBuilder.isBlockElement()` method to specify if custom element

packages/flutter_markdown/lib/src/builder.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class MarkdownBuilder implements md.NodeVisitor {
518518
_mergeInlineChildren(current.children, align),
519519
textAlign: align,
520520
);
521-
_ambiguate(_tables.single.rows.last.children)!.add(child);
521+
_tables.single.rows.last.children.add(child);
522522
} else if (tag == 'a') {
523523
_linkHandlers.removeLast();
524524
} else if (tag == 'sup') {
@@ -967,10 +967,4 @@ class MarkdownBuilder implements md.NodeVisitor {
967967
);
968968
}
969969
}
970-
971-
/// This allows a value of type T or T? to be treated as a value of type T?.
972-
///
973-
/// We use this so that APIs that have become non-nullable can still be used
974-
/// with `!` and `?` on the stable branch.
975-
T? _ambiguate<T>(T? value) => value;
976970
}

packages/flutter_markdown/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: A Markdown renderer for Flutter. Create rich text output,
44
formatted with simple Markdown tags.
55
repository: https://github.com/flutter/packages/tree/main/packages/flutter_markdown
66
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_markdown%22
7-
version: 0.6.22
7+
version: 0.6.22+1
88

99
environment:
1010
sdk: ^3.3.0

packages/flutter_markdown/test/utils.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void expectTableSize(int rows, int columns) {
204204

205205
expect(table.children.length, rows);
206206
for (int index = 0; index < rows; index++) {
207-
expect(_ambiguate(table.children[index].children)!.length, columns);
207+
expect(table.children[index].children.length, columns);
208208
}
209209
}
210210

@@ -263,9 +263,3 @@ class TestAssetBundle extends CachingAssetBundle {
263263
}
264264
}
265265
}
266-
267-
/// This allows a value of type T or T? to be treated as a value of type T?.
268-
///
269-
/// We use this so that APIs that have become non-nullable can still be used
270-
/// with `!` and `?` on the stable branch.
271-
T? _ambiguate<T>(T? value) => value;

packages/video_player/video_player/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.8.4
2+
3+
* Removes `_ambiguate` methods from code.
4+
15
## 2.8.3
26

37
* Fixes typo in `README.md`.

packages/video_player/video_player/lib/video_player.dart

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ class _VideoAppLifeCycleObserver extends Object with WidgetsBindingObserver {
769769
final VideoPlayerController _controller;
770770

771771
void initialize() {
772-
_ambiguate(WidgetsBinding.instance)!.addObserver(this);
772+
WidgetsBinding.instance.addObserver(this);
773773
}
774774

775775
@override
@@ -785,7 +785,7 @@ class _VideoAppLifeCycleObserver extends Object with WidgetsBindingObserver {
785785
}
786786

787787
void dispose() {
788-
_ambiguate(WidgetsBinding.instance)!.removeObserver(this);
788+
WidgetsBinding.instance.removeObserver(this);
789789
}
790790
}
791791

@@ -1170,9 +1170,3 @@ class ClosedCaption extends StatelessWidget {
11701170
);
11711171
}
11721172
}
1173-
1174-
/// This allows a value of type T or T? to be treated as a value of type T?.
1175-
///
1176-
/// We use this so that APIs that have become non-nullable can still be used
1177-
/// with `!` and `?` on the stable branch.
1178-
T? _ambiguate<T>(T? value) => value;

packages/video_player/video_player/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter
33
widgets on Android, iOS, and web.
44
repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
6-
version: 2.8.3
6+
version: 2.8.4
77

88
environment:
99
sdk: ">=3.1.0 <4.0.0"

0 commit comments

Comments
 (0)