day_selector 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 87

day_selector #

Flutter widget to select week day easily, week day or workable day mode are available, same as unique, multiple selection

Usage #

  value: null,
  onChange: (value) {},
  mode: DaySelector.modeFull

value: set the initial value of the widget, as int onChange: callback when a day is selected or unselected, selected day are represented as an integer value color: background color of the selector mode: select days showed by the selector, default to workday

Allowing only few days #

Available days are selected with mode parameter, by default you have two mode:

  • full the will show all days
  • workdays that will not show sunday

If you want your own days, you can do it like this:

  value: null,
  onChange: (value) {},
  mode: DaySelector.monday | DaySelector.friday,


  • clean api
  • ability to set an initial value


  • Initial release.


import 'package:day_selector/day_selector.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
      home: MyHomePage(title: 'Flutter Demo Home Page'),

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  _MyHomePageState createState() => _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: DaySelector(
          onChange: (value) {
            print('value is $value');
            if (DaySelector.monday & value == DaySelector.monday) {
              print('monday selected');
            if (DaySelector.tuesday & value == DaySelector.tuesday) {
              print('tuesday selected');
            if (DaySelector.wednesday & value == DaySelector.wednesday) {
              print('wednesday selected');
            if (DaySelector.thursday & value == DaySelector.thursday) {
              print('thursday selected');
            if (DaySelector.friday & value == DaySelector.friday) {
              print('friday selected');
            if (DaySelector.saturday & value == DaySelector.saturday) {
              print('saturday selected');
            if (DaySelector.sunday & value == DaySelector.sunday) {
              print('sunday selected');
      ), // This trailing comma makes auto-formatting nicer for build methods.

Use this package as a library

1. Depend on it

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

  day_selector: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support 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:day_selector/day_selector.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Format lib/day_selector.dart.

Run flutter format to format lib/day_selector.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies