ConvexButton.fab constructor

ConvexButton.fab({
  1. Key? key,
  2. double? size,
  3. double? thickness,
  4. double? top,
  5. double? sigma,
  6. double iconSize = 32,
  7. double border = 2,
  8. Color color = Colors.redAccent,
  9. IconData icon = Icons.keyboard_voice,
  10. Color? backgroundColor,
  11. VoidCallback? onTap,
})

Make a centered convex button.

Implementation

factory ConvexButton.fab({
  Key? key,
  double? size,
  double? thickness,
  double? top,
  double? sigma,
  double iconSize = 32,
  double border = 2,
  Color color = Colors.redAccent,
  IconData icon = Icons.keyboard_voice,
  Color? backgroundColor,
  VoidCallback? onTap,
}) {
  thickness = thickness ?? _DEFAULT_THICKNESS;
  var fab = Container(
    margin: EdgeInsets.only(bottom: thickness),
    decoration: BoxDecoration(
      shape: BoxShape.circle,
      border: Border.all(color: color, width: border),
    ),
    child: Icon(icon, color: color, size: iconSize),
  );
  return ConvexButton(
    key: key,
    size: size,
    thickness: thickness,
    top: top,
    backgroundColor: backgroundColor,
    sigma: sigma,
    child: GestureDetector(onTap: onTap, child: fab),
  );
}