2023-03-04 17:58:04 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2023-03-06 15:46:40 +01:00
|
|
|
class RoundIconButton extends StatelessWidget {
|
2023-03-04 17:58:04 +01:00
|
|
|
final VoidCallback onPressed;
|
2023-03-06 13:14:42 +01:00
|
|
|
final IconData iconData;
|
2023-03-04 17:58:04 +01:00
|
|
|
|
2023-03-06 15:46:40 +01:00
|
|
|
const RoundIconButton(
|
2023-03-06 13:14:42 +01:00
|
|
|
{super.key, required this.onPressed, required this.iconData});
|
2023-03-04 17:58:04 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ElevatedButton(
|
|
|
|
onPressed: onPressed,
|
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
padding: const EdgeInsets.all(20),
|
|
|
|
backgroundColor: Colors.green, // <-- Button color
|
|
|
|
foregroundColor: Colors.blue, // <-- Splash color
|
|
|
|
),
|
2023-03-05 17:33:27 +01:00
|
|
|
child: Icon(
|
2023-03-06 13:14:42 +01:00
|
|
|
iconData,
|
2023-03-05 17:33:27 +01:00
|
|
|
color: Colors.white,
|
2023-03-05 17:49:12 +01:00
|
|
|
size: MediaQuery.of(context).size.height * 0.05,
|
2023-03-05 17:33:27 +01:00
|
|
|
),
|
2023-03-04 17:58:04 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|