flutter_app_restart 1.0.0 copy "flutter_app_restart: ^1.0.0" to clipboard
flutter_app_restart: ^1.0.0 copied to clipboard

A Flutter plugin to restart the app.

example/lib/main.dart

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


void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
//          child: Text('Running on: $_platformVersion\n'),
          child: MaterialButton(
            onPressed: () async {
              final result = await FlutterRestart.restartApp();
              print(result);
            },
            color: Colors.blueAccent,
            child: Padding(
              padding: const EdgeInsets.all(16.0),
              child: Text(
                'Click me',
                style: TextStyle(color: Colors.white, fontSize: 35.0),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
5
likes
110
pub points
69%
popularity

Publisher

unverified uploader

A Flutter plugin to restart the app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_app_restart