Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow user to enable/disable back button when loading #214

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
cupertino_icons: ^1.0.1

dev_dependencies:
flutter_test:
Expand Down
12 changes: 8 additions & 4 deletions lib/src/easy_loading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import 'dart:math';

import 'package:flutter/material.dart';

import './animations/animation.dart';
import './theme.dart';
import './widgets/container.dart';
import './widgets/progress.dart';
import './widgets/indicator.dart';
import './widgets/overlay_entry.dart';
import './widgets/loading.dart';
import './animations/animation.dart';
import './theme.dart';
import './widgets/overlay_entry.dart';
import './widgets/progress.dart';

/// loading style
enum EasyLoadingStyle {
Expand Down Expand Up @@ -251,13 +251,15 @@ class EasyLoading {
Widget? indicator,
EasyLoadingMaskType? maskType,
bool? dismissOnTap,
bool? disableBackWhileLoading,
}) {
Widget w = indicator ?? (_instance.indicatorWidget ?? LoadingIndicator());
return _instance._show(
status: status,
maskType: maskType,
dismissOnTap: dismissOnTap,
w: w,
disableBackWhileLoading: disableBackWhileLoading,
);
}

Expand Down Expand Up @@ -420,6 +422,7 @@ class EasyLoading {
EasyLoadingMaskType? maskType,
bool? dismissOnTap,
EasyLoadingToastPosition? toastPosition,
bool? disableBackWhileLoading,
}) async {
assert(
overlayEntry != null,
Expand Down Expand Up @@ -472,6 +475,7 @@ class EasyLoading {
maskType: maskType,
dismissOnTap: dismissOnTap,
completer: completer,
disableBackWhileLoading: disableBackWhileLoading ?? false,
);
completer.future.whenComplete(() {
_callback(EasyLoadingStatus.show);
Expand Down