mirror of
https://github.com/inventree/inventree-app.git
synced 2025-07-04 04:40:51 +00:00
.github
android
assets
ios
lib
barcode
generated
inventree
l10n
settings
widget
company
order
part
stock
attachment_widget.dart
back.dart
dialogs.dart
drawer.dart
fields.dart
home.dart
notes_widget.dart
notifications.dart
paginator.dart
progress.dart
refreshable_state.dart
search.dart
snacks.dart
spinner.dart
api.dart
api_form.dart
app_colors.dart
dsn.dart
helpers.dart
l10.dart
labels.dart
main.dart
preferences.dart
user_profile.dart
res
test
.gitignore
.gitmodules
.metadata
BUILDING.md
LICENSE
README.md
analysis_options.yaml
crowdin.yml
find_dart_files.py
l10n.yaml
pubspec.lock
pubspec.yaml
requirements.txt
tasks.py
24 lines
556 B
Dart
24 lines
556 B
Dart
import "package:flutter/material.dart";
|
|
|
|
/*
|
|
* Construct a custom back button with special feature!
|
|
*
|
|
* Long-pressing on this will return the user to the home screen
|
|
*/
|
|
Widget backButton(BuildContext context, GlobalKey<ScaffoldState> key) {
|
|
|
|
return GestureDetector(
|
|
onLongPress: () {
|
|
// Display the menu
|
|
key.currentState!.openDrawer();
|
|
},
|
|
child: IconButton(
|
|
icon: BackButtonIcon(),
|
|
onPressed: () {
|
|
if (Navigator.of(context).canPop()) {
|
|
Navigator.of(context).pop();
|
|
}
|
|
},
|
|
),
|
|
);
|
|
} |