MihPackageWindow class
A versatile window container used for dialogs or sub-sections.
MihPackageWindow provides a standardized "windowed" UI that can toggle between fullscreen and modal dialog modes.
Features:
- Adaptive Layout: Automatically adjusts padding and title size based on screen dimensions (Mobile vs. Desktop/Tablet).
- Integrated Actions: If menuOptions is provided, a MihFloatingMenu is automatically added to the window.
- Scroll Management: Wraps content in MihSingleChildScroll if scrollbarOn is enabled.
- Close Logic: Provides a consistent header with a back/close button that triggers onWindowTapClose.
Example (Modal Dialog):
MihPackageWindow(
fullscreen: false,
windowTitle: "Settings",
onWindowTapClose: () => Navigator.pop(context),
windowBody: MySettingsWidget(),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MihPackageWindow
Constructors
Properties
- backgroundColor → Color?
-
The background color of the window. Defaults to MihColors.primary.
final
- borderOn → bool?
-
Whether to display a colored border around the window.
final
- darkMode → bool?
-
Whether to use Dark Mode styling.
final
- foregroundColor → Color?
-
The color used for headers and primary text. Defaults to MihColors.secondary.
final
- fullscreen → bool
-
If true, the window takes up the full screen.
If false, it renders as a centered modal box.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
Optional actions to display via a floating menu button.
final
- onWindowTapClose → void Function()?
-
Callback triggered when the close/back button in the header is pressed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollbarOn → bool?
-
Whether to show a scrollbar for the windowBody.
final
- windowBody → Widget
-
The main content widget to display inside the window.
final
- windowTitle → String?
-
The text displayed in the window's header.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MihPackageWindow> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited