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

[flutter_adaptive_scaffold] Fix top padding for NavigationBar #4661

Merged
merged 4 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 2 additions & 1 deletion packages/flutter_adaptive_scaffold/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
#
# Name/Organization <email address>

Google Inc.
Google Inc.
Jason C.H <[email protected]>
6 changes: 5 additions & 1 deletion packages/flutter_adaptive_scaffold/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.7

* Fix top padding for NavigationBar

## 0.1.6

* Added support for displaying an AppBar on any Breakpoint by introducing appBarBreakpoint
Expand All @@ -11,7 +15,7 @@
## 0.1.4

* Use Material 3 NavigationBar instead of BottomNavigationBar

## 0.1.3

* Fixes `groupAlignment` property not available in `standardNavigationRail` - [flutter/flutter#121994](https://github.com/flutter/flutter/issues/121994)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,25 @@ class AdaptiveScaffold extends StatefulWidget {
final NavigationBarThemeData currentNavBarTheme =
NavigationBarTheme.of(context);
return NavigationBarTheme(
data: currentNavBarTheme.copyWith(
iconTheme: MaterialStateProperty.resolveWith(
(Set<MaterialState> states) {
data: currentNavBarTheme.copyWith(
iconTheme: MaterialStateProperty.resolveWith(
(Set<MaterialState> states) {
return currentNavBarTheme.iconTheme
?.resolve(states)
?.copyWith(size: iconSize) ??
IconTheme.of(context).copyWith(size: iconSize);
}),
},
),
),
child: MediaQuery(
data: MediaQuery.of(context).removePadding(removeTop: true),
child: NavigationBar(
selectedIndex: currentIndex ?? 0,
destinations: destinations,
onDestinationSelected: onDestinationSelected,
));
),
),
);
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_adaptive_scaffold/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_adaptive_scaffold
description: Widgets to easily build adaptive layouts, including navigation elements.
version: 0.1.6
version: 0.1.7
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_adaptive_scaffold%22
repository: https://github.com/flutter/packages/tree/main/packages/flutter_adaptive_scaffold

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ enum SimulatedLayout {
),
),
home: MediaQuery(
data: MediaQueryData(size: size),
data: MediaQueryData(
size: size,
padding: const EdgeInsets.only(top: 30),
),
child: TestScaffold(
initialIndex: initialIndex,
isAnimated: animations,
Expand Down