firebase_github_updater 0.0.3 copy "firebase_github_updater: ^0.0.3" to clipboard
firebase_github_updater: ^0.0.3 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 {
    final updater = FirebaseUpdaterService(
      collectionName: 'app_releases',
      currentVersion: '1.0.0',
      currentBuildNumber: 1,
      packageName: 'com.example.app',
    );

    final update = await updater.checkForUpdate();

    if (update != null && mounted) {
      UpdateBottomSheet.show(
        context,
        update,
        onUpdateComplete: () {
          // Update completed
        },
      );
    }
  }

  @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