Horizontal_calendar - Horizontal week view calendar pub for Flutter.

Overview

horizontal_calendar

Build Status codecov SoluteLabs Twitter Follow

Easy to use, highly customizable horizontal calendar.

Features

  • Custom date range (First & Last Date)
  • Single or up to x days selection
  • onDateSelected, onDateUnSelected, onDateLongTap, onMaxDateSelectionReached events.
  • Support custom ScrollController
  • Initial selected dates
  • Granular control to disable dates.
  • Internationalization support
  • Month / Date / Week Day label order customization
  • Month / Week day label hide / show
  • Custom TextStyles for Month, Date, WeekDay
  • Custom TextStyles for selected Month, selected Date, selected WeekDay
  • Customizable month format (e.g. MM,MMM)
  • Customizable date format (e.g. dd,d)
  • Customizable week day format (e.g. EE,EEE)
  • Default date cell Decoration
  • Selected date cell Decoration
  • Disabled date cell Decoration

Properties

Property Name Property Type Description Default value
height double Height of widget 100
firstDate DateTime First Date of calendar -
lastDate DateTime Last Date of calendar -
minSelectedDateCount int Count of min selectable dates 0
maxSelectedDateCount int Count of max selectable dates 1
onDateSelected Function(DateTime dateTime) Callback when date is selected -
onDateLongTap Function(DateTime dateTime) Callback when date cell is long pressed -
onDateUnSelected Function(DateTime dateTime) Callback when date is unselected -
onMaxDateSelectionReached VoidCallback Callback when max date selection count is reached -
initialSelectedDates List<DateTime> List of initially selected dates Empty List
isDateDisabled bool Function(DateTime dateTime) Function that returns bool to check if particular date is disabled -
labelOrder List<LabelType> Order of labels [ LabelType.month, LabelType.date, LabelType.weekday]
scrollController ScrollController Scroll Controller of horizontal list -
monthTextStyle TextStyle Month label TextStyle titleTheme
selectedMonthTextStyle TextStyle Selected Month label TextStyle monthTextStyle
monthFormat String Format of month MMM
dateTextStyle TextStyle Date label TextStyle subTitleTheme
selectedDateTextStyle TextStyle Selected Date label TextStyle dateTextStyle
dateFormat String Format of date dd
weekDayTextStyle TextStyle Week day label TextStyle subTitleTheme
selectedWeekDayTextStyle TextStyle Selected Week day label TextStyle dateTextStyle
weekDayFormat String Format of week day EEE
defaultDecoration Decoration Default Decoration to be applied to date cell -
selectedDecoration Decoration Decoration to be applied to selected date cell -
disabledDecoration Decoration Decoration to be applied to disabled date cell -
spacingBetweenDates double Spacing between two cells of date 8.0
padding EdgeInsetsGeometry Padding to date cell EdgeInsets.all(8.0)

State Management in horizontal_calendar

initialSelectedDates will only be taken when the widget built for the first time. horizontal_calendar will manage the Subsequent dates selection and un selection.

To get the initial control over the host app, one can pass the UniqueKey.

e.g.

    HorizontalCalendar(
      key: UniqueKey(),
    );

Issues and Feedback

  • For any issue and feedback please create issue on Github repo.
Comments
  • feat: add minSelectedDateCount

    feat: add minSelectedDateCount

    Added

    • New attribute for HorizontalCalendar to set minSelection
    • Validation for HorizontalCalendar parameters
    • New Widget for example: CustomRangeSlider

    Refactor

    • Example
      • Using CustomRangeSlider you can select min and max selected date count. Once you want to set the new interval you have to tap on the "update" button and the widget is rebuilt with the new settings. If the setting can't be applied (range is too high for the available dates) a Snackbar is shown
      • General minor changes to optmize code indentation and remove some ambiguity (eg subtract(365) instead of add(-365) or DateTime.sunday instead of 7)
    opened by dariof28 2
  • Add minSelectedDateCount parameter

    Add minSelectedDateCount parameter

    Hi, and thanks for this beautiful widget.

    I wanna ask you if could you add an optional minSelectedDateCount parameter to avoid the no-selected-dates situations (this would be useful in such situations where a selected date is always required, for example retrieve a list of items that mathes that day).

    Right now I am able to initialize the initialSelectedDates but without this optional setting i am able to remove it by tapping on the element.

    Tip:

    @@ -149,1 +149,1 @@
    -} else {
    +} else if (selectedDates.lenght > widget.minSelectedDateCount ) {
      final isRemoved = selectedDates.remove(date);
      if (isRemoved && widget.onDateUnSelected != null) {
        widget.onDateUnSelected(date);
      }
    }
    

    Of course some validation should be added:

    assert(maxSelectedDateCount >= minSelectedDateCount);
    assert(initialSelectedDates.lenght >= minSelectedDateCount);
    [...]
    
    enhancement 
    opened by dariof28 2
  • I don't understand how update Internationalization 🤷‍♂️

    I don't understand how update Internationalization 🤷‍♂️

    Hi 👋, First of all, thank you for your widget. It's exactly what I need. I'm just stuck on the local date. My settings language device are set to French and my Region too.

    I use Locale myLocale = Localizations.localeOf(context); print(myLocale);to check the value. Everything look like ok, but the date format don't change.

    Have you any ideas ?

    opened by Smartiiez 1
  • feat: add the ability to show month and dayOfWeek labels in uppercase

    feat: add the ability to show month and dayOfWeek labels in uppercase

    In some layout situations the user could want to show the labels in uppercase. If no value for isLabelUppercase is given the label is shown in its original form

    uppercase

    opened by dariof28 1
  • [URGENT] fix: remove intl constraint

    [URGENT] fix: remove intl constraint

    The package cannot be installed anymore because of intl version conflict. This error is reported on pub.dev too -> https://pub.dev/packages/horizontal_calendar_widget/score

    Because horizontal_calendar_widget depends on flutter_localizations any from sdk which depends on intl 0.17.0, intl 0.17.0 is required. So, because horizontal_calendar_widget depends on intl ^0.16.1, version solving failed.

    flutter_localizations already include intl dependency so is not necessary to add a direct dependency with version constraint

    opened by dariof28 1
  • Internationalization

    Internationalization

    This is not working: initializeDateFormatting("sl").then((_) => runApp(MyApp()));

    @milind-mevada-stl Can you tell what is the correct way to setup localization?

    opened by danilof 0
Releases(v1.0.2)
  • v1.0.2(Jun 9, 2020)

  • v1.0.1(Jun 9, 2020)

  • v1.0.0+1(Jun 9, 2020)

    • [x] Custom date range (First & Last Date)
    • [x] Single or up to x days selection
    • [x] onDateSelected, onDateUnSelected, onDateLongTap, onMaxDateSelectionReached events.
    • [x] Support custom ScrollController
    • [x] Initial selected dates
    • [x] Granular control to disable dates.
    • [x] Internationalization support
    • [x] Month / Date / Week Day label order customization
    • [x] Month / Week day label hide / show
    • [x] Custom TextStyles for Month, Date, WeekDay
    • [x] Custom TextStyles for selected Month, selected Date, selected WeekDay
    • [x] Customizable month format (e.g. MM,MMM)
    • [x] Customizable date format (e.g. dd,d)
    • [x] Customizable week day format (e.g. EE,EEE)
    • [x] Default date cell Decoration
    • [x] Selected date cell Decoration
    • [x] Disabled date cell Decoration
    Source code(tar.gz)
    Source code(zip)
Owner
SoluteLabs
An experienced, high-performance team having produced Top #10 apps with Millions of users; We have launched over 100 scalable, production-ready apps
SoluteLabs
A widget to provides horizontal or vertical multiple split view for Flutter.

Multi split view A widget to provides horizontal or vertical multiple split view for Flutter. Horizontal or vertical Configurable weight or size for e

Carlos Eduardo Leite de Andrade 63 Dec 28, 2022
A Flutter Widget that create a horizontal table with fixed column on left hand side.

horizontal_data_table A Flutter Widget that create a horizontal table with fixed column on left hand side. Installation This package is starting to su

May Lau 204 Dec 27, 2022
A flutter horizontal date picker that always shift the selected date to center.

horizontal_center_date_picker A flutter widget provides a horizontal date picker and always aligns selected date in center of the widget. Usage This s

May Lau 5 Jul 2, 2022
Flutter widget form select a date in horizontal timeline with customizable styles.

Flutter widget form select a date in horizontal timeline with customizable styles. Getting Started You can use this package when you need to add a dat

Jose Manuel Márquez 158 Dec 2, 2022
A dart package to display a horizontal bar of customisable toggle tabs. Supports iOS and Android.

toggle_bar A dart package to display a horizontal bar of customisable toggle tabs. Supports iOS and Android. Installation Depend on it. dependencies:

Prem Adithya 9 Jul 13, 2022
A simple Flutter widget library that helps us to select days in a week.

A simple Flutter widget library that helps us to select days in a week.

Shan Shaji 4 Oct 9, 2022
📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget.

?? Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.

Blue Fire 1.7k Jan 7, 2023
Flutter ScrollView Observer - a library of widget that can be used to listen for child widgets those are being displayed in the scroll view

Flutter ScrollView Observer - a library of widget that can be used to listen for child widgets those are being displayed in the scroll view

林洵锋 67 Jan 6, 2023
A Flutter widget which synchronize a ScrollView and a custom tab view

scrollable_list_tabview A Flutter widget which synchronize a ScrollView and a custom tab view. The main idea is to create a custom tab view synchroniz

Aswanath C K 0 Apr 12, 2022
Similar to Weibo dynamics, WeChat circle of friends, nine grid view controls to display pictures. Support single big picture preview.

Similar to Weibo dynamics, WeChat circle of friends, nine grid view controls to display pictures. Support single big picture preview.

Flutter中国开源项目 296 Dec 28, 2022
NestedScrollView: extended nested scroll view to fix following issues.

NestedScrollView: extended nested scroll view to fix following issues.

FlutterCandies 457 Jan 4, 2023
A widget with side-by-side source code view.

A widget with side-by-side source code view. Extracted from the flutter-catalog open-source app.

xwei 23 Aug 29, 2022
PowerFileView - A powerful file view widget, support a variety of file types, such as Doc Eexcl PPT TXT PDF and so on, Android is implemented by Tencent X5, iOS is implemented by WKWebView.

PowerFileView - A powerful file view widget, support a variety of file types, such as Doc Eexcl PPT TXT PDF and so on, Android is implemented by Tencent X5, iOS is implemented by WKWebView.

Yao 8 Oct 22, 2022
Flutter package: Assorted layout widgets that boldly go where no native Flutter widgets have gone before.

assorted_layout_widgets I will slowly but surely add interesting widgets, classes and methods to this package. Despite the package name, they are not

Marcelo Glasberg 122 Dec 22, 2022
Flutter Carousel Pro - A Flutter Carousel widget

Carousel Extended A Flutter Carousel widget. Usage As simple as using any flutter Widget. Based on Carousel Pro but extended to be able to navigate be

omid habibi 3 Dec 7, 2020
Flutter-useful-widgets - Flutter Useful Widgets

useful_widgets This package makes it easy to build apps by providing a list of simple and useful widgets. import 'package:useful_widgets/useful_widget

Ricardo Crescenti 6 Jun 20, 2022
Flutter Duration Button - Create auto-click button likes Netflix's Skip Intro button in Flutter

Flutter Duration Button - Create auto-click button likes Netflix's Skip Intro button in Flutter

Kim Seung Hwan 7 Dec 7, 2022
Various Flutter widgets that are developed by Google but not by the core Flutter team

Flutter widgets This repository contains the source code for various Flutter widgets that are developed by Google but not by the core Flutter team. Is

Google 1.1k Jan 7, 2023
🟥 A flutter widget that flashes when flutter fails to render a frame in a certain timeframe

?? A flutter widget that flashes when flutter fails to render a frame in a certain timeframe

Andrei Lesnitsky 32 Oct 8, 2022