Skip to content

Commit 5f56c76

Browse files
committed
fix maskClose_nonAnimation
1 parent a9f2dea commit 5f56c76

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

lib/src/data/base_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class BaseController {
1818
nonAnimationType == SmartNonAnimationType.maskClose_nonAnimation) {
1919
return true;
2020
} else if (closeType == CloseType.back &&
21-
nonAnimationType == SmartNonAnimationType.maskClose_nonAnimation) {
21+
nonAnimationType == SmartNonAnimationType.backClose_nonAnimation) {
2222
return true;
2323
}
2424

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
import 'package:flutter_test/flutter_test.dart';
2+
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
3+
import 'package:flutter_smart_dialog/src/data/base_controller.dart';
4+
import 'package:flutter_smart_dialog/src/helper/dialog_proxy.dart';
25

36
void main() {
4-
test('adds one to input values', () {});
7+
group('BaseController.judgeDismissDialogType', () {
8+
final controller = _TestController();
9+
10+
test('uses backClose_nonAnimation only for back dismissals', () {
11+
expect(
12+
controller.judgeDismissDialogType(
13+
CloseType.back,
14+
SmartNonAnimationType.backClose_nonAnimation,
15+
),
16+
isTrue,
17+
);
18+
expect(
19+
controller.judgeDismissDialogType(
20+
CloseType.back,
21+
SmartNonAnimationType.maskClose_nonAnimation,
22+
),
23+
isFalse,
24+
);
25+
});
26+
});
27+
}
28+
29+
class _TestController extends BaseController {
30+
@override
31+
Future<void> dismiss({CloseType closeType = CloseType.normal}) async {}
532
}

0 commit comments

Comments
 (0)