FlutstrapVisibility class

Flutstrap Visibility Component

Shows or hides content based on breakpoint conditions. Uses efficient breakpoint detection with minimal rebuilds.

Inheritance

Constructors

FlutstrapVisibility({Key? key, required Widget child, bool showOnXs = true, bool showOnSm = true, bool showOnMd = true, bool showOnLg = true, bool showOnXl = true, bool showOnXxl = true, Widget? fallback})
const
FlutstrapVisibility.desktopOnly({required Widget child, Widget? fallback})
Shows the child only on desktop screens (lg, xl, and xxl breakpoints) Hides on mobile and tablet screens
factory
FlutstrapVisibility.hideOnDesktop({required Widget child, Widget? fallback})
Hides the child on desktop screens (lg, xl, and xxl breakpoints) Shows on mobile and tablet screens
factory
FlutstrapVisibility.hideOnMobile({required Widget child, Widget? fallback})
Hides the child on mobile screens (xs and sm breakpoints) Shows on tablet and desktop screens
factory
FlutstrapVisibility.hideOnSm({required Widget child, Widget? fallback})
Hides the child on small screens (sm breakpoint) Shows on all other screen sizes
factory
FlutstrapVisibility.hideOnXs({required Widget child, Widget? fallback})
Hides the child on extra small screens (xs breakpoint) Shows on all other screen sizes
factory
FlutstrapVisibility.lgOnly({required Widget child, Widget? fallback})
Shows the child only on large screens (small desktops) Hides on all other screen sizes
factory
FlutstrapVisibility.mdOnly({required Widget child, Widget? fallback})
Shows the child only on medium screens (tablets) Hides on all other screen sizes
factory
FlutstrapVisibility.mobileOnly({required Widget child, Widget? fallback})
Shows the child only on mobile screens (xs and sm breakpoints) Hides on tablet and desktop screens
factory
FlutstrapVisibility.smOnly({required Widget child, Widget? fallback})
Shows the child only on small screens (mobile phones in landscape) Hides on all other screen sizes
factory
FlutstrapVisibility.tabletOnly({required Widget child, Widget? fallback})
Shows the child only on tablet screens (md breakpoint) Hides on mobile and desktop screens
factory
FlutstrapVisibility.xlOnly({required Widget child, Widget? fallback})
Shows the child only on extra large screens (medium desktops) Hides on all other screen sizes
factory
FlutstrapVisibility.xsOnly({required Widget child, Widget? fallback})
Shows the child only on extra small screens (mobile phones in portrait) Hides on all other screen sizes
factory
FlutstrapVisibility.xxlOnly({required Widget child, Widget? fallback})
Shows the child only on double extra large screens (large desktops) Hides on all other screen sizes
factory

Properties

child Widget
final
fallback Widget?
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showOnLg bool
final
showOnMd bool
final
showOnSm bool
final
showOnXl bool
final
showOnXs bool
final
showOnXxl bool
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
copyWith({Key? key, Widget? child, bool? showOnXs, bool? showOnSm, bool? showOnMd, bool? showOnLg, bool? showOnXl, bool? showOnXxl, Widget? fallback}) FlutstrapVisibility
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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