Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

show/hide widget based upon the value present

I have a floating action button that contains mini player and i want it to be hidden if the value like music path or title is not present but only show up if somebody passes the data or presses the songs. For example if How would I be able to achieve that ?

child:  Scaffold(
        floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
        extendBody: true,
        body: screens[index],
        bottomNavigationBar: Theme(
          data: Theme.of(context)
              .copyWith(iconTheme: IconThemeData(color: Colors.white)),
          child: CurvedNavigationBar(
            items: items,
            index: index,
            height: 55,
            color: Colors.indigo,
            backgroundColor: Colors.white,
            buttonBackgroundColor: Colors.indigo,
            onTap: (index) => setState(() => this.index = index),
          ),
        ),
        floatingActionButton: _playerControl(context), //this contains the mini 
          player. I want this to be hidden or present based upon the value received 
          by url argument
      ),
    );

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You can perform a condition check to do this


floatingActionButton : (title.isNotEmpty)?_playerControl(context) : null,
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading