chore: run dart format
Some checks are pending
Flutter CI & Release / Test (push) Waiting to run
Flutter CI & Release / Build Android APKs (push) Blocked by required conditions
Flutter CI & Release / build_linux (push) Blocked by required conditions
Flutter CI & Release / Create GitHub Release (push) Blocked by required conditions

This commit is contained in:
Dr.Blank 2026-01-10 16:51:05 +05:30
parent a520136e01
commit e23c0b6c5f
No known key found for this signature in database
GPG key ID: BA5F87FF0560C57B
84 changed files with 1565 additions and 1945 deletions

View file

@ -52,7 +52,9 @@ class HomePage extends HookConsumerWidget {
// try again button
ElevatedButton(
onPressed: () {
ref.read(apiSettingsProvider.notifier).updateState(
ref
.read(apiSettingsProvider.notifier)
.updateState(
apiSettings.copyWith(activeLibraryId: null),
);
ref.invalidate(personalizedViewProvider);
@ -66,24 +68,25 @@ class HomePage extends HookConsumerWidget {
final shelvesToDisplay = data
// .where((element) => !element.id.contains('discover'))
.map((shelf) {
appLogger.fine('building shelf ${shelf.label}');
// check if showPlayButton is enabled for the shelf
// using the id of the shelf
final showPlayButton = switch (shelf.id) {
'continue-listening' =>
homePageSettings.showPlayButtonOnContinueListeningShelf,
'continue-series' =>
homePageSettings.showPlayButtonOnContinueSeriesShelf,
'listen-again' =>
homePageSettings.showPlayButtonOnListenAgainShelf,
_ => homePageSettings.showPlayButtonOnAllRemainingShelves,
};
return HomeShelf(
title: shelf.label,
shelf: shelf,
showPlayButton: showPlayButton,
);
}).toList();
appLogger.fine('building shelf ${shelf.label}');
// check if showPlayButton is enabled for the shelf
// using the id of the shelf
final showPlayButton = switch (shelf.id) {
'continue-listening' =>
homePageSettings.showPlayButtonOnContinueListeningShelf,
'continue-series' =>
homePageSettings.showPlayButtonOnContinueSeriesShelf,
'listen-again' =>
homePageSettings.showPlayButtonOnListenAgainShelf,
_ => homePageSettings.showPlayButtonOnAllRemainingShelves,
};
return HomeShelf(
title: shelf.label,
shelf: shelf,
showPlayButton: showPlayButton,
);
})
.toList();
return RefreshIndicator(
onRefresh: () async {
return ref.refresh(personalizedViewProvider);
@ -132,10 +135,6 @@ class HomePageSkeleton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: CircularProgressIndicator(),
),
);
return const Scaffold(body: Center(child: CircularProgressIndicator()));
}
}

View file

@ -17,7 +17,9 @@ class LibraryPage extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
// set the library id as the active library
if (libraryId != null) {
ref.read(apiSettingsProvider.notifier).updateState(
ref
.read(apiSettingsProvider.notifier)
.updateState(
ref.watch(apiSettingsProvider).copyWith(activeLibraryId: libraryId),
);
}
@ -48,12 +50,10 @@ class LibraryPage extends HookConsumerWidget {
final shelvesToDisplay = data
// .where((element) => !element.id.contains('discover'))
.map((shelf) {
appLogger.fine('building shelf ${shelf.label}');
return HomeShelf(
title: shelf.label,
shelf: shelf,
);
}).toList();
appLogger.fine('building shelf ${shelf.label}');
return HomeShelf(title: shelf.label, shelf: shelf);
})
.toList();
return RefreshIndicator(
onRefresh: () async {
return ref.refresh(personalizedViewProvider);
@ -85,10 +85,6 @@ class LibraryPageSkeleton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: CircularProgressIndicator(),
),
);
return const Scaffold(body: Center(child: CircularProgressIndicator()));
}
}