DART
circular elevated button flutter
//circular elevated button
ElevatedButton(
style: ElevatedButton.styleFrom(
shape: const CircleBorder(),
),
onPressed: () {},
child: const Icon(Icons.refresh),
),
circular elevated button flutter
style: ElevatedButton.styleFrom(
shape: CircleBorder(),
),
circular button in flutter
Container(
width: 90,
height: 90,
child: RaisedButton(onPressed: (){
},
color: Colors.deepOrange,
textColor: Colors.white,
shape: CircleBorder(side: BorderSide.none),
child: Text('Login',style: TextStyle(
fontSize: 20.0
),
),
),
)
how to make a circular button shape in flutter
// 1
ElevatedButton(
child: const Text(
'Button',
style: TextStyle(fontSize: 24),
),
onPressed: () {},
style: ElevatedButton.styleFrom(
fixedSize: const Size(200, 200)
shape: const CircleBorder(),
),
),
// 2
MaterialButton(
color: Colors.blue,
shape: const CircleBorder(),
onPressed: () {},
child: const Padding(
padding: EdgeInsets.all(100),
child: Text(
'A circle button',
style: TextStyle(color: Colors.white, fontSize: 24),
),
),
),
// 3
GestureDetector(
onTap: () {
print('Button tapped');
},
child: const CircleAvatar(
radius: 100,
backgroundColor: Colors.indigo,
child: Text(
'A Button',
style: TextStyle(fontSize: 30),
),
)),
// 4
ElevatedButton(
style: ElevatedButton.styleFrom(
shape: const CircleBorder(), primary: Colors.red),
child: Container(
width: 200,
height: 200,
alignment: Alignment.center,
decoration: const BoxDecoration(shape: BoxShape.circle),
child: const Text(
'I am a button',
style: TextStyle(fontSize: 24),
),
),
onPressed: () {},
),
// 5
ClipRRect(
borderRadius: BorderRadius.circular(120),
child: SizedBox(
width: 240,
height: 240,
child: ElevatedButton.icon(
icon: const Icon(
Icons.camera,
size: 40,
),
label: const Text(
'Camera',
style: TextStyle(fontSize: 25),
),
onPressed: () {},
),
),
),
how to make a circular button shape in flutter
// 1
ElevatedButton(
child: const Text(
'Button',
style: TextStyle(fontSize: 24),
),
onPressed: () {},
style: ElevatedButton.styleFrom(
fixedSize: const Size(200, 200)
shape: const CircleBorder(),
),
),
// 2
MaterialButton(
color: Colors.blue,
shape: const CircleBorder(),
onPressed: () {},
child: const Padding(
padding: EdgeInsets.all(100),
child: Text(
'A circle button',
style: TextStyle(color: Colors.white, fontSize: 24),
),
),
),
// 3
GestureDetector(
onTap: () {
print('Button tapped');
},
child: const CircleAvatar(
radius: 100,
backgroundColor: Colors.indigo,
child: Text(
'A Button',
style: TextStyle(fontSize: 30),
),
)),
// 4
ElevatedButton(
style: ElevatedButton.styleFrom(
shape: const CircleBorder(), primary: Colors.red),
child: Container(
width: 200,
height: 200,
alignment: Alignment.center,
decoration: const BoxDecoration(shape: BoxShape.circle),
child: const Text(
'I am a button',
style: TextStyle(fontSize: 24),
),
),
onPressed: () {},
),
// 5
ClipRRect(
borderRadius: BorderRadius.circular(120),
child: SizedBox(
width: 240,
height: 240,
child: ElevatedButton.icon(
icon: const Icon(
Icons.camera,
size: 40,
),
label: const Text(
'Camera',
style: TextStyle(fontSize: 25),
),
onPressed: () {},
),
),
),