FLUTTER ECOSYSTEM

DarkNinja15/sync_sphere

用於檢查連線狀態的 Flutter 套件

sync_sphere 專案封面
Stars
2
Forks
0
最近推送(UTC)
2024年3月18日
專案狀態
未封存
Animesh Shukla GitHub avatar
GITHUB User

Animesh Shukla ↗

Writing code that almost compiles itself.

語言Dart

此儲存庫發佈的套件

使用的依賴

依賴清單 4 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

sync_sphere

A Flutter package for constant internet connectivity checking throughout the app.

Features

  • Monitors internet connectivity.
  • Displays a user-friendly screen when there is no internet connection.
  • Customizable options for the internet connectivity screen.

Getting Started

  1. Add the sync_sphere package to your pubspec.yaml file:
dependencies:
  sync_sphere: ^0.0.3
  1. Run pub get
flutter pub get
  1. import your package
import 'package:sync_sphere/sync_sphere.dart';
  1. Wrap child of your MaterialApp with the SyncSphere widget
void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: SyncSphere(
        child: YourMainScreen(),
        whenOffine: YourOfflineScreenWidget(),
      ),
    );
  }
}
  1. You can also use the default "No internet" widget
void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: SyncSphere(
        child: YourMainScreen(),
      ),
    );
  }
}