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

套件詳情v4.0.1

flml_internet_checker

此套件旨在僅透過將組件包裝在 InternetChecker 組件中來檢查網路連接,而無需在您的應用程式內使用任何函數呼叫

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
704
喜歡數
40
Pub 分數
160

安裝套件

flutter pub add flml_internet_checker

套件介紹

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

flml_internet_checker 套件為 Flutter 應用程式提供了一種簡單的方法,透過將任何元件包裝在 InternetChecker 元件中來監控網路連線。它不需要在應用程式程式碼中呼叫任何函數,即可自動偵測線上或離線狀態。此套件可在所有主要平台(包括 Android、iOS、Web、macOS、Windows 和 Linux)上運作。非常適合需要即時網路狀態更新而無需複雜設定的應用程式。其輕量級設計專注於易於整合與立即回饋。

適用情境

  • 即時網路狀態監控
  • 離線模式UI處理
  • 基於連接性的自動刷新
  • 應用行為適應
  • 連接變更期間的無縫使用者體驗

主要特色

  • 零函數呼叫整合
  • 自動連接檢測
  • 跨平台支援
  • 最小化樣板
  • 基於小部件的包裝器方法

適合對象

  • 簡單的連接檢查
  • 需要即時網路反饋的應用
  • 尋求快速實現的開發者
  • 根據線上/離線狀態自適應的UI
  • 網路邏輯最少的專案

使用建議

  • 僅限基本連接狀態
  • 無進階網路診斷
  • 依賴系統級網路API
  • 不處理代理或防火牆場景
  • 連接品質無自訂選項

原始 README

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

Internet connectivity checking package.

A Flutter package to check your internet connection by just wrapping the Scaffold with InternetChecker Widget.


Permissions

Android

Add the following permissions to your AndroidManifest.xml file:

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

Add the following permissions to your macOS .entitlements files:

<key>com.apple.security.network.client</key>
<true/>

Usage

1. Add dependency

Add the flml_internet_checker package to your pubspec.yaml file:

dependencies:
  flml_internet_checker: ^1.0.0
2. Import the package

Import the flml_internet_checker package into your Dart file:

import 'package:flml_internet_checker/flml_internet_checker.dart';
Example
InternetChecker(
      placeHolder: Lottie.asset(
        "assets/no_internet.json",
        height: 250,
      ),
      internetConnectionText: "No Internet Connection",
      child: const Scaffold(
        body: Center(
          child: Text("You are Online"),
        ),
      ),
    );

Credits

This package is a cloned and modified version of the internet_connection_checker_plus package.

The aim of this package is just to check the internet connectivity without putting the functions into the project and just wrap the widget with InternetChecker Widget.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。