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

A new Flutter plugin.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:flutter_restart/flutter_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
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
22
likes
30
points
337
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter plugin.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_restart