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

update_notification 封面
插件详情v1.0.1

update_notification

检查用户是否拥有您 Flutter 应用的最新版本。

AndroidiOSmacOS
近 30 天下载
22
喜欢数
29
Pub 分数
120

安装插件

flutter pub add update_notification

插件介绍

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

update_notification 包帮助 Flutter 应用通过检查远程配置文件来确定用户是否运行最新版本。它支持 Android、iOS 和 macOS 平台,使开发者能够在有新版本可用时提示用户更新。该包从指定 URL 获取版本信息,将其与当前应用版本进行比较,并相应地触发通知或警报。非常适合维护应用质量,并确保用户能够受益于最新的改进和安全修复。

适合场景

  • 提示用户更新应用
  • 监控应用版本合规性
  • 通知用户新版本发布
  • 确保安全补丁的采用
  • 通过及时更新改善用户体验

主要特点

  • 通过URL检查远程版本
  • 支持多个平台
  • 可自定义的更新提示
  • 轻量且易于集成
  • 实时版本比较

适合对象

  • 需要频繁更新的应用
  • 企业应用
  • 安全敏感的应用程序
  • 面向用户移动应用
  • 跨平台 Flutter 项目

使用建议

  • 需要一个公开可访问的版本配置文件
  • 需要网络访问以进行检查
  • 如果配置不当,可能会影响性能
  • 依赖外部服务器的可靠性
  • 仅限基于版本的更新检测

原始 README

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

update_notification

  • This flutter package will alert app users to update the application.
  • With the help of an alert pop-up, users can easily navigate to the respective stores(App Store or play Store) to update the app.

UI

The UI of the alert dialog is simply a card.

Screenshots:

Installation

Add update_notification as a dependency in your pubspec.yaml file.

dependencies:
  update_notification: ^1.0.1

Usage

  • In main.dart (or any) file, first create an instance of the UpdateNotification class in your initState() method.

    final UpdateNotification updateNotification = UpdateNotification();

  • Pass the application package name in andoidAppId, iOSAppId.

  • Pass application minimum version value in minimumVersion parameter. This parameter is used to force people to update application, any user having version less than the specified version will be forced to update application

  • Call showAlertDialog method- updateNotification.showAlertDialog(context: context);

  • If updated app version is available on stores, application will get a popup on launch of application and an option to Update. On click of update button user will be directed to the respective stores(App store or play store).

Example

 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import '/update_notification.dart';

 class Example extends StatefulWidget {
   const Example({Key? key}) : super(key: key);

   @override
   _ExampleState createState() => _ExampleState();
 }

 class _ExampleState extends State<Example> {
   @override
   void initState() {
     super.initState();

     final UpdateNotification updateNotification =
         UpdateNotification(
             iOSAppId: 'com.google.myride',
             androidAppId: 'com.google.rever',
             minimumVersion: '1.0.0');

     showDialog(updateNotification);
   }

   void showDialog(UpdateNotification updateVersion) {
     updateVersion.showAlertDialog(context: context);
   }

   @override
   Widget build(BuildContext context) {
     return Scaffold(
       body: Container(),
     );
   }
 }

所属分类

依赖

依赖清单 6 项

源码仓库

使用此插件的项目

暂无相关数据。