rast_force_update 0.0.2 copy "rast_force_update: ^0.0.2" to clipboard
rast_force_update: ^0.0.2 copied to clipboard

A Flutter package to force update your app.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: SplashScreen(),
    );
  }
}

class SplashScreen extends StatefulWidget {
  @override
  State<SplashScreen> createState() => _SplashScreenState();
}

class _SplashScreenState extends State<SplashScreen> {
  String latestVersion = "2.0.0";

  bool isForceUpdate = true;

  String updateMessage =
      "A new version of the app is available. Please update to continue.";

  @override
  void initState() {
    // TODO: implement initState
    super.initState();

    RastForceUpdate(
      context: context,
      latestVersion: latestVersion,
      isForceUpdate: isForceUpdate,
      updateMessage: updateMessage,
    ).checkForUpdate();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text('Splash Screen'),
      ),
    );
  }
}
5
likes
0
pub points
42%
popularity

Publisher

unverified uploader

A Flutter package to force update your app.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, package_info_plus, url_launcher

More

Packages that depend on rast_force_update