GithubHelp home page GithubHelp logo

farhan568 / paged_vertical_calendar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from casvanluijtelaar/paged_vertical_calendar

0.0 0.0 0.0 43.44 MB

A simple paginated framework for implementing calendar based interfaces.

License: Apache License 2.0

Objective-C 0.10% Kotlin 0.33% Dart 88.28% Swift 1.07% HTML 10.22%

paged_vertical_calendar's Introduction

๐Ÿ“† Paged Vertical Calendar ๐Ÿ“†

Pub Pub Pub

A simple paginated framework for implementing calendar based interfaces.

gif showing of package customizability gif showing dat range picker example gif showing paged data example

๐Ÿ”จ How it works

paged_vertical_calendar is a very minimalistic framework that automatically loads months based on scoll behavior. It provides many useful callbacks to implement your own calendar interactions and builders to customize the calendar as much as you want. Check the example for several implementations like date range selection and paginated data visualisation.

PagedVerticalCalendar has no required parameters and can be dropped in anywhere providing it has a fixed height.

Scaffold(
  body: PagedVerticalCalendar(),
);

๐Ÿ“ข functionality

Several callback are provided to facilitate easy implementation of any calendar interactions

PagedVerticalCalendar(
  minDate: DateTime.now().subtract(Duration(days 365)),
  maxDate: DateTime.now().add(Duration(days 365)),
  initialDate: DateTime.now().add(Duration(days 3)),
  invisibleMonthsThreshold: 1,
  startWeekWithSunday: true,
  onMonthLoaded: (year, month) {
    // on month widget load 
  },
  onDayPressed: (value) {
    // on day widget pressed   
  },
  onPaginationCompleted: (direction) {
    // on pagination completion
  },
);
  • onMonthLoaded is a callback that fires for every month added to the list. When this function fires can be altered by setting the invisibleMonthsThreshold pararamter.

  • invisibleMonthsThreshold decides how many months outside of the widgets view should be loaded. In other words, how many months should be preloaded before the user reaches that scroll position. It defaults to 1.

  • onDayPressed Is a simple onPressed callback but also provides the DateTime of the day that has been pressed.

  • If your app is localized for countries where the week starts on Sunday, you can flip startWeekWithSundayto true.

  • If a minDate is provided the calendar will stop scrolling up at that date. make sure minDate < maxDate.

  • If a maxDate is provided the calendar will stop scrolling down at that date. make sure maxDate > minDate.

  • If an initialDate is provided the calendar start by displaying this date (otherwise DateTime.now()). make sure minDate < initialData < maxDate.

  • Finally when a minDate or maxDate is provided to the PagedVerticalCalendar, the onPaginationCompleted callback can be used. it will return a PaginationDirection to indicate what side of the calendar has been reached.

๐ŸŽจ Customization

PagedVerticalCalendar provides default calendar styling, but these can be fully customized. To do so, several builders are provided:

PagedVerticalCalendar(
  monthBuilder: (context, month, year) {
    // provide a month header widget
  },
  dayBuilder: (context, date) {
    // provide a day widget
  },
  listPadding: // provide EdgeInset value
);
  • monthBuilder provides the year and month as integers. this builder has to return a widget that will form the header of ever month. the intl package works well here for date formatting.

  • dayBuilder provides the day as a DateTime. this builder wil be called for every day. You usually want to provide at least a text widget with the current day number.

  • listPadding can be provided in case you need the list to have padding.

๐Ÿ‘‹ Get Involved

If this package is useful to you please ๐Ÿ‘ on pub.dev and โญ on github. If you have any Issues, recommendations or pull requests I'd love to see them!

paged_vertical_calendar's People

Contributors

casvanluijtelaar avatar desmeit avatar g123k avatar dmitry-kotorov avatar martinrost avatar jackthebeast avatar snorlax8 avatar westracer avatar bikram-shrestha 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.