Git Product home page Git Product logo

nested_scroll_views's Introduction

Nested Scrolling Views

Flutter nested scrolling views.

NestedTabBarView.gif NestedPageView.gif NestedSingleChildScrollView.gif

Usage

Replace flutter's views with the following views and use them nested.

Flutter Nested
PageView NestedPageView
TabBarView NestedTabBarView
ListView NestedListView
GridView NestedGridView
CustomScrollView NestedCustomScrollView
SingleChildScrollView NestedSingleChildScrollView

Attention

  1. Nested non-nested views with the same scroll direction will result in weird scrolling.
  2. Nested views are kept alive by default, you can set wantKeepAlive to false, which may lead to loss of gesture events because the page is destroyed.

Thanks

  • flutter:Flutter makes it easy and fast to build beautiful apps for mobile and beyond

  • union_tabs:A nested TabBarView overscroll unites outer TabBarView scroll event

  • primary_page_view:FLutter Nested Primary PageView

nested_scroll_views's People

Contributors

hgraceb avatar benevideslecontes avatar mcpeng avatar

Stargazers

Liaohongcheng avatar  avatar Minh Bao avatar Ankit Suda avatar Alex Yackers avatar Tirth avatar Dmitry avatar Adam avatar

Watchers

 avatar

nested_scroll_views's Issues

Works fine on Android, but not as expected on iOS

Code show as below:

Column(
      children: [
        TabBar(
          tabs: [],
        ),
        NestedPageView(
          children: [
            Column(
              children: [
                TabBar(
                  tabs: [],
                ),
                NestedPageView(
                  children: [
                    GridView.count(
                      crossAxisCount: 2,
                    ),
                  ],
                )
              ],
            )
          ],
        ),
      ],
    )

Expected outcome:

The outer pageView scrolls with the inner pageView.

The actual situation:

Works fine on Android, but not as expected on iOS

NestedPageView swipes back before NestedListView reaches top of page

With a setup of:

  • NestedPageView
    → first page - not scrollable
    → second page - NestedListView

When I'm going to the second page and scroll the list view down, then scroll it back up, sometimes page view swipes back before reaching the top of the list view. Is this behaviour known/expected? Is there a way to disable it?

Flutter version: 3.7.12
Package version: 0.0.7

Ability to change current page in nested page view.

Hi, i am making an app in which, when i click on a floating action button, i want to update the current page in nested page view.
i have tried rebuilding the nested page view after replacing the current widget by using

nestedPageViewchildren[nestedPagecontroller.page!]= someOtherWidget;

But it still somehow doesn'tt change the required page.

Is it possible or am i doing something wrong?

Supporting a callback when the page changes for NestedPageView

Hi @hgraceb,

I'm very grateful for you creating this library. It helped me solve my nested PageView problems.

Would you consider supporting a callback when the page changes? (add an onPageChanging parameter or something similar.)

This would help to prevent the widget tree from becoming too deep when having to add a NotificationListener as a parent above the NestedPageView.

Upgrade to Flutter 3.16.0

Please add support for Flutter 3.16.0. Tried to do it myself in a hotfix-kinda way by just adding the axis parameter to _RenderSingleChildViewport.getOffsetToReveal, but as I've seen in #4, this process involves copying some files from the upstream flutter repo which I don't have the time to get into right now :)

Thanks!

Support Flutter 3.24.0

../../../.pub-cache/hosted/pub.dev/nested_scroll_views-0.0.11/lib/src/flutter/widgets/scrollable.dart:1397:19: Error: The type 'SelectionEventType' is not exhaustively matched by the switch cases since it doesn't match 'SelectionEventType.selectParagraph'.
 - 'SelectionEventType' is from 'package:flutter/src/rendering/selection.dart' ('/opt/homebrew/Caskroom/flutter/3.0.0/flutter/packages/flutter/lib/src/rendering/selection.dart').
Try adding a default case or cases that match 'SelectionEventType.selectParagraph'.
    switch (event.type) {

'ScrollableState' is missing implementations

Hi @hgraceb, I'm seeing the following error when trying out your library. Could you please help?

../../.pub-cache/hosted/pub.dev/nested_scroll_views-0.0.7/lib/src/flutter/widgets/scrollable.dart:367:7: Error: The non-abstract class 'ScrollableState' is missing implementations for these members:
 - ScrollContext.devicePixelRatio
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class ScrollableState extends State<Scrollable> with TickerProviderStateMixin, RestorationMixin
      ^^^^^^^^^^^^^^^
../../fvm/versions/3.12.0/packages/flutter/lib/src/widgets/scroll_context.dart:47:14: Context: 'ScrollContext.devicePixelRatio' is defined here.
  double get devicePixelRatio;
             ^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/nested_scroll_views-0.0.7/lib/src/nested/widgets/scrollable.dart:57:7: Error: The non-abstract class '_OverscrollScrollableState' is missing implementations for these members:
 - ScrollContext.devicePixelRatio
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class _OverscrollScrollableState extends ScrollableState {
      ^^^^^^^^^^^^^^^^^^^^^^^^^^
../../fvm/versions/3.12.0/packages/flutter/lib/src/widgets/scroll_context.dart:47:14: Context: 'ScrollContext.devicePixelRatio' is defined here.
  double get devicePixelRatio;
             ^^^^^^^^^^^^^^^^
Restarted application in 2,113ms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.