cross_in_app_update 0.0.1 copy "cross_in_app_update: ^0.0.1" to clipboard
cross_in_app_update: ^0.0.1 copied to clipboard

discontinued

A lightweight Flutter package that notifies users when a new app version is available on Google Play Store or Apple App Store. Supports force and soft update modes with customizable UI.

example/cross_in_app_update_example.dart

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

void main() => runApp(const MyApp());

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

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

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

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

class _HomePageState extends State<HomePage> {
  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((_) {
      // Basic usage — soft update dialog
      CrossInAppUpdate.checkForUpdate(context);

      // Force update example:
      // CrossInAppUpdate.checkForUpdate(
      //   context,
      //   config: UpdateConfig(updateMode: UpdateMode.force),
      // );

      // Custom dialog example:
      // CrossInAppUpdate.checkForUpdate(
      //   context,
      //   config: UpdateConfig(
      //     dialogBuilder: (context, version, openStore, dismiss) {
      //       return AlertDialog(
      //         title: Text('v$version available!'),
      //         actions: [
      //           if (dismiss != null) TextButton(onPressed: dismiss, child: const Text('Later')),
      //           ElevatedButton(onPressed: openStore, child: const Text('Update')),
      //         ],
      //       );
      //     },
      //   ),
      // );
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Cross In-App Update Example')),
      body: const Center(child: Text('Check for updates on launch')),
    );
  }
}
0
likes
0
points
116
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight Flutter package that notifies users when a new app version is available on Google Play Store or Apple App Store. Supports force and soft update modes with customizable UI.

Repository (GitHub)
View/report issues

Topics

#update #in-app-update #version-check #play-store #app-store

License

unknown (license)

Dependencies

flutter, http, package_info_plus, url_launcher

More

Packages that depend on cross_in_app_update