Mih File Structure enhancement

This commit is contained in:
2025-11-18 12:42:22 +02:00
parent f5c05d7431
commit b69a52a5a8
294 changed files with 2782 additions and 4473 deletions

View File

@@ -0,0 +1,52 @@
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class MihPackageTools extends StatefulWidget {
final Map<Widget, void Function()?> tools;
int selcetedIndex;
MihPackageTools({
super.key,
required this.tools,
required this.selcetedIndex,
});
@override
State<MihPackageTools> createState() => _MihPackageToolsState();
}
class _MihPackageToolsState extends State<MihPackageTools> {
List<Widget> getTools() {
List<Widget> temp = [];
int index = 0;
widget.tools.forEach((icon, onTap) {
temp.add(
Visibility(
visible: widget.selcetedIndex != index,
child: IconButton(
onPressed: onTap,
icon: icon,
),
),
);
temp.add(
Visibility(
visible: widget.selcetedIndex == index,
child: IconButton.filled(
onPressed: onTap,
icon: icon,
),
),
);
index += 1;
});
return temp;
}
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.end,
children: getTools(),
);
}
}