ResponsiveLayout class

This class helps create a responsive layout by providing different configurations for different screen sizes. */

Inheritance

Constructors

ResponsiveLayout({Key? key, int mobileCrossAxisCount = 1, double? mobileRatio = 1.8, required Widget builder(BuildContext context, int index), required int itemCount, int? largeMobileCrossAxisCount, int? tabletCrossAxisCount, int? largeTabletCrossAxisCount, int? desktopScreenCrossAxisCount, double? largeMobileRatio, double? tabletRatio, double? largeTabletRatio, double? desktopRatio, EdgeInsetsGeometry? padding, ScrollPhysics? physics, bool? shrinkWrap, bool? reverse, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, ScrollController? controller})
  • Constructor for the Responsive class
  • const

    Properties

    builder → Widget Function(BuildContext context, int index)
    widget builder with BuildContext and index of items
    final
    controller → ScrollController?
    A controller for managing the scrolling behavior of the grid view. Padding to apply to the edges of the grid view. The physics engine to use for scrolling.
    final
    desktopRatio → double?
    final
    desktopScreenCrossAxisCount → int?
    final
    hashCode → int
    The hash code for this object.
    no setterinherited
    itemCount → int
    No.of Items in gridview
    final
    key → Key?
    Controls how one widget replaces another widget in the tree.
    finalinherited
    keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior?
    final
    largeMobileCrossAxisCount → int?
    final
    largeMobileRatio → double?
    final
    largeTabletCrossAxisCount → int?
    final
    largeTabletRatio → double?
    final
    mobileCrossAxisCount → int
    The number of grid items to display in a row for mobile-sized screens, large mobile-sized screens, tablet-sized screens, desktop-sized screens,large screen-sized screens.
    final
    mobileRatio → double?
    The aspect ratio for grid items on large mobile-sized screens, tablet-sized screens, desktop-sized screens, large screen-sized screens.
    final
    padding → EdgeInsetsGeometry?
    final
    physics → ScrollPhysics?
    final
    reverse → bool?
    final
    runtimeType → Type
    A representation of the runtime type of the object.
    no setterinherited
    shrinkWrap → bool?
    final
    tabletCrossAxisCount → int?
    final
    tabletRatio → double?
    final

    Methods

    build(BuildContext context) → Widget
    Describes the part of the user interface represented by this widget.
    override
    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

    Static Methods

    isDesktop(BuildContext context) → bool
    Check if the device is a desktop. This method checks the width of the screen in the given BuildContext context and returns true if the width is greater than 1024, indicating a desktop.
    isExtraLargeScreen(BuildContext context) → bool
    Check if the device is an extra-large screen. This method checks the width of the screen in the given BuildContext context and returns true if the width is greater than 1400, indicating an extra-large screen.
    isLargeMobile(BuildContext context) → bool
    Check if the device is a large mobile device. This method checks the width of the screen in the given BuildContext context and returns true if the width is less than or equal to 700, indicating a large mobile device.
    isMobile(BuildContext context) → bool
    Check if the device is a mobile device. This method checks the width of the screen in the given BuildContext context and returns true if the width is less than or equal to 500, indicating a mobile device.
    isTablet(BuildContext context) → bool
    This method checks the width of the screen in the given BuildContext context and returns true if the width is less than 1080, indicating a tablet.