mz_back_plugin 0.0.3
mz_back_plugin: ^0.0.3 copied to clipboard

A Flutter plugin about Android device Exit.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:mz_back_plugin/mz_back_plugin.dart';

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

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

class _MyAppState extends State<MyApp> {

  Future<bool> _onWillPop() {
    MzBackPlugin.navigateToSystemHome();
    return Future.value(false);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: WillPopScope(
        onWillPop: _onWillPop,
        child: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: Container(),
        ),
      ),
    );
  }
}
0
likes
110
pub points
57%
popularity

A Flutter plugin about Android device Exit.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on mz_back_plugin