搜尋套件、儲存庫與 APP 分類

套件詳情v0.17.3

flutter_web_browser

一個 Flutter 插件專案,用於使用 Chrome 自訂標籤頁與 SFSafariViewController 開啟網頁。

AndroidiOS
近 30 天下載
1.4萬
喜歡數
95
Pub 分數
130

安裝套件

flutter pub add flutter_web_browser

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 外掛程式,可使用平台特定的瀏覽器元件開啟網頁:Android 上的 Chrome 自訂標籤頁和 iOS 上的 SFSafariViewController。它提供無縫、類似原生的瀏覽體驗,無需離開應用程式。該套件輕巧,並能輕鬆整合至現有的 Flutter 專案中。支援深度連結,並在導航期間維持使用者狀態。適用於需要安全、品牌化的網頁檢視且開銷最小的應用。

適用情境

  • 在應用內開啟外部連結
  • 安全嵌入網頁內容
  • 重定向使用者到登入或付款頁面
  • 顯示幫助或服務條款
  • 透過原生瀏覽器UI提升使用者參與度

主要特色

  • Android 上的 Chrome 自訂標籤頁
  • iOS 上的 SFSafariViewController
  • 安全的原生瀏覽體驗
  • 最小化應用切換
  • 支援深度連結
  • 與 Flutter 的輕鬆整合

適合對象

  • 需要安全網頁導航的應用程式
  • 希望實現原生瀏覽器行為的開發者
  • 包含外部內容連結的專案
  • 以行動裝置為首選的應用程式
  • 以使用者體驗為導向的應用程式,重視順暢的轉場效果

使用建議

  • 需要 Android SDK 21+ 才能獲得完整功能
  • SFSafariViewController 需要 iOS 9 或更高版本
  • 與完整 WebView 相比,自訂功能有限
  • 網頁內容不支援離線使用
  • 取決於系統瀏覽器的可用性

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_web_browser

Pub

A flutter plugin to open a web page with Chrome Custom Tabs & SFSafariViewController.

This plugin is under development, APIs might change.

Getting Started

Installation

Install the library from pub:

dependencies:
  flutter_web_browser: "^0.17.3"
Import the library
import 'package:flutter_web_browser/flutter_web_browser.dart';
Open the web page
FlutterWebBrowser.openWebPage(
  url: "https://flutter.io/",
  customTabsOptions: const CustomTabsOptions(
    colorScheme: CustomTabsColorScheme.dark,
    toolbarColor: Colors.deepPurple,
    secondaryToolbarColor: Colors.green,
    navigationBarColor: Colors.amber,
    shareState: CustomTabsShareState.on,
    instantAppsEnabled: true,
    showTitle: true,
    urlBarHidingEnabled: true,
  ),
  safariVCOptions: const SafariViewControllerOptions(
    barCollapsingEnabled: true,
    preferredBarTintColor: Colors.green,
    preferredControlTintColor: Colors.amber,
    dismissButtonStyle: SafariViewControllerDismissButtonStyle.close,
    modalPresentationCapturesStatusBarAppearance: true,
  ),
);

License

This project is licensed under the terms of the MIT license.

所屬分類

原始碼儲存庫

使用此套件的專案