I want to put text below the image in a gridview
What I want:
What I have:
I want the music title and the artist name below the music cover, not inside, how do I do this?
I want to put text below the image in a gridview
What I want:
What I have:
I want the music title and the artist name below the music cover, not inside, how do I do this?
Instead of using this in your container:
decoration: BoxDecoration( image: DecorationImage( image: AssetImage(musicData['imagePath']), fit: BoxFit.fill, ), borderRadius: BorderRadius.circular(15), ),
Why not simply use a Column widget? With this, you can insert multiple widgets inside the children:
field (instead of sticking to 1 maximum at your container)
So something that looks like that as example:
Column(
children: const <Widget>[
AssetImage(musicData['imagePath']),
Text('Your title here'),
Text('A description, etc.')
],
)
You can try this
Column( children: const [
SizedBox(height:50,width:50,child:AssetImage(musicData['imagePath']),
Flexible(child:
Text('Your title here',
overflow: TextOverflow.ellipsis,maxLines: 1),),
Flexible(child:
Text('description,etc.',
overflow: TextOverflow.ellipsis,maxLines: 1),),
], )