|
...
|
...
|
@@ -142,6 +142,20 @@ class DialogUtil { |
|
|
|
messageModel.showMessageDialog=false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//解析返回显示的日期
|
|
|
|
static String _parseDateDay(DateTime dateTime){
|
|
|
|
DateTime now=DateTime.now();
|
|
|
|
if(Utils.isOneDay(dateTime,now)){
|
|
|
|
return "今";
|
|
|
|
}else if(Utils.isOneDay(dateTime,now.add(Duration(days: 1)))){
|
|
|
|
return "明";
|
|
|
|
}else if(Utils.isOneDay(dateTime,now.add(Duration(days: 2)))){
|
|
|
|
return "后";
|
|
|
|
}else{
|
|
|
|
return dateTime.day.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//显示日历弹框
|
|
|
|
static Future<DateTime> showCalendarDialog(BuildContext context,DateTime selectDateTime) {
|
|
|
|
CalendarController _calendarController = CalendarController();
|
|
...
|
...
|
@@ -214,6 +228,23 @@ class DialogUtil { |
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
dayBuilder: (context,date,_){
|
|
|
|
return Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
margin: const EdgeInsets.all(6.0),
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
bottom: 4.0, left: 8.0, right: 8.0, top: 4.0),
|
|
|
|
child: Text(
|
|
|
|
"${_parseDateDay(date)}",
|
|
|
|
style: TextStyle().copyWith(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
selectedDayBuilder: (context, date, _) {
|
|
|
|
return Container(
|
|
|
|
decoration: BoxDecoration(
|
|
...
|
...
|
@@ -225,9 +256,7 @@ class DialogUtil { |
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
bottom: 4.0, left: 8.0, right: 8.0, top: 4.0),
|
|
|
|
child: Text(
|
|
|
|
date.day == DateTime
|
|
|
|
.now()
|
|
|
|
.day ? '今' : date.day.toString(),
|
|
|
|
"${_parseDateDay(date)}",
|
|
|
|
style: TextStyle().copyWith(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_ffffff),
|
...
|
...
|
|