Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
Binary file modified .env
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import "package:fast_immutable_collections/fast_immutable_collections.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";

import "../../../../utils/ref_extensions.dart";
import "../models/history_entry.dart";
import "radio_luz_repository.dart";

part "history_entry_repository.g.dart";

@riverpod
Future<IList<HistoryEntry>?> historyEntryRepository(Ref ref) async {
final repository = ref.read(radioLuzRepositoryProvider);
ref.setRefresh(const Duration(seconds: 60));
final repository = ref.watch(radioLuzRepositoryProvider);

final history = await repository.getRecentlyPlayed();
if (history == null) {
Expand Down
43 changes: 25 additions & 18 deletions lib/features/radio_luz/presentation/radio_luz_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "../../../config/ui_config.dart";
import "../../../theme/app_theme.dart";
import "../../../utils/context_extensions.dart";
import "../../../widgets/horizontal_symmetric_safe_area.dart";
import "../data/repository/history_entry_repository.dart";
import "../service/radio_player_controller.dart";
import "audio_player_widget.dart";
import "broadcasts_section.dart";
Expand Down Expand Up @@ -42,24 +43,30 @@ class RadioLuzView extends HookConsumerWidget {
color: context.colorScheme.surfaceTint,
child: Stack(
children: [
ListView(
padding: const EdgeInsets.symmetric(vertical: RadioLuzConfig.horizontalBasePadding),
children: [
RadioLuzTitle(title: l10n.now_playing.toUpperCase()),
const SizedBox(height: 12),
const NowPlayingSection(),
const SizedBox(height: 24),
RadioLuzTitle(title: l10n.broadcast.toUpperCase()),
const SizedBox(height: 12),
const BroadcastsSection(),
const SizedBox(height: 20),
RadioLuzTitle(title: l10n.radio_luz_info.toUpperCase()),
const SizedBox(height: 12),
const _TextSection(),
const SizedBox(height: 12),
const RadioLuzSocialsSection(),
const SizedBox(height: 80),
],
RefreshIndicator(
onRefresh: () async {
// ignore: unused_result
await ref.refresh(historyEntryRepositoryProvider.future);
},
child: ListView(
padding: const EdgeInsets.symmetric(vertical: RadioLuzConfig.horizontalBasePadding),
children: [
RadioLuzTitle(title: l10n.now_playing.toUpperCase()),
const SizedBox(height: 12),
const NowPlayingSection(),
const SizedBox(height: 24),
RadioLuzTitle(title: l10n.broadcast.toUpperCase()),
const SizedBox(height: 12),
const BroadcastsSection(),
const SizedBox(height: 20),
RadioLuzTitle(title: l10n.radio_luz_info.toUpperCase()),
const SizedBox(height: 12),
const _TextSection(),
const SizedBox(height: 12),
const RadioLuzSocialsSection(),
const SizedBox(height: 80),
],
),
),
const Align(alignment: Alignment.bottomCenter, child: AudioPlayerWidget()),
],
Expand Down
Loading