zeba_academy_app_updater

A Flutter package to help apps check for updates dynamically, display force or optional update dialogs, redirect to app stores, and perform silent background update checks.

Keep your users always on the latest version while optionally enforcing critical updates.

✨ Features

  • šŸ”„ Version Check from API Fetch the latest app version from your backend.

  • ⚔ Force Update Dialog Force users to update when a critical release is available.

  • šŸ“ Optional Update Notification Notify users about new versions without enforcing an update.

  • šŸ›‚ Store Redirection Redirect users to Google Play Store or Apple App Store automatically.

  • 🤫 Silent Background Update Check Check for updates in the background without disrupting the user experience.

  • šŸ“Š Changelog Display Show the release notes or changelog in the update dialog.

šŸ“¦ Installation

Add this to your pubspec.yaml:

dependencies:
  zeba_academy_app_updater: ^1.0.0

Then run:

flutter pub get

šŸš€ Basic Usage

Import the package:

import 'package:zeba_academy_app_updater/zeba_academy_app_updater.dart';

šŸ”„ Checking for Updates

ZebaAppUpdater updater = ZebaAppUpdater(
  context: context,
  apiUrl: 'https://example.com/version',
  playStoreUrl: 'https://play.google.com/store/apps/details?id=com.example.app',
  appStoreUrl: 'https://apps.apple.com/app/id123456789', // optional
  showOptionalUpdate: true, // optional
);

updater.checkUpdate();

🤫 Silent Background Check

await updater.silentCheck();

āœ… Version Comparison (Internal)

bool isUpdateAvailable = updater.testVersionComparison('2.0.0', '1.0.0'); // true

šŸ“± Example App

import 'package:flutter/material.dart';
import 'package:zeba_academy_app_updater/zeba_academy_app_updater.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text("Zeba App Updater Test")),
        body: const Center(child: UpdateWidget()),
      ),
    );
  }
}

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

  @override
  State<UpdateWidget> createState() => _UpdateWidgetState();
}

class _UpdateWidgetState extends State<UpdateWidget> {
  late ZebaAppUpdater updater;

  @override
  void initState() {
    super.initState();
    updater = ZebaAppUpdater(
      context: context,
      apiUrl: 'https://example.com/version',
      playStoreUrl: 'https://play.google.com/store/apps/details?id=com.example.app',
      appStoreUrl: 'https://apps.apple.com/app/id123456789',
    );

    updater.checkUpdate(); // Trigger update check
  }

  @override
  Widget build(BuildContext context) {
    return const Text("Checking for updates...");
  }
}

šŸŽÆ Use Cases

This package is ideal for:

  • Apps with frequent updates
  • Critical enterprise applications
  • Financial or banking apps
  • Educational apps delivering new content regularly
  • Any app where keeping users updated is crucial

šŸ“š Documentation

For tutorials, examples, and detailed guides:

https://zeba.academy/flutter/

šŸ¤ Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a new feature branch
  3. Commit your changes
  4. Submit a pull request

šŸ“ License

This project is licensed under the GNU General Public License v3.0.

About Me

✨ I’m Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at https://sufyanism.com/ or connect with me on https://www.linkedin.com/in/sufyanism

Your all-in-one no-bloat hub!

šŸš€ Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy.

Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience.

Level up your tech game today! šŸ’»āœØ

Zeba Academy is a learning platform dedicated to coding, technology, and development.

āž” Visit our main site: https://zeba.academy āž” Explore hands-on courses and resources at: https://code.zeba.academy āž” Check out our YouTube for more tutorials: https://www.youtube.com/@zeba.academy āž” Follow us on Instagram: https://www.instagram.com/zeba.academy/

Thank you for visiting!