通过更新 Flutter 3.8.0,我在 flutter_date_time_picker 中收到以下错误。我想知道是否有人知道这个问题的解决方案。
../../../../.pub-cache/git/flutter_datetime_picker-eb66486c47d50bf550950c196486121ffcea8885/lib/flutter_datetime_picker.dart:7:1: Error:
'DatePickerTheme' is imported from both 'package:flutter/src/material/date_picker_theme.dart' and'package:flutter_datetime_picker/src/datetime_picker_theme.dart'.
Run Code Online (Sandbox Code Playgroud)
pubspeck.yaml
flutter_datetime_picker:
git:
url: https://github.com/Realank/flutter_datetime_picker.git
Run Code Online (Sandbox Code Playgroud)
如果有人知道解决方案,我很想听听。
我相信这可能是由于 flutter 更新造成的,因为直到昨天我才能够正常构建!如果有人知道解决方案,我很想听听。
如何让 FlutterFormBuilderDateTimePicker只显示日期?下面的代码在日期选择器关闭后生成一个时间选择器,输出为:
扑动:2022-04-02 00:00:00.000
我可以利用时间来节省时间DateTime.timeonly(),但这并不能解决问题。这应该是一个仅限日期的字段。
FormBuilderDateTimePicker(
name: 'date_established',
format: DateFormat('dd/MM/yyyy'),
enabled: true,
decoration: InputDecoration(
labelText: 'Date Established',
labelStyle: TextStyle(
color: Colors.white,
fontSize: 16.0,
fontWeight: FontWeight.normal)),
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
fontWeight: FontWeight.normal),
),
Run Code Online (Sandbox Code Playgroud)