diff --git a/.ci/flutter_master.version b/.ci/flutter_master.version index dd5e807eb4..04b248e5bf 100644 --- a/.ci/flutter_master.version +++ b/.ci/flutter_master.version @@ -1 +1 @@ -27f8ebdaed7078f311d456befae1c6236ba65fd8 +9b3b9cf0893d54a40c2b6f8bc6c666ee77a8afa6 diff --git a/packages/flutter_markdown/CHANGELOG.md b/packages/flutter_markdown/CHANGELOG.md index 477eb94d1b..a43c71b9ba 100644 --- a/packages/flutter_markdown/CHANGELOG.md +++ b/packages/flutter_markdown/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.6.13+1 +* Adjusts code to account for nullability change in Flutter SDK. * Updates the example to specify the import for `DropdownMenu`. ## 0.6.13 diff --git a/packages/flutter_markdown/lib/src/builder.dart b/packages/flutter_markdown/lib/src/builder.dart index 293f12c854..4e3c0c1833 100644 --- a/packages/flutter_markdown/lib/src/builder.dart +++ b/packages/flutter_markdown/lib/src/builder.dart @@ -510,7 +510,7 @@ class MarkdownBuilder implements md.NodeVisitor { _mergeInlineChildren(current.children, align), textAlign: align, ); - _tables.single.rows.last.children!.add(child); + _ambiguate(_tables.single.rows.last.children)!.add(child); } else if (tag == 'a') { _linkHandlers.removeLast(); } @@ -859,4 +859,10 @@ class MarkdownBuilder implements md.NodeVisitor { ); } } + + /// This allows a value of type T or T? to be treated as a value of type T?. + /// + /// We use this so that APIs that have become non-nullable can still be used + /// with `!` and `?` on the stable branch. + T? _ambiguate(T? value) => value; } diff --git a/packages/flutter_markdown/pubspec.yaml b/packages/flutter_markdown/pubspec.yaml index 8f1259f0b2..1e4cbb149f 100644 --- a/packages/flutter_markdown/pubspec.yaml +++ b/packages/flutter_markdown/pubspec.yaml @@ -4,7 +4,7 @@ description: A Markdown renderer for Flutter. Create rich text output, formatted with simple Markdown tags. repository: https://github.com/flutter/packages/tree/main/packages/flutter_markdown issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_markdown%22 -version: 0.6.13 +version: 0.6.13+1 environment: sdk: ">=2.12.0 <3.0.0" diff --git a/packages/flutter_markdown/test/utils.dart b/packages/flutter_markdown/test/utils.dart index f28ef29ba9..7052210759 100644 --- a/packages/flutter_markdown/test/utils.dart +++ b/packages/flutter_markdown/test/utils.dart @@ -157,7 +157,7 @@ void expectTableSize(int rows, int columns) { expect(table.children.length, rows); for (int index = 0; index < rows; index++) { - expect(table.children[index].children!.length, columns); + expect(_ambiguate(table.children[index].children)!.length, columns); } } @@ -212,3 +212,9 @@ class TestAssetBundle extends CachingAssetBundle { } } } + +/// This allows a value of type T or T? to be treated as a value of type T?. +/// +/// We use this so that APIs that have become non-nullable can still be used +/// with `!` and `?` on the stable branch. +T? _ambiguate(T? value) => value;