QOL: MIh WIndows ehnacement
This commit is contained in:
@@ -96,6 +96,11 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return MihPackageWindow(
|
return MihPackageWindow(
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
|
borderOn: true,
|
||||||
|
foregroundColor: MihColors.getOrangeColor(
|
||||||
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
|
backgroundColor: MihColors.getBluishPurpleColor(
|
||||||
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
windowTitle: "Test No Full",
|
windowTitle: "Test No Full",
|
||||||
menuOptions: [
|
menuOptions: [
|
||||||
SpeedDialChild(
|
SpeedDialChild(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
import 'package:mzansi_innovation_hub/main.dart';
|
import 'package:mzansi_innovation_hub/main.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||||
@@ -10,6 +11,9 @@ class MihPackageWindow extends StatefulWidget {
|
|||||||
final Widget windowBody;
|
final Widget windowBody;
|
||||||
final List<SpeedDialChild>? menuOptions;
|
final List<SpeedDialChild>? menuOptions;
|
||||||
final void Function() onWindowTapClose;
|
final void Function() onWindowTapClose;
|
||||||
|
final Color? backgroundColor;
|
||||||
|
final Color? foregroundColor;
|
||||||
|
final bool? borderOn;
|
||||||
final bool fullscreen;
|
final bool fullscreen;
|
||||||
const MihPackageWindow({
|
const MihPackageWindow({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -18,6 +22,9 @@ class MihPackageWindow extends StatefulWidget {
|
|||||||
this.menuOptions,
|
this.menuOptions,
|
||||||
required this.onWindowTapClose,
|
required this.onWindowTapClose,
|
||||||
required this.windowBody,
|
required this.windowBody,
|
||||||
|
this.borderOn,
|
||||||
|
this.backgroundColor,
|
||||||
|
this.foregroundColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -60,45 +67,22 @@ class _MihPackageWindowState extends State<MihPackageWindow> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Padding(
|
||||||
// color: Colors.white,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(25), // Optional: rounds the corners
|
|
||||||
boxShadow: const [
|
|
||||||
BoxShadow(
|
|
||||||
color: Color.fromARGB(
|
|
||||||
60, 0, 0, 0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
|
||||||
spreadRadius: -2,
|
|
||||||
blurRadius: 10,
|
|
||||||
offset: Offset(0, 5),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
top: 2.0,
|
top: 5.0,
|
||||||
left: 5.0,
|
left: 5.0,
|
||||||
),
|
),
|
||||||
child: SizedBox(
|
child: MihButton(
|
||||||
width: 40,
|
width: 40,
|
||||||
child: IconButton.filled(
|
height: 40,
|
||||||
style: ButtonStyle(
|
elevation: 10,
|
||||||
backgroundColor: WidgetStateProperty.all<Color>(
|
onPressed: widget.onWindowTapClose,
|
||||||
MihColors.getRedColor(
|
buttonColor: MihColors.getRedColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
"Dark")),
|
child: Icon(
|
||||||
),
|
Icons.close,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
iconSize: 20,
|
|
||||||
onPressed: () {
|
|
||||||
widget.onWindowTapClose();
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.close,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -112,7 +96,8 @@ class _MihPackageWindowState extends State<MihPackageWindow> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: windowTitleSize,
|
fontSize: windowTitleSize,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: widget.foregroundColor ??
|
||||||
|
MihColors.getSecondaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -122,7 +107,7 @@ class _MihPackageWindowState extends State<MihPackageWindow> {
|
|||||||
visible: (widget.menuOptions?.isNotEmpty ?? false),
|
visible: (widget.menuOptions?.isNotEmpty ?? false),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
top: 2.0,
|
top: 5.0,
|
||||||
right: 5.0,
|
right: 5.0,
|
||||||
),
|
),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
@@ -170,12 +155,17 @@ class _MihPackageWindowState extends State<MihPackageWindow> {
|
|||||||
insetAnimationDuration: Durations.short1,
|
insetAnimationDuration: Durations.short1,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: MihColors.getPrimaryColor(
|
color: widget.backgroundColor ??
|
||||||
|
MihColors.getPrimaryColor(
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
border: Border.all(
|
border: widget.borderOn == null || !widget.borderOn!
|
||||||
color: MihColors.getSecondaryColor(
|
? null
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
: Border.all(
|
||||||
|
color: widget.foregroundColor ??
|
||||||
|
MihColors.getSecondaryColor(
|
||||||
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
|
"Dark"),
|
||||||
width: 5.0),
|
width: 5.0),
|
||||||
),
|
),
|
||||||
child: widget.fullscreen
|
child: widget.fullscreen
|
||||||
|
|||||||
Reference in New Issue
Block a user