Git Product home page Git Product logo

scroll-wheel-date-picker's Introduction

Scroll Wheel Date Picker

Have you been in a situation where you want to use CupertinoDatePicker but sadly you can't achieve a flat scroll view just like in android TikTok? Or maybe, you also resorted using ListWheelScrollView yet still the same?

Good news!

This package supports a wheel-type date-picker that has two scroll types: CurveScrollWheel and FlatScrollWheel.

Features

WheelDatePicker uses ListWheelScrollView for the CurveScrollWheel underneath. However, some features were added and modified in order to have the same functionality but without the curve perspective in FlatScrollWheel.

Centered Selected Item

Just like using CupertinoDatePicker or ListWheelScrollView, it allows you to select a date and expects that a particular item will always land on the center of the viewport.

Choose Center Overlay

You can choose what type of overlay you want to have on the current selected item. holo, highlight, and line are some of the overlays to choose for. If you don't want any overlays you can just set it to none. (Expect additional overlays or the option to add your own soon..)

Month Format

It allows you to select what type of month format you want to display. The available formats are full which simply means the complete name of the month, threeLetters and twoLetters basically formats the months based on their common abbreviations with the letter count.

Faded Vertical Edges

It adds fade on top and bottom to create a smooth disapearance effect when the items are beyond the viewport.

Listen On Item Changes After Animation Completed

Unlike CupertinoDatePicker, it gives you an option whether to listen to item changes only after the scroll animation ended/completed. listenAfterChanges defaults to true, otherwise, change to false to have the default functionality.

Infinite Loop

Supports looping on items. You can choose whether to enable looping on days, months or years individually.

Demo

Curve Scroll Wheel

Curve Holo Overlay Curve Highlight Overlay Curve Line Overlay

Flat Scroll Wheel

Flat Holo Overlay Flat Highlight Overlay Flat Line Overlay

Usage

Add the package to pubspec.yaml

$ flutter pub add scroll_wheel_date_picker

or

dependencies:
  scroll_wheel_date_picker: ^0.0.1

Then import the package.

import 'package:scroll_wheel_date_picker/scroll_wheel_date_picker.dart';

And use like this...

ScrollWheelDatePicker(
  theme: CurveDatePickerTheme(
    wheelPickerHeight: 200.0,
    overlay: ScrollWheelDatePickerOverlay.holo,
    itemTextStyle: defaultItemTextStyle.copyWith(color: Colors.black),
    overlayColor: Colors.black,
    overAndUnderCenterOpacity: 0.2,
  ),
)

Contributors


Ghian Tan @ Fingertips (Github)

scroll-wheel-date-picker's People

Contributors

fingertips18 avatar leonmanolo 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.