background_on_back 0.0.1 copy "background_on_back: ^0.0.1" to clipboard
background_on_back: ^0.0.1 copied to clipboard

Flutter plugin to handle backgound the app on pressing back button instead of quitting app.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: PopScope(
        canPop: false,
        onPopInvokedWithResult: (didPop, result) {
          if (didPop) return;
          BackgroundOnBack.pop();
        },
        child: Scaffold(
          appBar: AppBar(title: const Text('Plugin example app')),
          body: Center(child: Text('Press Back button to backgroun this app')),
        ),
      ),
    );
  }
}
0
likes
150
points
140
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin to handle backgound the app on pressing back button instead of quitting app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on background_on_back

Packages that implement background_on_back