-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rework the bottom bar for mobile (#1073)
- Loading branch information
1 parent
474ab9c
commit 0e2a40c
Showing
46 changed files
with
322 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import '../../common/data/audio_type.dart'; | ||
import '../../common/view/icons.dart'; | ||
import '../../common/view/theme.dart'; | ||
import '../../common/view/ui_constants.dart'; | ||
import '../../constants.dart'; | ||
import '../../l10n/l10n.dart'; | ||
import '../../library/library_model.dart'; | ||
import 'main_page_icon.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:watch_it/watch_it.dart'; | ||
|
||
class MobileNavigationBar extends StatelessWidget with WatchItMixin { | ||
const MobileNavigationBar({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = context.l10n; | ||
|
||
final selectedPageId = | ||
watchPropertyValue((LibraryModel m) => m.selectedPageId); | ||
|
||
return SizedBox( | ||
height: navigationBarHeight, | ||
child: Padding( | ||
padding: const EdgeInsets.only(top: kMediumSpace), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
children: [ | ||
IconButton( | ||
isSelected: selectedPageId == kLikedAudiosPageId, | ||
selectedIcon: Icon(Iconz.heartFilled), | ||
icon: Icon(Iconz.heart), | ||
tooltip: l10n.local, | ||
onPressed: () => | ||
di<LibraryModel>().push(pageId: kLikedAudiosPageId), | ||
), | ||
IconButton( | ||
isSelected: selectedPageId == kLocalAudioPageId, | ||
selectedIcon: const MainPageIcon( | ||
selected: true, | ||
audioType: AudioType.local, | ||
), | ||
icon: const MainPageIcon( | ||
selected: false, | ||
audioType: AudioType.local, | ||
), | ||
tooltip: l10n.local, | ||
onPressed: () => | ||
di<LibraryModel>().push(pageId: kLocalAudioPageId), | ||
), | ||
IconButton( | ||
isSelected: selectedPageId == kRadioPageId, | ||
selectedIcon: const MainPageIcon( | ||
selected: true, | ||
audioType: AudioType.radio, | ||
), | ||
icon: const MainPageIcon( | ||
selected: false, | ||
audioType: AudioType.radio, | ||
), | ||
tooltip: l10n.radio, | ||
onPressed: () => di<LibraryModel>().push(pageId: kRadioPageId), | ||
), | ||
IconButton( | ||
isSelected: selectedPageId == kPodcastsPageId, | ||
selectedIcon: const MainPageIcon( | ||
selected: true, | ||
audioType: AudioType.podcast, | ||
), | ||
icon: const MainPageIcon( | ||
selected: false, | ||
audioType: AudioType.podcast, | ||
), | ||
tooltip: l10n.podcasts, | ||
onPressed: () => di<LibraryModel>().push(pageId: kPodcastsPageId), | ||
), | ||
IconButton( | ||
isSelected: selectedPageId == kSettingsPageId, | ||
selectedIcon: Icon(Iconz.settingsFilled), | ||
icon: Icon(Iconz.settings), | ||
tooltip: l10n.settings, | ||
onPressed: () => di<LibraryModel>().push(pageId: kSettingsPageId), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.