imagefluttersocketexception

Socket exception when adding network image in flutter on actual android device


I added a network image which runs fine on emulator but i tried my app on my android device it shows this:

enter image description here

Code:

Center(
    child: CircleAvatar(
        radius: 40,
        backgroundImage: NetworkImage('https://images.unsplash.com/photo-1517423440428-a5a00ad493e8?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=900&q=60'),
    ),
),

Solution

  • If your device is connected to the network then the probable cause could be internet permission in AndroidManifest file.