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

Add parameter to edit fit parameter Stack widget #52

Merged
merged 1 commit into from
May 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/src/badge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Badge extends StatefulWidget {
this.showBadge = true,
this.ignorePointer = false,
this.borderSide = BorderSide.none,
this.stackFit = StackFit.loose,
}) : super(key: key);

/// It defines the widget that will be wrapped by this [badgeContent].
Expand Down Expand Up @@ -106,6 +107,11 @@ class Badge extends StatefulWidget {
/// The default value is [BorderSide.none].
final BorderSide borderSide;

/// Allows to edit fit parameter to [Stack] widget.
///
/// The default value is [StackFit.loose].
final StackFit stackFit;

/// Allows to set border radius to this [badgeContent].
///
/// The default value is [BorderRadius.zero].
Expand Down Expand Up @@ -169,6 +175,7 @@ class BadgeState extends State<Badge> with SingleTickerProviderStateMixin {
return _getBadge();
} else {
return Stack(
fit: widget.stackFit,
alignment: widget.alignment,
clipBehavior: Clip.none,
children: [
Expand Down