Coder Social home page Coder Social logo

fafre / clickup_fading_scroll Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clickup/clickup_fading_scroll

0.0 0.0 0.0 7.3 MB

Add a fading effect when the user can scroll.

License: Other

C++ 32.26% C 1.41% Objective-C 0.07% Kotlin 0.24% Dart 41.04% Swift 2.22% HTML 7.53% CMake 15.23%

clickup_fading_scroll's Introduction

Logo Logo

Add a fading effect when the user can scroll.

Demo

Quickstart

Add the dependency to fading_scroll to your pubspec.yaml file.

flutter pub add clickup_fading_scroll

Wrap your scrollable content in a FadingScroll widget and give the provided ScrollController to your scrollable widget.

@override
Widget build(BuildContext context) {
    return FadingScroll(
        builder: (context, controller) {
            return ListView(
                controller: controller,
                children: [
                    // ...
                ],
            ),
        },
    );
}

Usage

Customize fading size and scroll threshold

Logo Logo

You can customise the effect by providing custom scroll extents and fading sizes.

@override
Widget build(BuildContext context) {
    return FadingScroll(
        fadingSize: 100,
        scrollExtent: 120,
        builder: (context, controller) {
            return ListView(
                controller: controller,
                children: [
                    // ...
                ],
            ),
        },
    );
}

Using a different controller

You can also provide your own ScrollController to the FadingScroll. This may be useful for controller subclasses like the PageController.

class _State_ extends State<Example> {
  late final pageController = PageController();

  @override
  void dispose() {
    pageController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return FadingScroll(
      controller: pageController,
      builder: (context, controller) {
        return PageView(
          controller: pageController,
          children: [
              // ...
          ],
        );
      },
    );
  }
}

About

This package has been developped by the ClickUp mobile team for it is own needs, but feel free to participate by filing issues or submit pull-requests.

Open Sourced by ClickUp ๐Ÿ’™

ClickUp ClickUp

Saving people time by making the world more productive.

We're looking for experienced developers.

Be Part of Something Great and Join Us!

clickup_fading_scroll's People

Contributors

aloisdeniel avatar simc avatar pitriq avatar

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.