Skip to content

Commit

Permalink
Improvements for material 3 (#5740)
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k authored Oct 27, 2024
1 parent c8eee2e commit 40a8641
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 23 deletions.
58 changes: 35 additions & 23 deletions packages/smooth_app/lib/pages/page_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,42 @@ class PageManagerState extends State<PageManager> {
final bool isProd = userPreferences
.getFlag(UserPreferencesDevMode.userPreferencesFlagProd) ??
true;
final BottomNavigationBar bar = BottomNavigationBar(
onTap: (int index) {
if (_currentPage == BottomNavigationTab.Scan &&
_pageKeys[index] == BottomNavigationTab.Scan) {
carouselManager.showSearchCard();
}
final Widget bar = DecoratedBox(
decoration: BoxDecoration(
boxShadow: <BoxShadow>[
BoxShadow(
color: Theme.of(context).shadowColor.withOpacity(0.3),
offset: Offset.zero,
blurRadius: 10.0,
spreadRadius: 1.0,
),
],
),
child: BottomNavigationBar(
onTap: (int index) {
if (_currentPage == BottomNavigationTab.Scan &&
_pageKeys[index] == BottomNavigationTab.Scan) {
carouselManager.showSearchCard();
}

_selectTab(_pageKeys[index], index);
},
currentIndex: _currentPage.index,
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: const Icon(Icons.account_circle),
label: appLocalizations.profile_navbar_label,
),
BottomNavigationBarItem(
icon: const Icon(Icons.search),
label: appLocalizations.scan_navbar_label,
),
BottomNavigationBarItem(
icon: const Icon(Icons.list),
label: appLocalizations.list_navbar_label,
),
],
_selectTab(_pageKeys[index], index);
},
currentIndex: _currentPage.index,
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: const Icon(Icons.account_circle),
label: appLocalizations.profile_navbar_label,
),
BottomNavigationBarItem(
icon: const Icon(Icons.search),
label: appLocalizations.scan_navbar_label,
),
BottomNavigationBarItem(
icon: const Icon(Icons.list),
label: appLocalizations.list_navbar_label,
),
],
),
);
return WillPopScope2(
onWillPop: () async {
Expand Down
6 changes: 6 additions & 0 deletions packages/smooth_app/lib/pages/scan/scan_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ class _ScanHeaderState extends State<ScanHeader> {
borderRadius: BorderRadius.all(Radius.circular(18.0)),
),
),
foregroundColor: WidgetStateProperty.all<Color>(
Theme.of(context).colorScheme.onPrimary,
),
textStyle: WidgetStateProperty.all<TextStyle>(
const TextStyle(fontWeight: FontWeight.w600),
),
);

final bool compareFeatureAvailable = model.compareFeatureAvailable;
Expand Down
2 changes: 2 additions & 0 deletions packages/smooth_app/lib/themes/smooth_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class SmoothTheme {
selectedLabelStyle: const TextStyle(fontWeight: FontWeight.bold),
showUnselectedLabels: true,
unselectedIconTheme: const IconThemeData(size: 20.0),
elevation: 0.0,
enableFeedback: true,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
Expand Down

0 comments on commit 40a8641

Please sign in to comment.