搜索插件、代码仓与 APP 分类

插件详情v0.2.1

pwa

渐进式 Web 应用库

近 30 天下载
97
喜欢数
23
Pub 分数
20

安装插件

flutter pub add pwa

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

pwa 包是一个 Flutter 库,旨在帮助开发者轻松构建渐进式 Web 应用(PWA)。它提供了增强 Web 应用功能的工具和实用程序,例如离线支持、推送通知和可安装性。通过集成此包,开发者可以通过 Web 提供类似应用的体验,利用现代 Web 标准。对于希望在不需原生应用分发的情况下覆盖各类设备用户的项目来说,该库特别有用。该库支持无缝集成到 Flutter Web 项目中。

适合场景

  • 构建可安装的Web应用程序
  • 启用离线功能
  • 实现推送通知
  • 创建类应用的网页体验
  • 提升网页性能

主要特点

  • 通过服务工作者实现离线支持
  • 推送通知集成
  • Web 应用清单生成
  • 桌面和移动设备上的可安装性
  • 无缝的 Flutter 网页集成

适合对象

  • 面向网络的Flutter开发者
  • 面向广泛设备兼容性的项目
  • 寻求 PWA 功能但无需原生代码的开发者
  • 需要离线访问的应用程序
  • 跨平台网页应用开发

使用建议

  • 需要一个网络部署环境
  • 与原生应用相比,平台特定功能有限
  • 可能需要额外配置以实现高级 PWA 功能
  • 最适合仅限网页或以网页为主的应用程序
  • 依赖浏览器对 PWA 功能的支持

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Progressive Web App (PWA) for Dart

Progressive web apps (PWA) are a hybrid of regular web pages (or websites) and a mobile application. This new application model attempts to combine features offered by most modern browsers with the benefits of mobile experience.

Warning: the API is experimental, and subject to change.

Background

PWA is using ServiceWorkers:

Learn more about PWAs:

Articles about this packages:

Tutorial and Examples

Getting started

NOTE:

This library requires webdev installed locally. Install it using the command:

pub global activate webdev

  • Getting started: pwa_defaults

    • Shows you how to use the pwa package and what it does.
    • Enables offline asset caching for you web app out-of-the-box.
  • Additional offline urls: additional_offline_urls

    • Show you how to create the entry point for customization.
    • Gives you the ability to add additional URLs for the offline cache.

Customize caching

  • Custom routes: custom_routes
    • Familiarize yourself with caching and routes.
    • Customize cache behavior for different parts of your app.

Push notification

  • Push notification: push_notification
    • Check and/or request Push permission.
    • Trigger and handle push event, show notification.

Planned features

  • Typed Window <-> Worker communication, both Streams and request-reply patterns, something like:

    typedef Future<S> AsyncFunction<R, S>(R request);
    typedef S WireAdapter<R, S>(R input);
    
    abstract class MessageHub {
    
      AsyncFunction<R, S> getFunction<R, S>(String type,
          {WireAdapter<R, dynamic> encoder, WireAdapter<dynamic, S> decoder});
    
      void setHandler<R, S>(String type, AsyncFunction<R, S> handler,
          {WireAdapter<dynamic, R> decoder, WireAdapter<S, dynamic> encoder});
    
      Sink<T> getSink<T>(String type, {WireAdapter<T, dynamic> encoder});
    
      Stream<T> getStream<T>(String type, {WireAdapter<dynamic, T> decoder});
    }
    
  • Push Notification

    • notification for the client app
    • one-method registration and/or status request

所属分类

依赖

依赖清单 5 项

源码仓库

使用此插件的项目

暂无相关数据。