update_handler 0.0.3 copy "update_handler: ^0.0.3" to clipboard
update_handler: ^0.0.3 copied to clipboard

outdated

This package is used for Update handling .\nThere are two types of update -\n - Force Update\n - Soft Update\nIn Force Update user cannot proceed further without update the app updating in mandatory\n [...]

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
  UpdateHandler.androidAppId = "nic.goi.aarogyasetu";
  UpdateHandler.iosAppId = "1505825357";
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'UPDATE HANDLER Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
                onPressed: () {
                  UpdateHandler().isUpdateAvailable(
                      latestBuildNo: 10,
                      lastForceBuildNo: 10,
                      context: context);
                },
                child: Text("Force Updaste Popup")),
            ElevatedButton(
                onPressed: () {
                  UpdateHandler().isUpdateAvailable(
                      latestBuildNo: 10, lastForceBuildNo: 8, context: context);
                },
                child: Text("Soft Updaste Popup"))
          ],
        ),
      ),
    );
  }
}
9
likes
0
pub points
51%
popularity

Publisher

verified publishervaibhavchandolia.info

This package is used for Update handling .\nThere are two types of update -\n - Force Update\n - Soft Update\nIn Force Update user cannot proceed further without update the app updating in mandatory\nIn Soft update you simply get a popup that update is available updating is optional.\nlastForceBuildNo - means last build no you want to force update .\nlastBuildNo - means latest buildNo.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, package_info_plus, store_redirect

More

Packages that depend on update_handler