Pakete, Repositories und App-Kategorien suchen

GitHub-RepositorygskinnerTeam/flutter-universal-platform

flutter-universal-platform

Eine web-sichere Implementierung von dart.io.Platform. Hilft, den Laufzeitfehler "Unsupported operation: Platform._operatingSystem" zu vermeiden.

Projektcover von flutter-universal-platform
Sterne
111
Forks
30
Letzter Push (UTC)
23.05.2024
Projektstatus
Aktiv

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

Universal Platform - A Web-safe Platform class

pub package

Currently, if you include the dart.io.Platform anywhere in your code, your app will throw the following error on Web:

Unsupported operation: Platform._operatingSystem

With this plugin you can perform platform detection on all platforms, including Web, without errors.

🔨 Installation

dependencies:
  universal_platform: ^1.0.0+1
⚙ Import

Remove any usages of dart.io.Platform, and replace with this:

import 'package:universal_platform/universal_platform.dart';

🕹️ Usage

This acts as a drop-in replacement for dart.io.Platform, with a different name for improved clarity.

//This will explode on Web
bool isIos = Platform.isIOS;

//This will not :)
bool isIos = UniversalPlatform.isIOS;
bool isWeb = UniversalPlatform.isWeb;

🐞 Bugs/Requests

If you encounter any problems feel open an issue. If you feel the library is missing a feature, please raise a ticket on Github and we'll look into it. Pull request are also welcome.

📃 License

MIT License

gskinner team GitHub avatar
GitHub-Autor

gskinner team ↗

We collaborate with smart, motivated clients to conceptualize, design, and build world-class interactive experiences.

Edmonton, CanadaOffizielle Website ↗
SprachenDart

Von diesem Repository veröffentlichte Pakete

Wie wähle ich ein passendes Repository?

Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.

  1. Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
  2. Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
  3. Vor der Nutzung README, Lizenz und Issues auf GitHub prüfen.

Quellen und Pflege

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗