|
@@ -12006,23 +12006,48 @@ class DialogUtil { |
|
@@ -12006,23 +12006,48 @@ class DialogUtil { |
|
12006
|
stateSetter(() {
|
12006
|
stateSetter(() {
|
|
12007
|
gongli = !gongli;
|
12007
|
gongli = !gongli;
|
|
12008
|
});
|
12008
|
});
|
|
12009
|
- if (dayStr != '') {
|
|
|
|
12010
|
- List dayList = updateDay(
|
|
|
|
12011
|
- gongli,
|
|
|
|
12012
|
- yearStr == '选填'
|
|
|
|
12013
|
- ? DateTime.now().year.toString()
|
|
|
|
12014
|
- : yearStr,
|
|
|
|
12015
|
- monthStr == ''
|
|
|
|
12016
|
- ? DateTime.now()
|
|
|
|
12017
|
- .month
|
|
|
|
12018
|
- .toString()
|
|
|
|
12019
|
- : monthStr);
|
|
|
|
12020
|
- if (!dayList.contains(dayStr)) {
|
|
|
|
12021
|
- stateSetter(() {
|
|
|
|
12022
|
- dayStr = '';
|
|
|
|
12023
|
- });
|
|
|
|
12024
|
- }
|
|
|
|
12025
|
- }
|
12009
|
+
|
|
|
|
12010
|
+ // 把农历转换成公历
|
|
|
|
12011
|
+
|
|
|
|
12012
|
+ int mLeapMonth =
|
|
|
|
12013
|
+ LunarCalendarUtil.leapMonth(
|
|
|
|
12014
|
+ int.parse(yearStr!));
|
|
|
|
12015
|
+ List<int?> time =
|
|
|
|
12016
|
+ LunarCalendarUtil.lunarToSolar(
|
|
|
|
12017
|
+ int.parse(yearStr!),
|
|
|
|
12018
|
+ int.parse(monthStr!),
|
|
|
|
12019
|
+ int.parse(dayStr!),
|
|
|
|
12020
|
+ mLeapMonth ==
|
|
|
|
12021
|
+ int.parse(monthStr!));
|
|
|
|
12022
|
+
|
|
|
|
12023
|
+ yearStr = time[0]!.toString();
|
|
|
|
12024
|
+ monthStr = time[1]!.toString();
|
|
|
|
12025
|
+ dayStr = time[2]!.toString();
|
|
|
|
12026
|
+ show = (yearStr ?? '') +
|
|
|
|
12027
|
+ '年' +
|
|
|
|
12028
|
+ (monthStr ?? '') +
|
|
|
|
12029
|
+ '月' +
|
|
|
|
12030
|
+ (dayStr ?? '') +
|
|
|
|
12031
|
+ '日';
|
|
|
|
12032
|
+ stateSetter(() {});
|
|
|
|
12033
|
+
|
|
|
|
12034
|
+ // if (dayStr != '') {
|
|
|
|
12035
|
+ // List dayList = updateDay(
|
|
|
|
12036
|
+ // gongli,
|
|
|
|
12037
|
+ // yearStr == '选填'
|
|
|
|
12038
|
+ // ? DateTime.now().year.toString()
|
|
|
|
12039
|
+ // : yearStr,
|
|
|
|
12040
|
+ // monthStr == ''
|
|
|
|
12041
|
+ // ? DateTime.now()
|
|
|
|
12042
|
+ // .month
|
|
|
|
12043
|
+ // .toString()
|
|
|
|
12044
|
+ // : monthStr);
|
|
|
|
12045
|
+ // if (!dayList.contains(dayStr)) {
|
|
|
|
12046
|
+ // stateSetter(() {
|
|
|
|
12047
|
+ // dayStr = '';
|
|
|
|
12048
|
+ // });
|
|
|
|
12049
|
+ // }
|
|
|
|
12050
|
+ // }
|
|
12026
|
},
|
12051
|
},
|
|
12027
|
child: Container(
|
12052
|
child: Container(
|
|
12028
|
padding: EdgeInsets.symmetric(
|
12053
|
padding: EdgeInsets.symmetric(
|
|
@@ -12057,21 +12082,42 @@ class DialogUtil { |
|
@@ -12057,21 +12082,42 @@ class DialogUtil { |
|
12057
|
stateSetter(() {
|
12082
|
stateSetter(() {
|
|
12058
|
gongli = !gongli;
|
12083
|
gongli = !gongli;
|
|
12059
|
});
|
12084
|
});
|
|
12060
|
- if (dayStr != '') {
|
|
|
|
12061
|
- List dayList = updateDay(
|
|
|
|
12062
|
- gongli,
|
|
|
|
12063
|
- yearStr == '选填'
|
|
|
|
12064
|
- ? DateTime.now().year.toString()
|
|
|
|
12065
|
- : yearStr,
|
|
|
|
12066
|
- monthStr == ''
|
|
|
|
12067
|
- ? DateTime.now().month.toString()
|
|
|
|
12068
|
- : monthStr);
|
|
|
|
12069
|
- if (!dayList.contains(dayStr)) {
|
|
|
|
12070
|
- stateSetter(() {
|
|
|
|
12071
|
- dayStr = '';
|
|
|
|
12072
|
- });
|
|
|
|
12073
|
- }
|
|
|
|
12074
|
- }
|
12085
|
+
|
|
|
|
12086
|
+ // 获取当前阴历
|
|
|
|
12087
|
+ Lunar currentLunarTime =
|
|
|
|
12088
|
+ Solar.fromDate(now).getLunar();
|
|
|
|
12089
|
+ yearStr =
|
|
|
|
12090
|
+ currentLunarTime.getYear().toString();
|
|
|
|
12091
|
+ monthStr =
|
|
|
|
12092
|
+ currentLunarTime.getMonth().toString();
|
|
|
|
12093
|
+ dayStr =
|
|
|
|
12094
|
+ currentLunarTime.getDay().toString();
|
|
|
|
12095
|
+ //转换成农历
|
|
|
|
12096
|
+
|
|
|
|
12097
|
+ show = (yearStr ?? '') +
|
|
|
|
12098
|
+ '年' +
|
|
|
|
12099
|
+ LunarCalendarUtil.formatLunarDate(
|
|
|
|
12100
|
+ int.parse(monthStr!),
|
|
|
|
12101
|
+ int.parse(dayStr!));
|
|
|
|
12102
|
+
|
|
|
|
12103
|
+ print(show);
|
|
|
|
12104
|
+
|
|
|
|
12105
|
+ stateSetter(() {});
|
|
|
|
12106
|
+ // if (dayStr != '') {
|
|
|
|
12107
|
+ // List dayList = updateDay(
|
|
|
|
12108
|
+ // gongli,
|
|
|
|
12109
|
+ // yearStr == '选填'
|
|
|
|
12110
|
+ // ? DateTime.now().year.toString()
|
|
|
|
12111
|
+ // : yearStr,
|
|
|
|
12112
|
+ // monthStr == ''
|
|
|
|
12113
|
+ // ? DateTime.now().month.toString()
|
|
|
|
12114
|
+ // : monthStr);
|
|
|
|
12115
|
+ // if (!dayList.contains(dayStr)) {
|
|
|
|
12116
|
+ // stateSetter(() {
|
|
|
|
12117
|
+ // dayStr = '';
|
|
|
|
12118
|
+ // });
|
|
|
|
12119
|
+ // }
|
|
|
|
12120
|
+ // }
|
|
12075
|
},
|
12121
|
},
|
|
12076
|
child: Container(
|
12122
|
child: Container(
|
|
12077
|
padding: EdgeInsets.symmetric(
|
12123
|
padding: EdgeInsets.symmetric(
|
|
@@ -12150,7 +12196,7 @@ class DialogUtil { |
|
@@ -12150,7 +12196,7 @@ class DialogUtil { |
|
12150
|
.getYear()
|
12196
|
.getYear()
|
|
12151
|
.toString();
|
12197
|
.toString();
|
|
12152
|
monthStr = currentLunarTime
|
12198
|
monthStr = currentLunarTime
|
|
12153
|
- .getMonth()
|
12199
|
+ .getMonth().abs()
|
|
12154
|
.toString();
|
12200
|
.toString();
|
|
12155
|
dayStr = currentLunarTime
|
12201
|
dayStr = currentLunarTime
|
|
12156
|
.getDay()
|
12202
|
.getDay()
|