Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExprollablePageController.jumpViewportOffsetTo doesn't work #26

Closed
khoadng opened this issue May 4, 2023 · 1 comment
Closed

ExprollablePageController.jumpViewportOffsetTo doesn't work #26

khoadng opened this issue May 4, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@khoadng
Copy link
Contributor

khoadng commented May 4, 2023

import 'package:example/src/common.dart';
import 'package:exprollable_page_view/exprollable_page_view.dart';
import 'package:flutter/material.dart';

class SimpleExample extends StatefulWidget {
  const SimpleExample({super.key});

  @override
  State<SimpleExample> createState() => _SimpleExampleState();
}

class _SimpleExampleState extends State<SimpleExample> {
  late final controller = ExprollablePageController(
    initialPage: 0,
    maxViewportOffset: ViewportOffset.shrunk,
    minViewportFraction: 0.8,
    snapViewportOffsets: [
      ViewportOffset.expanded,
      ViewportOffset.shrunk,
    ],
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        actions: [
          IconButton(
              onPressed: () =>
                  controller.jumpViewportOffsetTo(ViewportOffset.expanded),
              icon: Icon(Icons.keyboard_double_arrow_down))
        ],
      ),
      bottomNavigationBar: const ExampleBottomAppBar(),
      body: ExprollablePageView(
        controller: controller,
        itemCount: 5,
        itemBuilder: (context, page) {
          return ExampleListView(
            controller: PageContentScrollController.of(context),
            page: page,
          );
        },
      ),
    );
  }
}
@fujidaiti
Copy link
Owner

I can't believe I didn't notice such a serious bug... thanks.

@fujidaiti fujidaiti self-assigned this May 5, 2023
@fujidaiti fujidaiti added the bug Something isn't working label May 5, 2023
This was referenced May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants