Skip to content

Commit d79a56b

Browse files
Renzo-OlivaresRenzo Olivares
andauthored
WindowsPlugin should not crash when ffiPlugin enabled (flutter#184695)
This change updates an assert in the `WindowsPlugin` constructor that previously crashed because it did not consider `ffiPlugin` unlike `LinuxPlugin` which does. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. --------- Co-authored-by: Renzo Olivares <roliv@google.com>
1 parent 24e6fed commit d79a56b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/flutter_tools/lib/src/platform_plugins.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,12 @@ class WindowsPlugin extends PluginPlatform implements NativeOrDartPlugin, Varian
441441
this.defaultPackage,
442442
this.variants = const <PluginPlatformVariant>{},
443443
}) : ffiPlugin = ffiPlugin ?? false,
444-
assert(pluginClass != null || dartPluginClass != null || defaultPackage != null);
444+
assert(
445+
pluginClass != null ||
446+
dartPluginClass != null ||
447+
defaultPackage != null ||
448+
(ffiPlugin ?? false),
449+
);
445450

446451
factory WindowsPlugin.fromYaml(String name, YamlMap yaml) {
447452
assert(validate(yaml));

0 commit comments

Comments
 (0)