import 'package:flutter/material.dart'; import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:mzansi_innovation_hub/main.dart'; import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart'; class MihFloatingMenu extends StatefulWidget { final IconData? icon; final double? iconSize; final AnimatedIconData? animatedIcon; final SpeedDialDirection? direction; final List children; const MihFloatingMenu({ super.key, this.icon, this.iconSize, this.animatedIcon, this.direction, required this.children, }); @override State createState() => _MihFloatingMenuState(); } class _MihFloatingMenuState extends State { @override Widget build(BuildContext context) { return SpeedDial( key: GlobalKey(), icon: widget.icon, buttonSize: Size(widget.iconSize ?? 56.0, widget.iconSize ?? 56.0), animatedIcon: widget.animatedIcon, direction: widget.direction ?? SpeedDialDirection.up, activeIcon: Icons.close, backgroundColor: MihColors.getGreenColor( MzansiInnovationHub.of(context)!.theme.mode == "Dark"), activeBackgroundColor: MihColors.getRedColor( MzansiInnovationHub.of(context)!.theme.mode == "Dark"), foregroundColor: MihColors.getPrimaryColor( MzansiInnovationHub.of(context)!.theme.mode == "Dark"), overlayColor: Colors.black, overlayOpacity: 0.5, children: widget.children, onOpen: () => debugPrint('OPENING DIAL'), onClose: () => debugPrint('DIAL CLOSED'), ); } }