main.dart
import 'package:flutter/material.dart';
void main() => runApp(const FlutterExample());
class FlutterExample extends StatelessWidget {
const FlutterExample({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Example',
theme: ThemeData(primarySwatch: Colors.pink),
home: const StateExample()
);
}
}
class StateExample extends StatefulWidget {
const StateExample({Key? key}) : super(key: key);
@override
_StateExampleState createState() => _StateExampleState();
}
class _StateExampleState extends State<StateExample>{
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFFEFEFA),
appBar: AppBar(
title: const Text("Flutter - Container Shape Circle")
),
body: bodyContent(),
);
}
bodyContent() {
return Center(
child: Container(
child: const Text(
"I am a Text",
style: TextStyle(fontSize: 28),
),
padding: const EdgeInsets.all(10),
margin: const EdgeInsets.all(20),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.blue[500],
),
alignment: Alignment.center,
width: 200
),
);
}
}
![](https://fluttertuts.wordpress.com/wp-content/uploads/2021/05/a7fca-fluttercontainershapecircleexample.png)
More flutter tutorials
- flutter – Container shape
- flutter – Container border radius
- flutter – Container border bottom only
- flutter – Container shadow
- flutter – Stack alignment
- flutter – Stack positioned
- flutter – Stack clipBehavior
- flutter – Indeterminate LinearProgressIndicator
- flutter – LinearProgressIndicator value color
- flutter – LinearProgressIndicator rounded
- flutter – CircularProgressIndicator size
- flutter – CircularProgressIndicator color
- flutter – CircularProgressIndicator value
- flutter – How to use ToggleButtons
- flutter – How to change ToggleButtons color