Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class FeedRemoteDatasourceImpl implements FeedDatasource {
return data
.map((e) => _parseItem(e as Map<String, dynamic>))
.whereType<FeedItemModel>()
.where((item) => item.contentType == 'track')
.toList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,23 @@ class _CircleAvatar extends StatelessWidget {
shape: BoxShape.circle,
border: Border.all(color: borderColor, width: borderWidth),
color: Colors.grey[900],
image: imageUrl.startsWith('http')
? DecorationImage(image: NetworkImage(imageUrl), fit: BoxFit.cover)
: null,
),
child: ClipOval(
child: imageUrl.startsWith('http')
? Image.network(
imageUrl,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) => const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 20,
),
),
)
: const Center(
child: Icon(Icons.music_note, color: Colors.white54, size: 20),
),
),
);
}
Expand Down
14 changes: 13 additions & 1 deletion lib/features/feed/presentation/widgets/hot_for_you.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ class _HotForYouCardState extends ConsumerState<HotForYouCard>
height: 22,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.grey[800],
image: DecorationImage(
image:
widget.track.coverImage != null &&
Expand Down Expand Up @@ -299,7 +300,18 @@ class _HotForYouCardState extends ConsumerState<HotForYouCard>
child:
widget.track.coverImage != null &&
widget.track.coverImage!.startsWith('http')
? Image.network(widget.track.coverImage!, fit: BoxFit.cover)
? Image.network(
widget.track.coverImage!,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) =>
const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 28,
),
),
)
: Image.asset(
widget.track.coverImage ?? widget.track.artworkUrl,
fit: BoxFit.cover,
Expand Down
48 changes: 39 additions & 9 deletions lib/features/feed/presentation/widgets/mixed_for_you.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,48 @@ class MixedPlaylistCard extends ConsumerWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1),
border: Border.all(color: Colors.grey, width: 0.5),
image: imagePath.isNotEmpty
? DecorationImage(
image: imagePath.startsWith('http')
? NetworkImage(imagePath) as ImageProvider
: AssetImage(imagePath),
color: Colors.grey[800],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(1),
child: imagePath.isEmpty
? const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 32,
),
)
: imagePath.startsWith('http')
? Image.network(
imagePath,
fit: BoxFit.cover,
width: double.infinity,
height: 130,
errorBuilder: (context, error, stackTrace) =>
const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 32,
),
),
)
: null,
: Image.asset(
imagePath,
fit: BoxFit.cover,
width: double.infinity,
height: 130,
errorBuilder: (context, error, stackTrace) =>
const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 32,
),
),
),
),
child: imagePath.isEmpty
? const Center(child: Icon(Icons.music_note))
: null,
),
Positioned(
bottom: 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,48 @@ class PlaylistSquareCard extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1),
border: Border.all(color: const Color(0xFF6C7C71), width: 0.5),
image: imagePath.isNotEmpty
? DecorationImage(
image: imagePath.startsWith('http')
? NetworkImage(imagePath) as ImageProvider
: AssetImage(imagePath),
color: Colors.grey[800], // fallback background always present
),
child: ClipRRect(
borderRadius: BorderRadius.circular(1),
child: imagePath.isEmpty
? const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 32,
),
)
: imagePath.startsWith('http')
? Image.network(
imagePath,
fit: BoxFit.cover,
width: double.infinity,
height: 140,
errorBuilder: (context, error, stackTrace) =>
const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 32,
),
),
)
: null,
: Image.asset(
imagePath,
fit: BoxFit.cover,
width: double.infinity,
height: 140,
errorBuilder: (context, error, stackTrace) =>
const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 32,
),
),
),
),
child: imagePath.isEmpty
? const Center(child: Icon(Icons.playlist_play))
: null,
),
const SizedBox(height: 8),
Text(
Expand Down
10 changes: 10 additions & 0 deletions lib/features/feed/presentation/widgets/trending_by_genre.dart
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,22 @@ class _TrendingHorizontalColumns extends ConsumerWidget {
width: 50,
height: 50,
color: Colors.grey[800],
child: const Icon(
Icons.music_note,
color: Colors.white54,
size: 22,
),
),
)
: Container(
width: 50,
height: 50,
color: Colors.grey[800],
child: const Icon(
Icons.music_note,
color: Colors.white54,
size: 22,
),
),
),
),
Expand Down
14 changes: 12 additions & 2 deletions lib/features/search/presentation/widgets/search_albums_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,18 @@ class _AlbumTile extends StatelessWidget {
width: 50,
height: 50,
fit: BoxFit.cover,
errorBuilder: (_, _, _) =>
Container(width: 50, height: 50, color: Colors.grey[800]),
errorBuilder: (_, _, _) => Container(
width: 50,
height: 50,
color: Colors.grey[800],
child: const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 32,
),
),
),
),
),
title: Text(
Expand Down
51 changes: 41 additions & 10 deletions lib/features/search/presentation/widgets/search_all_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import '../providers/search_providers.dart';
import '../widgets/track_tile.dart';
import '../widgets/search_profiles_tab.dart';
import '../../../../core/domain/entities/track.dart';
import '../../../../core/utils/formatters.dart';
import '../pages/search_seeall_page.dart';
import '../widgets/search_tracks_tab.dart';
import '../../../player/presentation/providers/queue_provider.dart';
Expand Down Expand Up @@ -203,8 +202,16 @@ class _PlaylistRow extends StatelessWidget {
width: 50,
height: 50,
fit: BoxFit.cover,
errorBuilder: (_, _, _) =>
Container(width: 50, height: 50, color: Colors.grey[800]),
errorBuilder: (_, _, _) => Container(
width: 50,
height: 50,
color: Colors.grey[800],
child: const Icon(
Icons.music_note,
color: Colors.white54,
size: 22,
),
),
),
),
title: Text(
Expand All @@ -214,7 +221,7 @@ class _PlaylistRow extends StatelessWidget {
),
// Duration is formatted from raw seconds via [Formatters.formatPlaylistDuration].
subtitle: Text(
'Playlist · ${playlist['trackCount']} tracks · ${Formatters.formatPlaylistDuration(int.parse(playlist['totalSeconds'] ?? '0'))}',
'Playlist · ${playlist['trackCount']} tracks',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: Colors.grey[400], fontSize: 12),
Expand Down Expand Up @@ -248,8 +255,16 @@ class _AlbumRow extends StatelessWidget {
width: 50,
height: 50,
fit: BoxFit.cover,
errorBuilder: (_, _, _) =>
Container(width: 50, height: 50, color: Colors.grey[800]),
errorBuilder: (_, _, _) => Container(
width: 50,
height: 50,
color: Colors.grey[800],
child: const Icon(
Icons.music_note,
color: Colors.white54,
size: 22,
),
),
),
),
title: Text(
Expand Down Expand Up @@ -333,8 +348,16 @@ class _TopResultCard extends ConsumerWidget {
width: 50,
height: 50,
fit: BoxFit.cover,
errorBuilder: (_, _, _) =>
Container(width: 50, height: 50, color: Colors.grey[800]),
errorBuilder: (_, _, _) => Container(
width: 50,
height: 50,
color: Colors.grey[800],
child: const Icon(
Icons.music_note,
color: Colors.white54,
size: 22,
),
),
),
),
title: Text(
Expand All @@ -360,8 +383,16 @@ class _TopResultCard extends ConsumerWidget {
width: 50,
height: 50,
fit: BoxFit.cover,
errorBuilder: (_, _, _) =>
Container(width: 50, height: 50, color: Colors.grey[800]),
errorBuilder: (_, _, _) => Container(
width: 50,
height: 50,
color: Colors.grey[800],
child: const Icon(
Icons.music_note,
color: Colors.white54,
size: 22,
),
),
),
),
title: Text(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../providers/search_providers.dart';
import '../../../../core/utils/formatters.dart';
import 'package:go_router/go_router.dart';

/// Search results tab displaying the playlists list from [searchResultsProvider].
Expand Down Expand Up @@ -68,8 +67,18 @@ class _PlaylistTile extends StatelessWidget {
width: 50,
height: 50,
fit: BoxFit.cover,
errorBuilder: (_, _, _) =>
Container(width: 50, height: 50, color: Colors.grey[800]),
errorBuilder: (_, _, _) => Container(
width: 50,
height: 50,
color: Colors.grey[800],
child: const Center(
child: Icon(
Icons.music_note,
color: Colors.white54,
size: 32,
),
),
),
),
),
title: Text(
Expand All @@ -78,7 +87,7 @@ class _PlaylistTile extends StatelessWidget {
overflow: TextOverflow.ellipsis,
),
subtitle: Text(
'Playlist · ${playlist['trackCount']} tracks · ${Formatters.formatPlaylistDuration(int.parse(playlist['totalSeconds'] ?? '0'))}',
'Playlist · ${playlist['trackCount']} tracks ',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: Colors.grey[400], fontSize: 12),
Expand Down
24 changes: 20 additions & 4 deletions lib/features/search/presentation/widgets/track_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ class TrackTile extends ConsumerWidget {
width: 50,
height: 50,
fit: BoxFit.cover,
errorBuilder: (_, _, _) =>
Container(width: 50, height: 50, color: Colors.grey[800]),
errorBuilder: (_, _, _) => Container(
width: 50,
height: 50,
color: Colors.grey[800],
child: const Icon(
Icons.music_note,
color: Colors.white54,
size: 22,
),
),
)
: Image.asset(
track.artworkUrl.isNotEmpty
Expand All @@ -37,8 +45,16 @@ class TrackTile extends ConsumerWidget {
width: 50,
height: 50,
fit: BoxFit.cover,
errorBuilder: (_, _, _) =>
Container(width: 50, height: 50, color: Colors.grey[800]),
errorBuilder: (_, _, _) => Container(
width: 50,
height: 50,
color: Colors.grey[800],
child: const Icon(
Icons.music_note,
color: Colors.white54,
size: 22,
),
),
),
),
title: Text(track.title, maxLines: 1, overflow: TextOverflow.ellipsis),
Expand Down
Loading
Loading