Loading repository data…
Loading repository data…
bushra-muneer / repository
A lightweight Flutter plugin for opening web content with a simple in-app browser API for Android and iOS.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A lightweight Flutter plugin for opening web content with a small, friendly API.
The goal is simple: give Flutter apps one clean place to open a URL, listen to browser events, and use an embedded WebView when the app needs headers or a small JavaScript bridge.
This package is in release preparation.
The first public release is focused on:
SFSafariViewControllerflutter_inappwebview for simple JS bridge use casesWeb, macOS, Windows, and Linux are not being claimed as stable targets yet. They can be explored later after the mobile API is solid.
UniversalInAppBrowser.openUrl(...).BrowserOptions.browserEvents.InAppWebViewController when needed.The package is not published on pub.dev yet. Until the first release is published, use the Git dependency:
dependencies:
plugin_universal_in_app_browser:
git:
url: https://github.com/bushra-muneer/Plugin-Universal-in-app-browser.git
ref: main
After the package is published, installation will be:
flutter pub add plugin_universal_in_app_browser
import 'package:flutter/material.dart';
import 'package:plugin_universal_in_app_browser/plugin_universal_in_app_browser.dart';
final browser = UniversalInAppBrowser();
await browser.openUrl(
'https://flutter.dev',
options: const BrowserOptions(
showTitle: true,
toolbarColor: Color(0xFF202020),
),
);
browserEvents.listen((event) {
debugPrint('Browser event: $event');
});
Common event names:
openeddismissederrorpageStartedpageFinishedUse the embedded flow when you need custom headers, JavaScript evaluation, or simple app-to-page communication.
final embedded = await browser.openEmbedded(
context,
'https://example.com',
options: const BrowserOptions(
showTitle: true,
),
);
await embedded?.addJavascriptHandler('demo', (message) {
debugPrint('Message from page: $message');
});
await embedded?.evaluateJavascript('document.title');
await embedded?.postMessage('hello from Flutter');
For advanced cases, you can access the underlying controller:
final controller = embedded?.getUnderlyingController();
await controller?.reload();
Android uses Chrome Custom Tabs through a small native wrapper activity. The wrapper is used so the plugin can send a best-effort dismissed event when the user returns to the app.
Custom Tabs do not reliably support arbitrary request headers for the first navigation. Use the embedded WebView mode if headers are required.
iOS uses SFSafariViewController. It supports a native Safari-style in-app browser and sends a dismiss event when the user closes it.
SFSafariViewController does not support arbitrary request headers. Use the embedded WebView mode if headers are required.
git clone https://github.com/bushra-muneer/Plugin-Universal-in-app-browser.git
cd Plugin-Universal-in-app-browser/example
flutter pub get
flutter run
The example app includes:
From the package root:
flutter pub get
dart format .
flutter analyze
flutter test
Before publishing:
dart pub publish --dry-run
Before the first pub.dev release, confirm:
flutter analyze passes.flutter test passes.dart pub publish --dry-run has no blocking issues.flutter_inappwebview controller.MIT License. See LICENSE for details.