Mih File Structure enhancement
This commit is contained in:
47
Frontend/lib/mih_package_components/mih_floating_menu.dart
Normal file
47
Frontend/lib/mih_package_components/mih_floating_menu.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
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<SpeedDialChild> children;
|
||||
const MihFloatingMenu({
|
||||
super.key,
|
||||
this.icon,
|
||||
this.iconSize,
|
||||
this.animatedIcon,
|
||||
this.direction,
|
||||
required this.children,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihFloatingMenu> createState() => _MihFloatingMenuState();
|
||||
}
|
||||
|
||||
class _MihFloatingMenuState extends State<MihFloatingMenu> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SpeedDial(
|
||||
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'),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user