Repository navigation
refactor: drop package:flutter imports from filters and vst3 - #616
Merged
alnitak merged 1 commit intoNov 22, 2026
Merged
Conversation
The filters only used kIsWeb from package:flutter/foundation.dart, and the
VST3 hosts only Uint8List. Use a private
`bool.fromEnvironment('dart.library.js_interop')` constant, as
realtime_stream.dart already does, plus package:meta and dart:typed_data.
No behavior change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hectorAguero
marked this pull request as draft
November 20, 2026 05:06
hectorAguero
marked this pull request as ready for review
November 20, 2026 05:20
Owner
|
Hi @hectorAguero, I have merged this. The v5.3.2 will soon be available on pub.dev. I am near to merge #617 which introduces a lot of more tests which found issues that have been fixed. Please refer to that PR's branch in your work for DartNative! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @alnitak, I was updating the fork to try it again, and AI went a bit ahead creating this PR, so I checked and try make it the description clear as possible.
Let me know, if you are fine with it, and if you prefer to have the next PR ready, so both can be reviewed together instead(not in same PR).
Summary
Refs #598
filters/andvst3/stop importingpackage:flutter. No behavior change.lib/src/filters/{filters,custom_filter,parametric_eq}.dart -import 'package:flutter/foundation.dart'; // used only for kIsWeb (+ meta annotations) +import 'package:meta/meta.dart'; // parametric_eq.dart; the others already had it +const bool _kIsWeb = bool.fromEnvironment('dart.library.js_interop'); - if (kIsWeb && soundHash != null) { + if (_kIsWeb && soundHash != null) { lib/src/vst3/{vst3_host_ffi,vst3_host_web}.dart -import 'package:flutter/foundation.dart'; // used only for Uint8List +import 'dart:typed_data';_kIsWebis the constantrealtime_stream.dartalready defines, and the same expression Flutter uses forkIsWeb.Plan, from #598:
filters/andvst3/withoutpackage:flutter.PlatformDispatcher.instance.engineIdread and theDarwinEngineLifecyclecalls inbindings_player_ffi.dartbehind a small internal lifecycle class, so a fork replaces that class instead of editing the bindings.nativeLibraryInUsesignal goes behind the same class.loader_io.dart/loader_web.dart) andsoloud.dart, which keepscompute,defaultTargetPlatformandloadAsset'sAssetBundle?. The DartNative fork keeps patching those imports itself.Evidence
git grep "package:flutter/" -- lib/src/filters lib/src/vst3→ 5 imports.After: no matches.
flutter analyze lib(Flutter 3.50): no issues.dart format --set-exit-if-changed: clean.flutter test test/filter_param_names_test.dart test/filter_type_test.dart test/parametric_eq_test.dart test/vst3_test.dart: 19 passed.flutter build webandflutter build web --wasmonexample/: both build.Merge Danger
Door: two-way. One commit, no public API change; a revert restores the old imports.
Blast Radius: minimal.
The 15 web guards compile to the same constant as before. If Flutter ever redefined
kIsWeb, these files would not follow, asrealtime_stream.dartalready doesn't.Nothing stops a future
package:flutter/foundation.dartimport (andkIsWeb) from coming back to these files. The fork's sync check catches that on our side. If it keeps happening, I can propose a small test that fails on Flutter imports underfilters/andvst3/.Type of Change