An example showing how to handle common scrolling gesture conflicts in Flutter.

Overview

scroll_master

An example showing how to handle common scrolling gesture conflicts in Flutter.

中文文档请戳这里

🌍 Preview

Web demo 👉 Click Here

🐛 Problems

Case 1: NestedScrollView with pinned and stretch SliverAppBar

Problem: NestedScrollView does not support over-scrolling of external ListView, so its SliverAppBar cannot be stretched.

Related issue: https://github.com/flutter/flutter/issues/54059

Case 2: TabBarView with horizontal ListView

Problem: TabBarView does't scroll when the internal ListView is over-scrolled.

⚡️ Solutions

For case 1: NestedScrollView with pinned and stretch SliverAppBar

Override the applyUserOffset method of _NestedScrollCoordinator to allow over-scroll the top of _outerPosition.

Override the unnestOffset, nestOffset, _getMetrics methods of _NestedScrollCoordinator to fix the mapping between _innerPosition and _outerPosition to _NestedScrollPosition (Coordinator).

For more information, see:

  • lib/pages/nested_scroll_tab_list_page.dart
  • lib/widgets/nested_scroll_view_x/src/nested_scroll_view_x.dart

For case 2: TabBarView with horizontal ListView

Reference ExtendedTabBarView to implement a TabScrollView with a ScrollController bound to it.

When the internal ListView over-scrolls, the over-scroll amount is applied to the external scrollable ExtendedTabBarView.

For more information, see:

  • lib/pages/horizontal_scroll_tab_list_page.dart
  • lib/widgets/tab_bar_view_x/src/tab_scroll_view.dart

❤️ Acknowledgements

Thanks to fluttercandies's extended_tabs and extended_nested_scroll_view.

📖 References

You might also like...

Flutter Basic Sqflite Example

sqflite_demo A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Sep 5, 2021

Flutter Home Service Application Example - Day 35

Flutter Home Service Application Example - Day 35

Flutter Home Service Application Example - Day 35

Dec 23, 2022

Flutter Wallet Application Example - Day 40

Flutter Wallet Application Example - Day 40

Flutter Wallet Application Example - Day 40

Dec 23, 2022

Example of how to create scenes with Rive content in Flutter

rive-centaur Example of how to create scenes with Rive content in Flutter! no_audio_apples.mov Getting Started This project is a starting point for a

Nov 6, 2022

Flutter Google Sheets Example and Neumorphic Design

Flutter Google Sheets Example and Neumorphic Design

Flutter Google Sheets Example and Neumorphic Design Google Sheet is a web-based spreadsheet application created by Google. Google Sheet allows collabo

Jul 26, 2022

A basic demo example for integrating between Appwrite & Flutter 💙

A basic demo example for integrating between Appwrite & Flutter 💙

🔖 Todo With Flutter A simple todo app built with Flutter and Appwrite 🎬 Getting Started Appwrite is an end-to-end backend server for Web, Mobile, Na

Dec 15, 2022

Flutter password validation example - Day 29

Flutter password validation example - Day 29

Flutter Password Validation - Day 29

Dec 17, 2022

Flutter widget example.

Flutter widget example.

Flutter examples Here you can find some Flutter examples. Development Setup Clone the repository and run the following commands: flutter pub get flutt

Dec 27, 2022

Complete Flutter app example, with AsyncRedux state management

Complete Flutter app example, with AsyncRedux state management. Can also be used as a template to start a new project.

Nov 2, 2022
Owner
Life is short, make it sweet.
null
Attempt to implement better scrolling for Flutter Web and Desktop. Includes keyboard, MButton and custom mouse wheel scrolling.

An attempt to implement better scrolling for Flutter Web and Desktop. Includes keyboard, MButton and custom mouse wheel scrolling. Getting started Exa

Adrian Flutur 46 Jan 3, 2023
An Example project showing usage of drupal_linkset_menu flutter package

drupal_menu_flutter An Example project showing usage of drupal_linkset_menu flutter package Getting Started This project is a starting point for a Flu

Aqib Gatoo 4 May 11, 2021
A Flutter package which can be used to make polylines(route) from a source to a destination, and also handle a driver's realtime location (if any) on the map.

GoogleMapsWidget For Flutter A widget for flutter developers to easily integrate google maps in their apps. It can be used to make polylines from a so

Rithik Bhandari 14 Nov 30, 2022
Examples showing how to use Rid in order to build Dart/Flutter apps integrated with Rust.

Examples showing how to use Rid in order to build Dart/Flutter apps integrated with Rust.

Thorsten Lorenz 205 Dec 24, 2022
A simple recipe showing application made using Flutter , using card Views MaterialPageRoute etc.

recipes A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Akash Srivastava 1 Oct 31, 2021
Quiz app contains flutter questions only and showing result what you got.kind of mcq pattern

quiz A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

jagadeesh 2 Jan 24, 2022
A flutter musical app showing different sounds in the app

Xylophone_App_With_BuildKeyFunc A new Flutter project. A musical app showing different sounds in the app. Build key function is made in this app to si

Avinandan Bose 1 Mar 22, 2022
A musical Flutter app showing different sounds in the app

Xylophone_App A new Flutter project. A musical app showing different sounds in the app. Getting Started This project is a starting point for a Flutter

Avinandan Bose 2 Sep 9, 2022
3 different demos showing how to use bloc concurrency, before and after the Bloc 7.2.0 update.

Bloc Concurrency Demos 3 different scenarios demonstrating how to structure blocs to take advantage of concurrent event processing in Bloc 7.2/8.0. Ea

Very Good Ventures 64 Nov 30, 2022
A basic demo example for integrating between Appwrite & Flutter 💙

?? Quiz With Flutter A simple Quiz App built with Flutter and Appwrite ?? Getting Started ?? Install Appwrite Follow our simple Installation Guide to

Appwrite 35 Nov 22, 2022