Skip to content

Commit

Permalink
feat: improve mobile home (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier authored Dec 12, 2024
1 parent f1d51e0 commit eeca186
Show file tree
Hide file tree
Showing 12 changed files with 263 additions and 222 deletions.
156 changes: 0 additions & 156 deletions lib/app/view/home_page.dart

This file was deleted.

2 changes: 1 addition & 1 deletion lib/app/view/master_items.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../common/view/icons.dart';
import '../../common/view/side_bar_fall_back_image.dart';
import '../../common/view/theme.dart';
import '../../constants.dart';
import '../../home/home_page.dart';
import '../../l10n/l10n.dart';
import '../../library/library_model.dart';
import '../../local_audio/view/album_page.dart';
Expand All @@ -22,7 +23,6 @@ import '../../radio/view/station_page.dart';
import '../../radio/view/station_page_icon.dart';
import '../../search/view/search_page.dart';
import '../../settings/view/settings_page.dart';
import 'home_page.dart';
import 'main_page_icon.dart';

class MasterItem {
Expand Down
32 changes: 6 additions & 26 deletions lib/app/view/mobile_navigation_bar.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
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';

Expand Down Expand Up @@ -35,41 +33,23 @@ class MobileNavigationBar extends StatelessWidget with WatchItMixin {
),
IconButton(
isSelected: selectedPageId == kLocalAudioPageId,
selectedIcon: const MainPageIcon(
selected: true,
audioType: AudioType.local,
),
icon: const MainPageIcon(
selected: false,
audioType: AudioType.local,
),
selectedIcon: Icon(Iconz.localAudioFilled),
icon: Icon(Iconz.localAudio),
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,
),
selectedIcon: Icon(Iconz.radioFilled),
icon: Icon(Iconz.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,
),
selectedIcon: Icon(Iconz.podcastFilled),
icon: Icon(Iconz.podcast),
tooltip: l10n.podcasts,
onPressed: () => di<LibraryModel>().push(pageId: kPodcastsPageId),
),
Expand Down
22 changes: 22 additions & 0 deletions lib/common/view/loading_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,25 @@ class LoadingGrid extends StatelessWidget {
);
}
}

class SliverLoadingGrid extends StatelessWidget {
const SliverLoadingGrid({
super.key,
required this.limit,
});

final int limit;

@override
Widget build(BuildContext context) {
return SliverGrid.builder(
itemCount: limit,
gridDelegate: audioCardGridDelegate,
itemBuilder: (context, index) => const AudioCard(
color: Colors.transparent,
showBorder: false,
bottom: AudioCardBottom(),
),
);
}
}
11 changes: 10 additions & 1 deletion lib/common/view/modals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ Future<void> showModal({
required BuildContext context,
required Widget content,
required ModalMode mode,
bool isScrollControlled = false,
bool enableDrag = true,
bool? showDragHandle,
}) async {
Widget builder(context) => content;

switch (mode) {
case ModalMode.bottomSheet:
showModalBottomSheet(context: context, builder: builder);
showModalBottomSheet(
isScrollControlled: isScrollControlled,
context: context,
builder: builder,
enableDrag: enableDrag,
showDragHandle: showDragHandle,
);

case ModalMode.dialog:
showDialog(
Expand Down
Loading

0 comments on commit eeca186

Please sign in to comment.