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

Click here to check out more details on the Free Flutter Course. Playlist on the Right.



In this example, I'm going to share the code on how to share a Container as a Circle.
Here is how the final output is going to look like.
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. 
Here is the code from main.dart file that is required to create this circle.
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}


class _MyAppState extends State<myapp> {
  double padValue = 0;
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("Container as a Circle"),
        ),

        body: Container(
          margin: EdgeInsets.all(100.0),
          decoration: BoxDecoration(
            color: Colors.orange,
            shape: BoxShape.circle
          ),
        )
      ),
    );
  }
}
Hope this is helpful to you.
Thanks,
Srikanth

Tags: Container as a Circle






Click here to check out more details on the Free Flutter Course. Playlist on the Right.




0 Comments
Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.




Become self-reliant with flutter. Here is a course, suitable for someone who wants to relax and learn.
You can learn advanced topics like State Management, Animations, and how to deal with data through this course. Also, here is my GitHub project with a number of examples to begin with.

Go to Github

Search Results





©2018 - Fluttercentral | Email to me - Seven.srikanth@gmail.com