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

Catches the back pressed button and performs user defined action.

example/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: OnBackPressed(
        perform: () {
          print('The back button on the device was pressed');
        },
        child: Scaffold(
          body: Container(),
        ),
      ),
    );
  }
}
6
likes
120
pub points
79%
popularity

Publisher

unverified uploader

Catches the back pressed button and performs user defined action.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on back_pressed