覆盖Flutter的日期选择器和时间选择器

时间:2020-07-03 16:14:33

标签: flutter dart

我如何覆盖Flutter的Datepicker和timepicker文本(月,年,确定按钮,取消按钮等。)

   DateTimeField(
    format: format,
    onShowPicker: (context, currentValue) async {
      final date = await showDatePicker(
          context: context,
          firstDate: DateTime(1900),
          initialDate: currentValue ?? DateTime.now(),
          lastDate: DateTime(2100));
      if (date != null) {
        final time = await showTimePicker(
          context: context,
          initialTime:
              TimeOfDay.fromDateTime(currentValue ?? DateTime.now()),
        );
        return DateTimeField.combine(date, time);
      } else {
        return currentValue;
      }
    },
  ),

谢谢

0 个答案:

没有答案