not able to define web links that will open when icon button is pressed in listview builder which is already under expantionbar

Issue

(question1) i am not able to think how to pass 3 weblink link ( google.com, yahoo.com, youtube.com) that will open when 3 corresponding icons in topic 1 are pressed in code on :
https://github.com/sandeepnarula999/FlutterProjects/blob/main/ListViewUnderExpansionTile
pls try to share the complete code if u are able to resolve my issue ..as i shared full code above…pls do
not share just steps of how to do coz that may add up to errrors when i try

(question2)
As per below image suggestion when i try to change code from line 7 to 10 in abve code link i get errors.. are u able to get zero error with this below approach in image

Solution

Solution : add three Flexible widgets in the Row widget 😉

if (root.children.isEmpty) {
      return ListTile(
        title: Text(root.title),
        subtitle: root.subtitle == null ? null : Text(root.subtitle!),
        trailing: Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            Flexible(
              child: IconButton(
                onPressed: () {},
                icon: const Icon(Icons.auto_stories),
                iconSize: 30,
                tooltip: 'Documents',
              ),flex: 1,
            ),
            Flexible(
              child: IconButton(
                onPressed: () {},
                icon: const Icon(Icons.video_collection_rounded),
                iconSize: 30,
                tooltip: 'Videos',
              ),
              flex: 1,
            ),
            Flexible(
              child: IconButton(
                onPressed: () {},
                icon: const Icon(Icons.favorite),
                iconSize: 20,
                tooltip: 'Shortlist',
              ),flex: 1,
            ),
          ],
        ),
      );
    }

enter image description here

Answered By – i.AGUIR

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.