DEV Community

Cover image for How to add Border Radius to Container in Flutter ? fluttercorner.com
FlutterCorner
FlutterCorner

Posted on • Edited on

How to add Border Radius to Container in Flutter ? fluttercorner.com

Hello Guys How are you all? Hope you all are fine. Today We are going to learn How to add Border Radius to Container in Flutter ?

Many times we need to give Border Radius to Container, so i am going to share my code on on how to add Border Radius to a Container.

How to add Border Radius to Container in Flutter
How to add Border Radius to a Container.

Its Very Simple. Just Add decoration to your container.
use BoxDecoration property in decoration.

BoxDecoration has borderRadius Property.
give specify border radius to your Container.
Here is My Full Source Code.

import 'package:flutter/material.dart';

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

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: Text("Border Radius to Container - FlutterCorner"),
        ),
        body: Container(
          margin: EdgeInsets.all(100.0),
          decoration: BoxDecoration(
            color: Colors.green,
            borderRadius: BorderRadius.only(
              topRight: Radius.circular(30.0),
              bottomLeft: Radius.circular(30.0),
            ),
          ),
        ),
      ),
    );
  }
}
Enter fullscreen mode Exit fullscreen mode

So Guys That’s It For How to add Border Radius to Container in Flutter ? Hope you like our tutorial. Comment below Your thoughts and your queries. And Also Comment below your suggestion here.

Full Source Code at How to add Border Radius to Container in Flutter ?

Top comments (1)

Collapse
 
avinashchandan12 profile image
avinashchandan12

thank you soo much..