A simple and customize Date range picker with multi range
- Create Multi Range picker
- Support multi language (with intl localization)
In the pubspec.yaml
of your flutter project, add the following dependency:
dependencies:
...
multi_date_range_picker: "^0.0.5"
In your library add the following import:
import 'package:flutter_slidable/flutter_slidable.dart';
and use MultiDateRangePicker
Widget to show
MultiDateRangePicker(
initialValue: [],
onChanged: (List<List<DateTime>> intervals) {
},
);
You can change colors of selection and background and more.
onlyOne = false // Allow only one selection
selectionColor = Colors.lightGreenAccent // Sets the color of the selection
buttonColor = Colors.lightGreenAccent // Sets the color of the buttons
buttonTextColor = Colors.black // Sets the color of text in buttons
primaryTextColor = Colors.black // Sets the color of UI text
dateTextColor = Colors.black // Sets the color of calendar date
ignoreTextColor = Colors.grey // Sets the color of external calendar date
selectedDateTextColor = Colors.black // Sets the color of calendar date when is selected
selectedIgnoreTextColor = Colors.black // Sets the color of external calendar date when is selected
backgroundTextColor = Colors.white // Sets the background color
For the customization of the local you will need at the start of your application to define the default local in intl
Intl.defaultLocale = 'fr';
initializeDateFormatting();