firebase_github_updater 0.0.4 copy "firebase_github_updater: ^0.0.4" to clipboard
firebase_github_updater: ^0.0.4 copied to clipboard

A Flutter package for automatic app updates via Firebase Firestore and GitHub releases with beautiful UI.

example/main.dart

import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_github_updater/firebase_github_updater.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(const MyApp());
}

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

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

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

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  void initState() {
    super.initState();
    _checkForUpdates();
  }

  Future<void> _checkForUpdates() async {
    // Simple one-liner - automatically shows bottom sheet if update available
    await FirebaseGithubUpdaterHelper.checkAndShowUpdate(
      context: context,
      collectionName: 'app_releases',
      currentVersion: '1.0.0',
      currentBuildNumber: 1,
      packageName: 'com.example.app',
      onUpdateComplete: () {
        print('Update completed!');
      },
      onNoUpdate: () {
        print('Already on latest version');
      },
      onError: (error) {
        print('Error checking update: $error');
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('My App')),
      body: Center(
        child: ElevatedButton(
          onPressed: _checkForUpdates,
          child: const Text('Check for Updates'),
        ),
      ),
    );
  }
}
2
likes
140
points
40
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter package for automatic app updates via Firebase Firestore and GitHub releases with beautiful UI.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

cloud_firestore, dio, firebase_core, flutter, path_provider

More

Packages that depend on firebase_github_updater