Skip to content

Instantly share code, notes, and snippets.

@IshanFx
Last active April 3, 2019 07:01
Show Gist options
  • Save IshanFx/a6790a10f06a38bba71c3841b3293205 to your computer and use it in GitHub Desktop.
Save IshanFx/a6790a10f06a38bba71c3841b3293205 to your computer and use it in GitHub Desktop.
Flutter circle image
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
appBar: AppBar(
title: Text("circle"),
),
body: Center(
child: Container(
height: 80.0,
width: 80.0,
margin: EdgeInsets.only(
left: 5.0,
right: 5.0
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100.0),
border: Border.all(
width: 2.0,
style:BorderStyle.solid ,
color: Color.fromARGB(255, 0 , 0, 0)
),
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage("https://cdn.dribbble.com/users/1368/screenshots/1785863/icons_2x.png")
)
)
)
) ,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment