Skip to content

Commit

Permalink
isWide attribute in song tile
Browse files Browse the repository at this point in the history
  • Loading branch information
HemantKArya committed Apr 14, 2024
1 parent 777de6d commit 9e26484
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
5 changes: 1 addition & 4 deletions lib/screens/screen/home_views/youtube_views/playlist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import 'package:Bloomee/blocs/internet_connectivity/cubit/connectivity_cubit.dar
import 'package:Bloomee/blocs/mediaPlayer/bloomee_player_cubit.dart';
import 'package:Bloomee/model/MediaPlaylistModel.dart';
import 'package:Bloomee/model/yt_music_model.dart';
import 'package:Bloomee/screens/widgets/import_playlist.dart';
import 'package:Bloomee/screens/widgets/playPause_widget.dart';
import 'package:Bloomee/screens/widgets/snackbar.dart';
import 'package:Bloomee/screens/widgets/song_tile.dart';
import 'package:Bloomee/services/db/GlobalDB.dart';
import 'package:Bloomee/services/db/bloomee_db_service.dart';
import 'package:Bloomee/services/db/cubit/bloomee_db_cubit.dart';
import 'package:Bloomee/utils/external_list_importer.dart';
import 'package:Bloomee/model/songModel.dart';
import 'package:Bloomee/model/youtube_vid_model.dart';
import 'package:Bloomee/repository/Youtube/youtube_api.dart';
Expand All @@ -23,7 +20,6 @@ import 'package:flutter/material.dart';
import 'package:Bloomee/theme_data/default.dart';
import 'package:Bloomee/utils/load_Image.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:icons_plus/icons_plus.dart';
import 'package:just_audio/just_audio.dart';
import 'package:share_plus/share_plus.dart';
Expand Down Expand Up @@ -408,6 +404,7 @@ class _YoutubePlaylistState extends State<YoutubePlaylist> {
(context, index) {
return SongCardWidget(
song: mediaitems[index],
isWide: true,
onTap: () {
if (!listEquals(
context
Expand Down
21 changes: 15 additions & 6 deletions lib/screens/widgets/song_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class SongCardWidget extends StatelessWidget {
final bool? showInfoBtn;
final bool? showPlayBtn;
final bool? delDownBtn;
final bool? isWide;
final VoidCallback? onOptionsTap;
final VoidCallback? onInfoTap;
final VoidCallback? onPlayTap;
Expand All @@ -35,6 +36,7 @@ class SongCardWidget extends StatelessWidget {
this.onPlayTap,
this.onTap,
this.onDelDownTap,
this.isWide = false,
}) : super(key: key);

@override
Expand Down Expand Up @@ -75,12 +77,19 @@ class SongCardWidget extends StatelessWidget {
padding: const EdgeInsets.only(left: 4, right: 4),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: SizedBox(
width: 55,
height: 55,
child: loadImageCached(song.artUri.toString(),
fit: BoxFit.cover),
),
child: isWide ?? false
? SizedBox(
width: 80,
height: 55,
child: loadImageCached(song.artUri.toString(),
fit: BoxFit.cover),
)
: SizedBox(
width: 55,
height: 55,
child: loadImageCached(song.artUri.toString(),
fit: BoxFit.cover),
),
),
),
const SizedBox(width: 10),
Expand Down

0 comments on commit 9e26484

Please sign in to comment.