Home > Mobile >  how to make widget scale up when it selected in Flutter
how to make widget scale up when it selected in Flutter

Time:06-18

I have an app that has pageView.builder and it contains 5 stack widget

how can I scale up the widget that user-selected, for example:

if the user scrolls to widget 3, widgets 1 & 2 become smaller than widget 3, and the same if he scrolls to widget 5 or 2

( the middle will become bigger than the widget on both sides)

my code :

    Widget build(BuildContext context) {
    // ignore: sized_box_for_whitespace
    return Container(
      height: 320,
      child: PageView.builder(
          controller: pageController,
          itemCount: 5,
          itemBuilder: (context, position) {
            return _bulidPageItem(position);
          }),
    );
  }

  Widget _bulidPageItem(int index) {

//------------------------------------------------------------------------------
// Slide image            
  • Related