浏览代码

fix

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
c6115512
共有 12 个文件被更改,包括 44 次插入22 次删除
  1. 26
      com.unity.uiwidgets/Runtime/material/pickers/date_picker_dialog.cs
  2. 16
      com.unity.uiwidgets/Runtime/material/pickers/input_date_picker.cs
  3. 2
      com.unity.uiwidgets/Runtime/material/pickers/date_picker_common.cs
  4. 11
      com.unity.uiwidgets/Runtime/material/pickers/date_picker_dialog.cs.meta
  5. 11
      com.unity.uiwidgets/Runtime/material/pickers/input_date_picker.cs.meta
  6. 0
      /com.unity.uiwidgets/Runtime/material/pickers/calendar_date_picker.cs
  7. 0
      /com.unity.uiwidgets/Runtime/material/pickers/calendar_date_picker.cs.meta
  8. 0
      /com.unity.uiwidgets/Runtime/material/pickers/date_picker_common.cs
  9. 0
      /com.unity.uiwidgets/Runtime/material/pickers/date_picker_common.cs.meta
  10. 0
      /com.unity.uiwidgets/Runtime/material/pickers/date_utils.cs
  11. 0
      /com.unity.uiwidgets/Runtime/material/pickers/date_utils.cs.meta

26
com.unity.uiwidgets/Runtime/material/pickers/date_picker_dialog.cs


using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.material {
public static class DatePickerDialogUtils {
public partial class material_ {
public static readonly Size _calendarPortraitDialogSize = new Size(330.0f, 518.0f);
public static readonly Size _calendarLandscapeDialogSize = new Size(496.0f, 346.0f);
public static readonly Size _inputPortraitDialogSize = new Size(330.0f, 270.0f);

DateTime firstDate,
DateTime lastDate,
DatePickerEntryMode initialEntryMode = DatePickerEntryMode.calendar,
SelectableDayPredicate selectableDayPredicate = null,
material_.SelectableDayPredicate selectableDayPredicate = null,
string helpText = null,
string cancelText = null,
string confirmText = null,

DateTime? firstDate = null,
DateTime? lastDate = null,
DatePickerEntryMode initialEntryMode = DatePickerEntryMode.calendar,
SelectableDayPredicate selectableDayPredicate = null,
material_.SelectableDayPredicate selectableDayPredicate = null,
string cancelText = null,
string confirmText = null,
string helpText = null,

D.assert(firstDate != null);
D.assert(lastDate != null);
initialDate = utils.dateOnly(initialDate);
firstDate = utils.dateOnly(firstDate);
lastDate = utils.dateOnly(lastDate);
initialDate = utils.dateOnly(initialDate.Value);
firstDate = utils.dateOnly(firstDate.Value);
lastDate = utils.dateOnly(lastDate.Value);
D.assert(
!lastDate.Value.isBefore(firstDate.Value),

() => $"initialDate {initialDate} must be on or before lastDate {lastDate}."
);
D.assert(
selectableDayPredicate == null || initialDate == null || selectableDayPredicate(initialDate),
selectableDayPredicate == null || initialDate == null || selectableDayPredicate(initialDate.Value),
() => $"Provided initialDate {initialDate} must satisfy provided selectableDayPredicate."
);

public readonly DatePickerEntryMode initialEntryMode;
public readonly SelectableDayPredicate selectableDayPredicate;
public readonly material_.SelectableDayPredicate selectableDayPredicate;
public readonly string cancelText;

case DatePickerEntryMode.calendar:
switch (orientation) {
case Orientation.portrait:
return DatePickerDialogUtils._calendarPortraitDialogSize;
return material_._calendarPortraitDialogSize;
return DatePickerDialogUtils._calendarLandscapeDialogSize;
return material_._calendarLandscapeDialogSize;
}
break;

return DatePickerDialogUtils._inputPortraitDialogSize;
return material_._inputPortraitDialogSize;
return DatePickerDialogUtils._inputLandscapeDialogSize;
return material_._inputLandscapeDialogSize;
}
break;

child: new AnimatedContainer(
width: dialogSize.width,
height: dialogSize.height,
duration: DatePickerDialogUtils._dialogSizeAnimationDuration,
duration: material_._dialogSizeAnimationDuration,
curve: Curves.easeIn,
child: new MediaQuery(
data: MediaQuery.of(context).copyWith(

16
com.unity.uiwidgets/Runtime/material/pickers/input_date_picker.cs


DateTime? lastDate = null,
ValueChanged<DateTime> onDateSubmitted = null,
ValueChanged<DateTime> onDateSaved = null,
SelectableDayPredicate selectableDayPredicate = null,
material_.SelectableDayPredicate selectableDayPredicate = null,
string errorFormatText = null,
string errorInvalidText = null,
string fieldHintText = null,

D.assert(firstDate != null);
D.assert(lastDate != null);
initialDate = initialDate != null ? utils.dateOnly(initialDate) : null;
firstDate = utils.dateOnly(firstDate);
lastDate = utils.dateOnly(lastDate);
initialDate = initialDate != null ? utils.dateOnly(initialDate.Value) : (DateTime?)null;
firstDate = utils.dateOnly(firstDate.Value);
lastDate = utils.dateOnly(lastDate.Value);
D.assert(
!lastDate.Value.isBefore(firstDate.Value),

() => $"initialDate {initialDate} must be on or before lastDate {lastDate}."
);
D.assert(
selectableDayPredicate == null || initialDate == null || selectableDayPredicate(initialDate),
selectableDayPredicate == null || initialDate == null || selectableDayPredicate(initialDate.Value),
this.firstDate = firstDate;
this.lastDate = lastDate;
this.firstDate = firstDate.Value;
this.lastDate = lastDate.Value;
this.onDateSubmitted = onDateSubmitted;
this.onDateSaved = onDateSaved;
this.selectableDayPredicate = selectableDayPredicate;

public readonly ValueChanged<DateTime> onDateSaved;
public readonly SelectableDayPredicate selectableDayPredicate;
public readonly material_.SelectableDayPredicate selectableDayPredicate;
public readonly string errorFormatText;

2
com.unity.uiwidgets/Runtime/material/pickers/date_picker_common.cs


}
public partial class material_ {
public delegate bool SelectableDayPredicate(DateTime day);
public delegate bool SelectableDayPredicate(DateTime? day);
}
}

11
com.unity.uiwidgets/Runtime/material/pickers/date_picker_dialog.cs.meta


fileFormatVersion: 2
guid: 906efcdd9b5d70846bd214c325e5387f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

11
com.unity.uiwidgets/Runtime/material/pickers/input_date_picker.cs.meta


fileFormatVersion: 2
guid: 0581869944bd34247af2ee4ada2f3a1f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

/com.unity.uiwidgets/Runtime/material/picker/calendar_date_picker.cs → /com.unity.uiwidgets/Runtime/material/pickers/calendar_date_picker.cs

/com.unity.uiwidgets/Runtime/material/picker/calendar_date_picker.cs.meta → /com.unity.uiwidgets/Runtime/material/pickers/calendar_date_picker.cs.meta

/com.unity.uiwidgets/Runtime/material/picker/date_picker_common.cs → /com.unity.uiwidgets/Runtime/material/pickers/date_picker_common.cs

/com.unity.uiwidgets/Runtime/material/picker/date_picker_common.cs.meta → /com.unity.uiwidgets/Runtime/material/pickers/date_picker_common.cs.meta

/com.unity.uiwidgets/Runtime/material/picker/date_utils.cs → /com.unity.uiwidgets/Runtime/material/pickers/date_utils.cs

/com.unity.uiwidgets/Runtime/material/picker/date_utils.cs.meta → /com.unity.uiwidgets/Runtime/material/pickers/date_utils.cs.meta

正在加载...
取消
保存