-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow clicking on widgets behind the barrier (#101)
* feat: allow clicking on widgets behind the barrier * chore: remove and untrack unwanted files * test: cover `allowClicksOnBackground` cases
- Loading branch information
Showing
8 changed files
with
125 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,5 @@ build/ | |
!**/ios/**/default.pbxuser | ||
!**/ios/**/default.perspectivev3 | ||
|
||
|
||
# | ||
coverage/ | ||
.fvm/flutter_sdk |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export 'src/popover.dart'; | ||
export 'src/popover_direction.dart'; | ||
export 'src/popover_route.dart'; | ||
export 'src/popover_transition.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class PopoverRoute<T> extends RawDialogRoute<T> { | ||
/// If true, widgets behind the barrier can receive pointer events. | ||
final bool allowClicksOnBackground; | ||
|
||
PopoverRoute({ | ||
required super.pageBuilder, | ||
super.anchorPoint, | ||
super.barrierColor, | ||
super.barrierDismissible, | ||
super.barrierLabel, | ||
super.settings, | ||
super.transitionBuilder, | ||
super.transitionDuration, | ||
super.traversalEdgeBehavior, | ||
this.allowClicksOnBackground = false, | ||
}); | ||
|
||
@override | ||
Widget buildModalBarrier() { | ||
return IgnorePointer( | ||
ignoring: allowClicksOnBackground, | ||
child: super.buildModalBarrier(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters