BSContainer constructor

BSContainer({
  1. Key? key,
  2. bool fluid = false,
  3. BSBreakPointLabels? maxWidthIdentifier,
  4. List<Widget> builder(
    1. BuildContext context
    )?,
  5. Key? singleChildScrollViewKey,
  6. ScrollController? singleChildScrollViewController,
  7. Clip singleChildScrollViewClipBehavior = Clip.hardEdge,
  8. EdgeInsetsGeometry? singleChildScrollViewPadding,
  9. ScrollPhysics? singleChildScrollViewPhysics,
  10. bool? singleChildScrollViewPrimary,
  11. String? singleChildScrollViewRestorationId,
  12. bool singleChildScrollViewReverse = false,
  13. Axis singleChildScrollViewScrollDirection = Axis.vertical,
  14. Key? sizedBoxKey,
  15. double? height,
  16. Key? containerKey,
  17. Alignment containerAlignment = Alignment.topCenter,
  18. double? containerHeight,
  19. double? containerWidth,
  20. EdgeInsetsGeometry? containerPadding,
  21. Clip containerClipBehavior = Clip.none,
  22. Decoration? containerDecoration,
  23. Color? containerColor,
  24. BoxConstraints? containerConstraints,
  25. Decoration? containerForegroundDecoration,
  26. EdgeInsetsGeometry? containerMargin,
  27. Matrix4? containerTransform,
  28. AlignmentGeometry? containerTransformAlignment,
  29. Key? bsContainerInheritanceKey,
  30. List<Widget>? children,
  31. Key? columnKey,
  32. VerticalDirection columnVerticalDirection = VerticalDirection.down,
  33. TextDirection? columnTextDirection,
  34. TextBaseline? columnTextBaseline,
  35. MainAxisAlignment columnMainAxisAlignment = MainAxisAlignment.start,
  36. CrossAxisAlignment columnCrossAxisAlignment = CrossAxisAlignment.center,
  37. MainAxisSize columnMainAxisSize = MainAxisSize.max,
})

Needs to be a child of a Widget that contains MediaQueryData, typically this will be a MaterialApp Acts similarly to a Bootstrap container, can be fluid - match the width of the nearest MediaQueryData parent non-fluid - a static size when the screen is xxl, xl, lg, md, sm - acts the same as fluid if smaller than sm

  • maxWidthIdentifier
    • same as non-fluid, but will never be bigger than the specified breakpoint label

Implementation

BSContainer({
  super.key,
  this.fluid = false,
  this.maxWidthIdentifier,
  this.builder,
  /*
    passed to the SingleChildScrollView
  */
  this.singleChildScrollViewKey,
  this.singleChildScrollViewController,
  this.singleChildScrollViewClipBehavior = Clip.hardEdge,
  this.singleChildScrollViewPadding,
  this.singleChildScrollViewPhysics,
  this.singleChildScrollViewPrimary,
  this.singleChildScrollViewRestorationId,
  this.singleChildScrollViewReverse = false,
  this.singleChildScrollViewScrollDirection = Axis.vertical,
  /*
    passed to the SizedBox
  */
  this.sizedBoxKey,
  this.height,
  /*
    Container
  */
  this.containerKey,
  this.containerAlignment = Alignment.topCenter,
  this.containerHeight,
  this.containerWidth,
  this.containerPadding,
  this.containerClipBehavior = Clip.none,
  this.containerDecoration,
  this.containerColor,
  this.containerConstraints,
  this.containerForegroundDecoration,
  this.containerMargin,
  this.containerTransform,
  this.containerTransformAlignment,
  /*
    BSContainerInheritance
  */
  this.bsContainerInheritanceKey,
  /*
    Column
  */
  this.children,
  this.columnKey,
  this.columnVerticalDirection = VerticalDirection.down,
  this.columnTextDirection,
  this.columnTextBaseline,
  this.columnMainAxisAlignment = MainAxisAlignment.start,
  this.columnCrossAxisAlignment = CrossAxisAlignment.center,
  this.columnMainAxisSize = MainAxisSize.max,
}) {
  // confirm not both fluid and maxWidthIdentifier
  if (fluid && maxWidthIdentifier != null) {
    throw Exception(
      "BSContainer: fluid can't be true if a maxWidthIdentifier is passed",
    );
  }
}