How to add Border Radius to Container in Flutter ?

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.

Question: How to add Border Radius to Container in Flutter ?
Answer: Many times we need to give Border Radius to Container, so i am going to share my code on How to add

  • 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),
            ),
          ),
        ),
      ),
    );
  }
}

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.

Also Read How To Use Date Picker in Flutter.

Milan Dhameliya is an Information Technology Engineer. By profession, he is a Full Stack developer with knowledge of multiple back-end platforms (e.g., PHP, Node.js, Python) and frontend Flutter frameworks.

Leave a Comment