childTopBottomHostedControls method

Widget childTopBottomHostedControls(
  1. BuildContext context,
  2. Widget main, {
  3. Widget? bottomControls,
  4. Widget? topControls,
  5. double topHeight = 0.0,
})

Create a widget that has the bottomControls and topControls permenantly affixed above/below the main widget.

Implementation

Widget childTopBottomHostedControls(BuildContext context, Widget main, {
  Widget? bottomControls,
  Widget? topControls,
  double topHeight = 0.0
}) {
  final stackChildren = column();


  stackChildren.add(Positioned(
    key: keyForWID(AFUIWidgetID.positionedCenterHosted),
    top: topHeight, left: 0, bottom: 0, right: 0,
    child: main));

  if(topControls != null) {
    stackChildren.add(Positioned(
      key: keyForWID(AFUIWidgetID.positionedTopHosted),
      top: 0, left:0, right: 0,
      child: topControls
    ));
  }

  if(bottomControls != null) {
    stackChildren.add(Positioned(
      key: keyForWID(AFUIWidgetID.positionedBottomHosted),
      left: 0, right: 0, bottom: 0,
      child: bottomControls
    ));
  }
  return Container(
    key: keyForWID(AFUIWidgetID.contHostedControls),
    child: Stack(children: stackChildren));
}