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

Enhance: Ensure consistent gradient for background in bottom navigation bar and iPhone home indicator #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
39 changes: 22 additions & 17 deletions lib/animated_bottom_navigation_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -413,23 +413,28 @@ class _AnimatedBottomNavigationBarState
}

Widget _buildBottomBar(BuildContext context) {
return Material(
clipBehavior: Clip.antiAlias,
color: widget.backgroundColor ?? Colors.white,
child: SafeArea(
top: widget.safeAreaValues.top,
bottom: widget.safeAreaValues.bottom,
left: widget.safeAreaValues.left,
right: widget.safeAreaValues.right,
child: widget.blurEffect
? ClipRect(
child: BackdropFilter(
filter: widget.blurFilter ??
ImageFilter.blur(sigmaX: 5, sigmaY: 10),
child: _buildBody(context),
),
)
: _buildBody(context),
return Container(
decoration: BoxDecoration(gradient: widget.backgroundGradient),
Comment on lines +416 to +417
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use DecoratedBox and BoxDecoration inside, its lighter than Container which has a lot of things that are not used here.

child: Material(
clipBehavior: Clip.antiAlias,
color: widget.backgroundGradient != null
? Colors.transparent
: widget.backgroundColor ?? Colors.white,
child: SafeArea(
top: widget.safeAreaValues.top,
bottom: widget.safeAreaValues.bottom,
left: widget.safeAreaValues.left,
right: widget.safeAreaValues.right,
child: widget.blurEffect
? ClipRect(
child: BackdropFilter(
filter: widget.blurFilter ??
ImageFilter.blur(sigmaX: 5, sigmaY: 10),
child: _buildBody(context),
),
)
: _buildBody(context),
),
),
);
}
Expand Down