Aus öffentlichen Paketdaten erstellte Orientierung.
Das pwa_install-Paket ermöglicht Flutter-Anwendungen, mobile Webnutzer aufzufordern, ihre App als Progressive Web App (PWA) zu installieren. Es erkennt, wenn ein Benutzer die App über einen Webbrowser auf einem mobilen Gerät aufruft, und löst eine native Installationsaufforderung aus, was die Benutzerengagement und -bindung verbessert. Das Paket integriert sich nahtlos in die Flutter-Webplattform und unterstützt mehrere Betriebssysteme wie Android, iOS, macOS, Windows und Linux. Es nutzt Browser-fähigkeiten für PWA auf niedriger Ebene, um eine reibungslose Installationserfahrung zu bieten.
Anwendungsfälle
Webnutzer zur Installation einer PWA auffordern
App-Engagement in mobilen Browser steigern
Verbesserung der Retention für webbasierte Flutter-Apps
Offline-Zugriff über PWA aktivieren
Vereinfachung der Bereitstellung über Plattformen hinweg
Unterstützung der Hybrid-App-Verteilung
Hauptmerkmale
Erkennt mobilen Web-Zugriff
Löst native PWA-Installationsaufforderungen aus
Funktioniert über mehrere Plattformen hinweg
Minimale Einrichtung erforderlich
Integration mit Flutter Web
Nutzt Browser-PWA-APIs
Geeignet für
Entwickler, die Web-first-Flutter-Apps erstellen
Teams, die mobile Webnutzer ansprechen
Apps, die auf die PWA-Adoption abzielen
Projekte, die eine reibungsarme Installation erfordern
Plattformübergreifende Webanwendungen
Hybrid-App-Strategien
Hinweise
HTTPS für PWA-Funktionen erforderlich
Beschränkt auf Browser, die PWA-Installationsaufforderungen unterstützen
Kann auf allen mobilen Geräten nicht ausgelöst werden
Abhängig von den Benutzerberechtigungseinstellungen
Nicht für nicht-web-basierte Plattformen geeignet
Das Installationsverhalten unterscheidet sich je nach Browser
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
PWA Install
A small Flutter package that allows you to prompt mobile web users to install your Flutter app as a progressive web application (PWA) on demand.
A very basic example can be found here: PWA Install
The contents of this package are based on this article by Pete LePage (@petele)
Out-of-the-Box
As of release 1.20, all Flutter apps can be installed as PWAs. Combine this with the fact that all Chromium based browsers support PWAs and it becomes clear that designing your Flutter application for a mobile browser can be the most effective way of reaching a large audience.
When a Flutter app is opened in a supported browser, the user will see an install prompt like this:
Mobile Prompt
Web Prompt
This is awesome, but there's a caveat. The browser will only show the install prompt to users the first time they open your app. If the user refreshes the page or returns to the app while it's still in their browser history, the prompt will not be shown.
The PWA Install Package
With this package, you can prompt the user to install your app as a PWA on demand (e.g, on a button click). This package works by capturing the beforeinstallprompt event web browsers use to install PWAs. The event is captured when your app is launched and can be called anytime thereafter.
Setup
1. Update index.html
Add the following <script> tag to the body of web/index.html:
The following method can be called in main.dart before calling runApp(). PWAInstall() is instantiated as a singleton so you can use the class directly.