File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11import '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
36void 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}
You can’t perform that action at this time.
0 commit comments