Flutter doctor
```bash
Flutter (Channel stable, 3.16.9, on
macOS 14.2.1 23C71 darwin-arm64, locale
en-CA)
[✓] Xcode - develop for iOS and macOS (Xcode
15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
```
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/material/date_picker.dart': Failed assertion: line 201 pos 5: 'initialDate == null || !initialDate.isAfter(lastDate)': initialDate 2024-02-13 00:00:00.000 must be on or before lastDate 2006-12-31 00:00:00.000.
Is there an existing issue for this?
Package/Plugin version
9.2.1
Platforms
Flutter doctor
Flutter doctor
```bash Flutter (Channel stable, 3.16.9, on macOS 14.2.1 23C71 darwin-arm64, locale en-CA) [✓] Xcode - develop for iOS and macOS (Xcode 15.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.1) ```Minimal code example
Code sample
```dart FormBuilderDateTimePicker( name: 'birthday', initialValue: null, firstDate: DateTime(1923, 1, 1), lastDate: DateTime(2006, 12, 31), ), ```Current Behavior
Got error:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/material/date_picker.dart': Failed assertion: line 201 pos 5: 'initialDate == null || !initialDate.isAfter(lastDate)': initialDate 2024-02-13 00:00:00.000 must be on or before lastDate 2006-12-31 00:00:00.000.
Expected Behavior
The code should work for a null initialDate.
Steps To Reproduce
Add the form:
And click the field to select a date.
Aditional information
In _showDatePicker, if there is no initialDate, it will set to DateTime.now():
So, it can't pass the assert: