Skip to content

Instantly share code, notes, and snippets.

@stephaniefash
Created August 16, 2020 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephaniefash/b55f8fccb4652dd751ecc9fcfde5014a to your computer and use it in GitHub Desktop.
Save stephaniefash/b55f8fccb4652dd751ecc9fcfde5014a to your computer and use it in GitHub Desktop.
class _MyHomePageState extends State<MyHomePage> {
String imageSource =
'https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80';
@override
Widget build(BuildContext context) {
return new Scaffold(
backgroundColor: Colors.blueGrey,
body: Center(
child: ClipOval( // <- Where the magic happens
child: Image.network(
imageSource,
width: 300,
height: 300,
fit: BoxFit.cover,
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment