app_update_monitor 1.0.0 copy "app_update_monitor: ^1.0.0" to clipboard
app_update_monitor: ^1.0.0 copied to clipboard

retracted

A lightweight Flutter package that effortlessly checks for app updates by comparing the installed version with the latest version available on the Apple App Store and Google Play Store.

example/lib/main.dart

import 'package:app_update_monitor/src/version_checker.dart';
import 'package:app_update_monitor/widgets/update_dialog.dart';
import 'package:flutter/material.dart';

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

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

  Future<void> checkForUpdates(BuildContext context) async {
    final versionChecker = VersionChecker(
      appleId: '123456789', // Replace with your Apple ID
      googlePlayPackageName: 'com.example.app', // Replace with your package name
    );

    try {
      final versionInfo = await versionChecker.checkVersion();
      if (versionInfo.shouldUpdate) {
        showDialog(
          context: context,
          builder: (_) => UpdateDialog(versionInfo: versionInfo),
        );
      }
    } catch (e) {
      ScaffoldMessenger.of(context).showSnackBar(
        SnackBar(content: Text('Error checking version: $e')),
      );
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Version Checker Example')),
        body: Center(
          child: ElevatedButton(
            onPressed: () => checkForUpdates(context),
            child: const Text('Check for Updates'),
          ),
        ),
      ),
    );
  }
}
2
likes
0
points
50
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight Flutter package that effortlessly checks for app updates by comparing the installed version with the latest version available on the Apple App Store and Google Play Store.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, package_info_plus

More

Packages that depend on app_update_monitor