Skip to content

webview_sdk Free

Self-contained WebView feature SDK backed by flutter_inappwebview. Provides URL loading, navigation controls, progress tracking, one-way JS calls, and URI scheme interception.

Version: 1.1.0

Independent of webview_sdk_advanced

webview_sdk and webview_sdk_advanced are two completely independent bricks — pick whichever one your project needs. webview_sdk_advanced does not require webview_sdk to be installed first, and does not extend or build on it. Installing both is not a supported layering model.

Variables

This brick has no configuration variables. Generation is non-interactive.

Generated Package

PackageDescription
webviewContract + flutter_inappwebview implementation, self-contained in one package: navigation controls, progress tracking, and URI scheme interception.

Usage

Interactive

bash
archipelago generate webview_sdk

Non-interactive (CI)

bash
archipelago generate webview_sdk --config my_config.json

Generated Structure

features/
└── webview/
    └── webview/
        └── lib/src/
            ├── webview_controller.dart
            ├── webview_sdk.dart
            ├── webview_sdk_impl.dart
            ├── webview_inappwebview_controller.dart
            ├── di/
            └── models/

Platform Setup

Android — Internet Permission

xml
<uses-permission android:name="android.permission.INTERNET" />

iOS — App Transport Security

For HTTP (non-HTTPS) URLs, add to ios/Runner/Info.plist:

xml
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

For HTTPS-only apps this is not required.

Embedding the Widget

dart
final controller = getIt<WebViewSDK>().createController(
  const WebViewConfig(
    initialUrl: 'https://example.com',
    interceptedSchemes: ['app', 'tg'],
  ),
) as WebViewInAppWebViewController;

InAppWebView(
  initialUrlRequest: URLRequest(url: WebUri(config.initialUrl)),
  onWebViewCreated: (c) => controller.attachNativeController(c),
  shouldOverrideUrlLoading: controller.shouldOverrideUrlLoading,
  onProgressChanged: controller.onProgressChanged,
  onLoadStart: controller.onLoadStart,
  onLoadStop: controller.onLoadStop,
  onReceivedError: controller.onReceivedError,
);

URI Scheme Interception

dart
controller.interceptStream.listen((event) {
  // event.url  → Uri, e.g. app://trade/BTC
  // event.scheme → e.g. 'app'
  Navigator.pushNamed(context, '/trade/${event.url.pathSegments.last}');
});

One-Way JavaScript Calls

dart
await controller.runJavaScript('window.showBanner("hello")');

This package has no bidirectional JS bridge and no mini-app support. For those capabilities, install the independent webview_sdk_advanced brick.

Built by Banua Coder