Home > Mobile >  how to arrange mini music player in single Bottom sheet for Every screen in flutter app
how to arrange mini music player in single Bottom sheet for Every screen in flutter app

Time:05-25

want to display mini-music-player at bottom of every screen but it would be must bottom sheet so I can animate the position of the image and controller in full screen.

here is my bottom bar item code

return Scaffold(
    body: tabs[currentTabIndex],
    backgroundColor: ColorConstants.kBackGround,
    bottomNavigationBar: Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        Container(
          margin: const EdgeInsets.all(10),
          width: 100.w,
          height: 60,
          alignment: Alignment.center,
          color: Colors.black38,
          child: Text(
            "Mini Player",
            style: Theme.of(context).textTheme.headline3,
          ),
        ),
        BottomNavigationBar(
          currentIndex: currentTabIndex,
          elevation: 0,
          onTap: (currentIndex) => setState(() {
            currentTabIndex = currentIndex;
          }),
          selectedLabelStyle: const TextStyle(color: Colors.white),
          selectedItemColor: ColorConstants.kDarkFontColor,
          backgroundColor: ColorConstants.kBackGround,
          showSelectedLabels: false,
          showUnselectedLabels: false,
          items: const [
            BottomNavigationBarItem(icon: Icon(Icons.home), label: ""),
            BottomNavigationBarItem(icon: Icon(Icons.search), label: ""),
            BottomNavigationBarItem(icon: Icon(Icons.library_books), label: "")
          ],
        )
      ],
    ),
  );

enter image description here

CodePudding user response:

I researched about his a little and came across this flutter package which can be used to solve this issue. If someone knows how to achieve this without using the package then please give your suggestion.

Mini Player: Flutter Package

  • Related