How to add circleAvatar with listView layout

I am trying to display the contact list with gesture detector but I am unable to add the CircleAvatar image icon before the contact name.
Here is the code:

return Scaffold(
        body: new ListView.builder(
      //return ListView.builder(
        itemCount: _contacts!.length,
        itemBuilder: (BuildContext context, int index) {

       return new GestureDetector(
        child: SizedBox(
           height: 75.0,
           child: Text(_contacts![index].displayName),
            
        ),

      onTap: () {
        speak(_contacts![index].displayName);
      },
      onDoubleTap: (){
        speak("double tapped");
      },

    );}));

>Solution :

return  GestureDetector(
      onTap:(){},
        child: Row(
        children:[
      CircularAvatar(child:Image.network(_contacts![index].imageurl)),//charge the url here
       SizedBox(
           height: 75.0,
           child: Text(_contacts![index].displayName),
         )   
       ]
        ),

Leave a Reply