Coder Social home page Coder Social logo

flutter-datepicker's Introduction

Flutter Persian (Jalaali) and Gregorian Linear Date Picker

Pub

This package provides a Persian or Gregorian linear DatePicker for flutter.

Screenshot 2


Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
 flutter_linear_datepicker: ^2.0.6

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_linear_datepicker/flutter_datepicker.dart';
import 'package:flutter_linear_datepicker/number_picker.dart';

How to use?

Simple usage

just simply infalate following snippet in your flutter code:

LinearDatePicker(
  dateChangeListener: (String selectedDate) {
    print(selectedDate);
  },
);

Advanced usage

You can customize widget using below parameters:

LinearDatePicker(
  startDate: "2004/10/17", //yyyy/mm/dd
  endDate: "2020/02/20",
  initialDate: "2010/11/15",
  addLeadingZero: true,
  dateChangeListener: (String selectedDate) {
    print(selectedDate);
  },
  showDay: true,  //false -> only select year & month
  labelStyle: TextStyle(
    fontFamily: 'sans',
    fontSize: 14.0,
    color: Colors.black,
  ),
  selectedRowStyle: TextStyle(
    fontFamily: 'sans',
    fontSize: 18.0,
    color: Colors.deepOrange,
  ),
  unselectedRowStyle: TextStyle(
    fontFamily: 'sans',
    fontSize: 16.0,
    color: Colors.blueGrey,
  ),
  yearText: "سال | year",
  monthText: "ماه | month",
  dayText: "روز | day",
  showLabels: true, // to show column captions, eg. year, month, etc.
  columnWidth: 100,
  showMonthName: true,
  isJalaali: false  // false -> Gregorian
),

Used Packages

MarcinusX/NumberPicker FatulM/shamsi_date

flutter-datepicker's People

Contributors

alikhaleghi76 avatar ashkan4472 avatar mohamadhadibi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flutter-datepicker's Issues

خطا در فلاتر 3.22

سلام و وقت بخیر
در آخرین نسخه فلاتر لایبراری این خطا رو میده:
/Local/Pub/Cache/hosted/pub.dev/flutter_linear_datepicker-2.0.5/lib/number_picker.dart:185:62: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.

  • 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/F:/sdk/flutter/packages/flutter/lib/src/material/text_theme.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText2'.
    defaultStyle = unselectedRowStyle ?? themeData.textTheme.bodyText2!;

لطفا بررسی کنید. ممنون

scroll

سلام، برای تغییر تاریخ، در حالت وب، حتما نیازه که اسکرول بشه ، و با حرکت دادن موس روی تاریخ که معمولا توی برنامه های فلاتری ، شخص به حالت اپلیکیشن (حتی توی حالت وب) اون حالت رو اجرا میکنه و سعی میکنه با انتخاب و یا تکان دادن اونو تغییر بده درحالی که فقط با اسکرول موس میشه تغییرش داد ...
لطفا این قابلیت هم اضافه کنین
ممنون

31 Tir Bug

when pick 31 Tir, it change it to 1 Mordad.

today button

A button(call back) to change the date to current date

Add textStyle for selectedText and unselectedText

If you can put a textStyle for the selectedText and unselectedText, it would be nice, for example, if we want to bold the selectedText, now it's not possible, but if the textStyle is added, we can personalize the full selectedText and the unselectedText.

show month name

Hi

showing month name next to its number like image below would be great:

Screenshot_20220525-095913_Persian Calendar

Getting multi callback on dateChangeListener

per changing any of date parameters(day-month-year) dateChangeListener gets multi callbacks

below log is happening because of changing the date by 1 day:
image

code:

     LinearDatePicker(
          dateChangeListener: (String selectedDate) {
                print(selectedDate);
          },
          showMonthName: true,
          isJalaali: true,
     )

endDate does not work on days

endDate Property does not works on days. for example in image below, i have set endDate to 1385/07/05 but day does not ends in 05
image
image

P.S: with fix for this, update shamsi_date package version too ;)

release new version

The version of flutter-datepicker is old, So the SDK flutter (Channel stable, 3.3.9) is not supported.
update the package, pls.

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.