stretchbox 1.1.0 copy "stretchbox: ^1.1.0" to clipboard
stretchbox: ^1.1.0 copied to clipboard

outdated

Flutter Widget ,Support normal and expand two mode

pub package

stretchbox #

An stretchbox widget for expand sub widgets.

Usage #

stretchbox Basic usage:

Widget buildColumnStretchedBoxWidget() {
  return ColumnStretchedBoxWidget(
    arrowImageRes: 'images/image_down_expand.png',// arrow image resource
    arrowContainerColor: Colors.white,// arrow image area bg color
//      stretchState: StretchedBoxState.normal,// normal default
    normalChild: Container(// area show always
      color: Colors.white,
      child: Column(
        children: normalList,
      ),
    ),
    expandChild: Container(// area show by expand
      color: Colors.black12,
      child: Column(
        children: [...normalList, ...expandList],
      ),
    ),
  );
}

stretchbox Custom usage:

Widget buildColumnStretchedBoxWidget() {
  return ColumnStretchedBoxWidget(
    ...
    bottomBarWidget: _buildCustomBottomWidget,// bottom widget custom set
  );
}

allow bottom widget custom set.

Widget _buildCustomBottomWidget(
    BuildContext context, StretchedBoxViewModel stretchedBoxViewModel) {
  Widget text;
  if (stretchedBoxViewModel?.isExpand() ?? false) {
      text = Text("Click Collapse");
  } else {
      text = Text("Click Expand");
  }

  return GestureDetector(
    behavior: HitTestBehavior.opaque,
    onTap: () {
      stretchedBoxViewModel?.switchStretchMode();
    },
    child: Container(
      height: 32,
      width: double.infinity,
      color: Colors.deepPurpleAccent,
      child: Center(
        child: text,
      ),
    ),
  );
}

screenshot: #

see the example.

idea #

1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Flutter Widget ,Support normal and expand two mode

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, provider

More

Packages that depend on stretchbox