Limbou / expandable_page_view

MIT License
88 stars 36 forks source link

ExpandedablePageView and ClampingScrollPhysics #37

Closed QianNangong closed 2 years ago

QianNangong commented 2 years ago

When I use ExpandedablePageView and set physics as ClampingScrollPhysics(Android target default behavior), it will trigger an assert.

'package:flutter/src/widgets/overscroll_indicator.dart': Failed assertion: line 243 pos 14: 'notification.metrics.axis == widget

But if I change physics to BouncingScrollPhysics, it will no longer assert.

Codes here

showModalBottomSheet(
  context: context,
  isScrollControlled: true,
  builder: (context) => ListView(
    shrinkWrap: true,
    children: [
      ...,
      Container(
        padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
        color: const Color(0xFFF5F5F5),
        child: Column(
          children: [
            ...,
            ExpandablePageView.builder(
              itemCount: ...,
              physics: const ClampingScrollPhysics(),
              onPageChanged: ...,
              itemBuilder: (context, pageIndex) => GridView.builder(
                gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
                  crossAxisCount: 2,
                  crossAxisSpacing: 5,
                  mainAxisSpacing: 9,
                  mainAxisExtent: 40,
                ),
                itemCount: ...,
                itemBuilder: ...,
              ),
            ),
          ],
        ),
      ),
    ],
  ),
);
Limbou commented 2 years ago

Hi @QianNangong Thank you for opening this issue. I was not able to reproduce that problem with the code you provided due to some other errors related to unbounded height. Could you provide a simple, minimal reproducible example?

Limbou commented 2 years ago

Closing it for now due to lack of activity.