Ads by ProfitSence
Close

Flutter Container Border Radius

Last Updated on Wednesday 5th Oct 2022

Flutter Container Border Radius

Border Radius Flutter

  • To add Border Radius to a Container. It's Very Simple. Just Add decoration to your container. use BoxDecoration property in decoration.
  • BoxDecoration has border-radius Property , gives a specific border radius to your Container.

Flutter Container Border

  • The BoxDecoration class provides a variety of ways to draw a box.
  • The shape of the box can be a circle or a rectangle. If it is a rectangle, then the borderRadius property controls the roundness of the corners.
			
					Container(
   margin: EdgeInsets.all(100.0),
   decoration: BoxDecoration(
      color: Colors.black,
      borderRadius: BorderRadius.only(
         topRight: Radius.circular(30.0),
         bottomLeft: Radius.circular(30.0),
      ),
    ),
  ),
),

			
	

box decoration flutter

			
					import 'package:flutter/material.dart';

class ContainerBoxShadow extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: Container(
          height: 100.0,
          width: 200.0,
          decoration: BoxDecoration(
              color: Colors.white,
              boxShadow: [
                BoxShadow(color: Colors.red, blurRadius: 12.0 ),
                BoxShadow(color: Colors.green, blurRadius: 40.0)
              ]
          ),
        )
      ),
    );
  }
}

			
	

References