diff --git a/lib/components/datepicker/date_picker.dart b/lib/components/datepicker/date_picker.dart index 3db1778..fdee36b 100644 --- a/lib/components/datepicker/date_picker.dart +++ b/lib/components/datepicker/date_picker.dart @@ -78,6 +78,14 @@ class _TUIDatePickerState extends State { super.initState(); _dateController = widget.controller ?? material.TextEditingController(); _dateFormat = widget.format ?? _getDefaultDateTimeFormat(); + if (widget.initialDate != null || widget.initialTime != null) { + if (widget.initialDate != null) { + _selectedDate = combine(widget.initialDate!, widget.initialTime); + } else { + _selectedDate = convert(widget.initialTime); + } + _dateController.text = _dateFormat.format(_selectedDate!); + } } @override