Skip to content

onPageChanged callback NOT working #56

Open
@divyamdhz

Description

I have this piece of code :

StoryPageView(
                itemBuilder: (context, pageIndex, storyIndex) {
                  // We can use NULL checks as if .data does NOT have any value OR
                  // If storyData is empty, such cases are handled before the code
                  // written below is executed
                  final hashMap = zoopShots.data!.storyData;
                  final hashMapList = hashMap!.values.toList();

                  var imageSrc = ApiUrls.strapiBaseUrl +
                      hashMapList[storyIndex].url.substring(1);

                  return Stack(
                    children: [
                      //  Background Color
                      Positioned.fill(
                        child: Container(
                          color: const Color(0xFFF2F6FF),
                        ),
                      ),
                      //  Main Image
                      renderContent(context, imageSrc),
                    ],
                  );
                },
                gestureItemBuilder: (context, pageIndex, storyIndex) {
                  return const SizedBox.shrink();
                },
                indicatorAnimationController: indicatorAnimationController,
                initialStoryIndex: (pageIndex) {
                  final index = widget.model?.indexToVisit ?? 0;
                  return index;
                },
                pageLength: 1,
                storyLength: (int pageIndex) {
                  return zoopShots.data!.storyData!.length;
                },
                onPageChanged: (index) {
                  log('Currently at $index');
                },
                onPageLimitReached: () => Navigator.pop(context),
              );

Doesn't matter I manually change the story OR it gets changed automatically after the timer runs out, this callback (onPageChanged ) never gets called/executed.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions