Skip to content

Conversation

@PatrickWulfe
Copy link

Previously if the widget was rebuilt, (by calling a modal bottom sheet in my case), and a scroll notification happened during that rebuild, you would receive a dirty state error. By moving the setStates to a microtask, it avoids this error.

@RichiB20
Copy link

Hi @PatrickWulfe , I tried to reproduce your scenario using the modal_bottom_sheet package. I use their example and I put the ScrollShadow above the ListView in ModalInsideModal class. In the application you find it in the "Bar Modal" example.
Trying in this way I not received any error, could you tell me if you use the ScrollShadow in another way?

My simple code is the following:

        child: ScrollShadow(
          child: ListView(
            reverse: reverse,
            // shrinkWrap: true,
            controller: PrimaryScrollController.of(context),
            physics: const BouncingScrollPhysics(),
            children: ListTile.divideTiles(
                context: context,
                tiles: List<Widget>.generate(
                  100,
                  (int index) => ListTile(
                    title: Text('Item $index'),
                    onTap: () => Navigator.of(context).push(
                      CupertinoSheetRoute<void>(
                        builder: (BuildContext context) =>
                            ModalInsideModal(reverse: reverse),
                      ),
                    ),
                  ),
                )).toList(),
          ),
        ),

Thank you

@rickypid
Copy link
Owner

rickypid commented Jan 8, 2024

Hi @PatrickWulfe,

Do you have any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants