content: /*
   *  This file is part of BlackHole (https://github.com/Sangwan5688/BlackHole).
   * 
   * BlackHole is free software: you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
   * BlackHole is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   * GNU Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public License
   * along with BlackHole.  If not, see <http://www.gnu.org/licenses/>.
   * 
   * Copyright (c) 2021-2022, Ankit Sangwan
   */
  
  import 'package:blackhole/Services/player_service.dart';
  import 'package:flutter/material.dart';
  import 'package:flutter_gen/gen_l10n/app_localizations.dart';
  
  class PlaylistHead extends StatelessWidget {
    final List songsList;
    final bool offline;
    final bool fromDownloads;
    const PlaylistHead({
      super.key,
      required this.songsList,
      required this.fromDownloads,
      required this.offline,
    });
    @override
    Widget build(BuildContext context) {
      return Container(
        height: 50,
        alignment: Alignment.center,
        padding: const EdgeInsets.only(left: 20.0, right: 10.0),
        decoration: const BoxDecoration(
          border: Border(bottom: BorderSide(color: Colors.black12)),
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              '${songsList.length} ${AppLocalizations.of(
                context,
              )!.songs}',
              style: const TextStyle(fontWeight: FontWeight.w600),
            ),
            const Spacer(),
            TextButton.icon(
              onPressed: () {
                PlayerInvoke.init(
                  songsList: songsList,
                  index: 0,
                  isOffline: offline,
                  fromDownloads: fromDownloads,
                  recommend: false,
                  shuffle: true,
                );
              },
              icon: const Icon(Icons.shuffle_rounded),
              label: Text(
                AppLocalizations.of(context)!.shuffle,
                style: const TextStyle(fontWeight: FontWeight.w600),
              ),
            ),
            IconButton(
              onPressed: () {
                PlayerInvoke.init(
                  songsList: songsList,
                  index: 0,
                  isOffline: offline,
                  fromDownloads: fromDownloads,
                  recommend: false,
                );
              },
              tooltip: AppLocalizations.of(context)!.shuffle,
              icon: const Icon(Icons.play_arrow_rounded),
              iconSize: 30.0,
            ),
          ],
        ),
      );
    }
  }
  