app_update_alert 1.5.5 copy "app_update_alert: ^1.5.5" to clipboard
app_update_alert: ^1.5.5 copied to clipboard

Allow users keep your app up to date on their devices, they can try new features, as well as benefit from performance improvements and bug fixes.

example/lib/main.dart

import 'package:app_update_alert/appApdateAlert.dart';
import 'package:flutter/material.dart';


void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

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

class MyHomePageState extends State<MyHomePage> {
  @override
  void initState() {
    super.initState();

    // Instantiate AppUpdate manager object (Using GCP Console app as example)
    final appUpdate = AppUpdates(
        iosPackageName: 'com.google.Vespa',
        androidPackageName: 'com.google.android.apps.cloudconsole',
        iosAppStoreCountry: 'in'
    );

    // Instantiate AppUpdate manager object with forceAppVersion
    final forceAppUpdate = AppUpdates(
        iosAppStoreCountry: 'in',
        forceAppVersion: '1.0.1'
    );

    // You can let the plugin handle fetching the status and showing a dialog,
    // or you can add version and forceUpdate the status to display the dialog.
    const forceUpdate = true;

    if (forceUpdate) {
      showUpdateDialog(forceAppUpdate);
    } else {
      showUpdateDialog(appUpdate);
    }
  }

  showUpdateDialog(AppUpdates appUpdate) {
    appUpdate.showUpdateAlert(context: context);
  }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Example App"),
      ),
    );
  }
}
7
likes
140
points
45
downloads

Publisher

verified publishervinodbaste.com

Weekly Downloads

Allow users keep your app up to date on their devices, they can try new features, as well as benefit from performance improvements and bug fixes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

collection, flutter, html, http, package_info_plus, url_launcher

More

Packages that depend on app_update_alert