Skip to content

Commit

Permalink
refactor: expose dismissDirection
Browse files Browse the repository at this point in the history
  • Loading branch information
adar2378 committed Feb 7, 2024
1 parent 643f7d7 commit d071f5f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ class DjangoflowAppSnackbar {
EdgeInsetsGeometry? margin,
SnackBarBehavior? behavior,
ShapeBorder? shape,
DismissDirection dismissDirection = DismissDirection.down,
}) {
if (scaffoldMessengerKey.currentState?.mounted == true) {
scaffoldMessengerKey.currentState?.showSnackBar(
SnackBar(
shape: shape,
margin: margin,
behavior: behavior,
dismissDirection: dismissDirection,
duration: duration,
content: Text(message),
action: action ??
Expand All @@ -41,6 +43,7 @@ class DjangoflowAppSnackbar {
EdgeInsetsGeometry? margin,
SnackBarBehavior? behavior,
ShapeBorder? shape,
DismissDirection dismissDirection = DismissDirection.down,
}) {
if (scaffoldMessengerKey.currentState?.mounted == true) {
scaffoldMessengerKey.currentState?.showSnackBar(
Expand All @@ -49,6 +52,7 @@ class DjangoflowAppSnackbar {
shape: shape,
margin: margin,
behavior: behavior,
dismissDirection: dismissDirection,
content: Text(message),
action: action ??
const SnackBarAction(
Expand All @@ -75,6 +79,7 @@ class DjangoflowAppSnackbar {
EdgeInsetsGeometry? margin,
SnackBarBehavior? behavior,
ShapeBorder? shape,
DismissDirection dismissDirection = DismissDirection.down,
}) {
if (scaffoldMessengerKey.currentState?.mounted == true) {
scaffoldMessengerKey.currentState?.showSnackBar(
Expand All @@ -83,6 +88,7 @@ class DjangoflowAppSnackbar {
shape: shape,
margin: margin,
behavior: behavior,
dismissDirection: dismissDirection,
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down

0 comments on commit d071f5f

Please sign in to comment.