attachment_engine_windows 0.0.1-dev.0
attachment_engine_windows: ^0.0.1-dev.0 copied to clipboard
The Windows implementation of attachment_engine. Paths and open-externally via path_provider/url_launcher (both flutter.dev-published, official Flutter team plugins); download via dart:io. Share (nati [...]
attachment_engine_windows #
The Windows implementation of attachment_engine.
Status #
Development preview — not feature-complete, and the native (C++) code
described below has NOT been build-verified. This machine has no
Windows compiler (cl.exe/msbuild) available, and
flutter create --platforms=windows refuses to scaffold a native template
here, so the C++ files under windows/ could not be compiled or even
syntax-checked in this environment. They were written to closely mirror
official Microsoft documentation and the same channel-name/method/event
contract already proven out by the working Android (Kotlin) and iOS
(Swift) implementations — but they are "written, not yet build-verified"
and need a real Windows build (local machine or CI) to confirm.
Pure Dart (verified — flutter analyze/dart format/flutter test all pass) #
- Paths (
getApplicationSupportDirectory,getApplicationCacheDirectory) — viapath_provider(flutter.dev-published, official) - Open externally (
openExternally, andopenOfficePreviewfalling back to it) — viaurl_launcher(flutter.dev-published, official) - Download (
startDownload,resumeDownload,cancelDownload,downloadEvents) — viadart:io's built-inHttpClient, withRange-header resume support
Native (unverified by build — see windows/*.cpp/*.h header comments) #
- Share (
shareFile,shareText) —windows/share_channel.cpp, using the documentedIDataTransferManagerInterop/DataTransferManagerCOM API to show the real Windows share flyout from this app's top-level HWND: https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-idatatransfermanagerinterop - Audio playback (
audioLoad/audioPlay/audioPause/audioSeek/audioSetSpeed/audioSetVolume/audioDispose/audioEvents) —windows/audio_channel.cpp, using Media Foundation'sIMFMediaEngine: https://learn.microsoft.com/en-us/windows/win32/api/mfmediaengine/nn-mfmediaengine-imfmediaengine - Video playback + embedding (same method shape as audio, plus
videoBuildView) —windows/video_channel.cpp, sameIMFMediaEngineAPI, rendering to a child HWND (MF_MEDIA_ENGINE_PLAYBACK_HWND) that the Dart-side widget keeps positioned via an explicitsetLayoutcall. This is a documented, functional tradeoff versus true Flutter compositing — see the "Embedding tradeoff" comment inwindows/video_channel.hfor why, and what a fuller frame-server +TextureRegistrarimplementation would look like instead.
Still not yet implemented (throws UnimplementedError):
- PDF native rendering and embedded native webview surfaces — no native-view integration has been wired up for either yet.
You should not need to depend on this package directly — add
attachment_engine to your app instead, and the
right platform implementation is selected automatically.