some_calendar 1.2.6

Flutter Android iOS web

Custom calendar (multi select, single select, date range) for Flutter

some calendar #

pub package License support

Awesome Flutter

Custom calendar with Multi-select & range configurable calendar

New Features #

  • Added View Mode Somecalendar #15

Help Maintenance #

I've taken the time to make this library, help support to develop it or buy me coffee and snacks to be even more enthusiastic <br/> Buy Me A Coffee Paypal

Gif Somecalendar (Dialog) #


Multi

Range

Single

Requirements to run the demo #

Setup #

Add dependency to your pubspec.yaml:

some_calendar: ^{latest_version}

Basic use #

First, add an import to your code:

import 'package:some_calendar/some_calendar.dart';

Setting Locale #

First, add an import to your code:

import 'package:intl/intl.dart';
import 'package:intl/date_symbol_data_local.dart';

  @override
  void initState() {
    initializeDateFormatting();
    Intl.systemLocale = 'en_En'; // to change the calendar format based on localization
    super.initState();
  }

with dialog #

Single Mode, add to your code:

    showDialog(
        context: context,
        builder: (_) => SomeCalendar(
          mode: SomeMode.Single,
          isWithoutDialog: false,
          selectedDate: selectedDate,
          labels: new Labels(
              dialogDone: 'Selesai',
              dialogCancel: 'Batal',
              dialogRangeFirstDate: 'Tanggal Pertama',
              dialogRangeLastDate: 'Tanggal Terakhir',
          ),
          startDate: Jiffy().subtract(years: 3),
          lastDate: Jiffy().add(months: 9),
          done: (date) {
            setState(() {
              selectedDate = date;
              showSnackbar(selectedDate.toString());
            });
          },
        ));

Multi Mode, add to your code:

    showDialog(
        context: context,
        builder: (_) => SomeCalendar(
          mode: SomeMode.Multi,
          startDate: Jiffy().subtract(years: 3),
          lastDate: Jiffy().add(months: 9),
          isWithoutDialog: false,
          selectedDates: selectedDates,
          viewMode: ViewMode.Edit,
          done: (date) {
            setState(() {
              selectedDates = date;
              showSnackbar(selectedDates.toString());
            });
          },
        ));

Range Mode, add to your code:

    showDialog(
        context: context,
        builder: (_) => SomeCalendar(
          mode: SomeMode.Range,
          startDate: Jiffy().subtract(years: 3),
          lastDate: Jiffy().add(months: 9),
          selectedDates: selectedDates,
          isWithoutDialog: false,
          viewMode: ViewMode.Edit,
          primaryColor: Colors.red,
          done: (date) {
            setState(() {
              selectedDates = date;
              showSnackbar(selectedDates.toString());
            });
          },
        ));

SomeMode #

SomeMode
Range
Single
Multi

Parameters #

parametertypesdefaultValues
primaryColorcolorColor(0xff365535)
textColorcolorColors.black
selectedDateDateDate.now()
selectedDatesDate[]Date.now() + 4 days
isWithoutDialogbooltrue
scrollDirectionAxisAxis.vertical
startDateDate
lastDateDate
modeSomeMode
viewModeViewModeViewMode.Edit
28
likes
90
pub points
83%
popularity

Custom calendar (multi select, single select, date range) for Flutter

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

irvan.devv17@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, intl, jiffy

More

Packages that depend on some_calendar