Follow the below steps to create an Image in Circle Shape.
You need to follow this article to add images to your project,
How to add an image to the Project?
And then, copy the below code into your main.dart file. Note: Make sure you have updated the image file names as appropriate.
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(title: 'Flutter Image Examples'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new Container(
child: new Center(
child: new Stack(
alignment: const Alignment(0.8, 0.8),
children: [
CircleAvatar(
backgroundImage: AssetImage('images/carimg.jpeg'),
radius: 100.0,
),
Container(
decoration: BoxDecoration(
color: Colors.black45,
),
child: Text(
'Mia B',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
],
),
),
color: const Color(0xff00ffff),
),
);
}
}
Thanks,
Srikanth