How to shape a Container as a Circle in Flutter?

This Article is posted by seven.srikanth at 9/10/2019 4:59:11 PM



<p>In this example, I'm going to share the code on how to share a Container as a Circle.</p> <p>Here is how the final output is going to look like.</p> <p>![](https://fluttercentral.com/Uploads/fa4ab800-754c-472b-ad39-c2652cd3c262.PNGwidth="50%height="auto](</p> <p>Here is the live coding video for this example. This video demonstrates how to code by going through the documentation. Subscribe to my channel for more videos like this.</p> <p>Here is the code from main.dart file that is required to create this circle.</p> <p>runApp(MyApp());</p> <p>class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); }</p> <p>class _MyAppState extends State { double padValue = 0; @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text("Container as a Circle"), ),</p> <pre> body: Container( margin: EdgeInsets.all(100.0), decoration: BoxDecoration( color: Colors.orange, shape: BoxShape.circle ), ) ), ); </pre> <p>} }</p> <p>Hope this is helpful to you.</p> <p>Thanks, Srikanth</p>


Tags: Container as a Circle








0 Comments
Login to comment.
Recent Comments