Windows 및 Linux용 WebView 지원을 제공하는 플러터 플러그인으로 webview_flutter 인터페이스를 구현합니다. 이는 이러한 플랫폼의 데스크톱 애플리케이션 내에 웹 콘텐츠를 포함할 수 있게 하며 개발자에게 일관된 API를 제공합니다. 기존 플러터의 웹뷰 기능과 원활하게 작동하도록 설계되어 웹 통합 기능을 갖춘 크로스플랫폼 데스크톱 앱을 쉽게 만들 수 있습니다. Windows와 Linux를 지원하지만 macOS는 포함되지 않습니다.
사용 사례
데스크톱 앱에 웹 콘텐츠 삽입
하이브리드 데스크톱 애플리케이션 빌드
동적 웹 기반 UI 표시
Flutter 앱에 웹 서비스 통합하기
웹 컴포넌트를 사용하여 데스크톱 대시보드 만들기
주요 기능
Windows 및 Linux용 WebView 구현
webview_flutter API와 일치
크로스 플랫폼 데스크톱 호환성
HTML 및 JavaScript 실행을 지원합니다
경량이며 통합이 쉬움
적합한 대상
Windows 및 Linux를 대상으로 하는 데스크톱 앱 개발자
웹 콘텐츠를 사용하는 하이브리드 앱 제작자
다양한 플랫폼 간에 일관된 WebView 동작이 필요한 팀
웹 컴포넌트를 사용하여 데이터 시각화 도구를 개발하는 개발자
네이티브 플랫폼의 복잡성 없이 내장 웹 뷰가 필요한 프로젝트
고려 사항
macOS 지원 없음
Windows 및 Linux 플랫폼에 제한됨
일부 리눅스 배포판에서는 추가 구성이 필요할 수 있습니다
기반 시스템 WebView 구성 요소에 의존합니다
모바일 또는 웹 배포에 적합하지 않습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
webview_win_floating
A desktop Flutter WebView plugin for Windows and Linux.
It exposes the same API as webview_flutter, so you can reuse familiar WebView code while targeting desktop platforms.
BREAKING CHANGES
For developers upgrading from version 2.x to 3.x, please refer to API BREAKING CHANGES
You can write your app against the webview_flutter API and use this package as the desktop implementation.
Highlights
Native WebView rendering on Windows and Linux.
High-performance video playback and scrolling.
Compatible with the webview_flutter API on supported platforms.
Limitations
This package places a native WebView directly on top of the Flutter window instead of rendering it as a texture.
That design has a tradeoff:
You get native WebView performance and smooth video playback.
Flutter widgets CANNOT render above the WebView on Windows and Linux.
You cannot push a new route above the WebView.
Tab-key focus switching between Flutter and WebView has some limitations.
Flutter cannot clip the WebView, so it may remain visible even when scrolled outside its parent area.
If the WebView is placed inside a scrollable widget, you may need a ScrollController so it can be repositioned while scrolling.
Hmm... there are so many limitations.
Workaround
If your application targets only Windows or Linux, refer to the [Standalone mode] section below and use controller.setVisibility(bool) to toggle the WebView visibility.
When to Use It
Use this package if:
You need smooth video playback.
You care about scroll performance.
You do not need Flutter overlays above the WebView.
For Linux platform
Linux has a few build-time considerations. See README_Linux.md for details.
You can configure custom storage paths for browser data, including cache, cookies, and session information.
If your app is installed in a read-only location such as C:\Program Files\, set a custom user data folder.
Profiles:
You can specify a Profile Name, similar to the "User Profile" mechanism in Google Chrome.
Data for each profile is stored in: <UserDataFolder>/EBWebView/WV2Profile_<ProfileName>/
Isolation: Cookies, cache, and other browser data are stored separately.
String cacheDir = "c:\\test";
String profileName = "UserA";
var params = WindowsWebViewControllerCreationParams(userDataFolder: cacheDir, profileName: profileName);
var controller = WebViewController.fromPlatformCreationParams(params);
Build with InnoSetup
Or if application installed in "C:/Program Files/" or other read-only dir
If your application build with InnoSetup, or can be installed in "C:/Program Files/" or other read-only system directory, the webview cannot create data folder in read-only directory, so it won't work.
In this case, you should specify user data folder as mentioned above.
Standalone Mode
If your app only targets Windows and you want fewer dependencies, you can remove the webview_flutter dependency:
dependencies:webview_win_floating:^3.0.0# webview_flutter: ^4.13.0 # mark this line for Windows only app
With the information above, you can manually trigger WebView visibility by hooking into navigator.push / pop events or widget visibility changes.
TroubleShooting
Build Fails with MSB3073
If your build fails with an error containing MSB3073, run the build command from an Administrator terminal.
javascript 'history.back()' issue
If you use history.back() in JavaScript, remove your NavigationDelegate.onNavigationRequest() implementation. That callback can interfere with back navigation.