Skip to content

Current date without focus #78

@otaldopira

Description

@otaldopira

Describe the bug
I am trying to create a calendar, initializing with DateTime.now().add(Duration(days: -7)) , but it is focusing on the first date and not the current date.

Expected behavior
I would like it to start with the current date, with the possibility for the user to select earlier dates by scrolling to the left.

Screenshots
It is initializing this way, with the focus of the dates 7 days ago.

image

I would like it to initialize with the focus on DateTime.now()

image

Animação

DatePicker(
            DateTime.now().add(Duration(days: -7)),
            locale: 'pt_BR',
            initialSelectedDate: DateTime.now(),
            selectionColor: Colors.black,
            selectedTextColor: Colors.white,
            controller: _controller,
            onDateChange: (date) {
              setState(() {
                _selectDate = date;
              });
            },
          ),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions