container round shape flutter code example

Example 1: flutter circular container

Container(
  decoration: BoxDecoration(
    border: Border.all(
      color: Colors.red[500],
    ),
    borderRadius: BorderRadius.all(Radius.circular(20))
  ),
  child: ...
)

Example 2: flutter round container

QUESTION: Flutter give container rounded border

ANSWER1: 

Container(
    decoration: BoxDecoration(
    shape: BoxShape.circle,
    ),
    child:   ...
    ),

ANSWER 2:
Container(
  decoration: BoxDecoration(
    border: Border.all(
      color: Colors.red[500],
    ),
    borderRadius: BorderRadius.all(Radius.circular(20))
  ),
  child: ...
)

Example 3: Flutter make a circle container

import 'package:flutter/material.dart';

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

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


class _MyAppState extends State {
  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
          ),
        )
      ),
    );
  }
}

Example 4: how to make a circuler container

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

Example 5: round container flutter

Container(
      width: screenWidth / 7,
      decoration: BoxDecoration(
        border: Border.all(
          color: Colors.red[500],
        ),
      ),
      child: Padding(
        padding: EdgeInsets.all(5.0),
        child: Column(
          children: <Widget>[
            Text(
              '6',
              style: TextStyle(
                  color: Colors.red[500],
                  fontSize: 25),
            ),
            Text(
             'sep',
              style: TextStyle(
                  color: Colors.red[500]),
            )
          ],
        ),
      ),
    );

Tags:

Misc Example