Skip to content

Formatting datepicker #83

@amrutavarsh

Description

@amrutavarsh

Not sure if this is a bug or an error in my implementation but i'm unable to correctly format the datepicker. Attaching my current code and view

BottomPicker.date(
    title: 'Date of birth',
    dateOrder: DatePickerDateOrder.dmy,
    initialDateTime: dateOfBirth,
    maxDateTime: DateTime.now(),
    minDateTime: DateTime(1923),
    titleStyle: TextStyle(
      fontWeight: FontWeight.bold,
      fontSize: 16,
      color: Color(0xFF4202A6), // Assuming this is the title color
      letterSpacing: -0.3,
    ),
    titlePadding: EdgeInsets.only(top: 15), // Adjust padding to align the title with the close button
    onChange: (index) {
      HapticFeedback.lightImpact();
    },
    onSubmit: (index) {
      print("DATE");
      print(index);
      dateOfBirth = DateFormat('dd MMM yyyy').format(index);
      _submitForm();
    },
    pickerTextStyle: TextStyle(
      color: Colors.black,
      fontSize: 18,
      letterSpacing: -0.3,
    ),
    buttonText: 'Confirm',
    buttonTextStyle: TextStyle(
      color: Colors.white,
      fontWeight: FontWeight.w600,
      letterSpacing: -0.2,
    ),
    buttonSingleColor: Color(0xFF4202A6),
    displayButtonIcon: false,
    buttonPadding: 10,
    dismissable: true,
    height: 350,
).show(context);
                          
Screenshot 2023-12-03 at 2 51 46 PM

I want to make the following changes:

  1. The Title and close button don't seem to be aligned
  2. Not able to change the grey color selected area to a lighter color
  3. There is some unnecessary space between the title and picker
  4. The picker doesn't extend all the way to the edges

Thanks!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions