getTimeNineStar method
Implementation
NineStar getTimeNineStar() {
//顺逆
String solarYmd = _solar!.toYmd();
bool asc = false;
if (solarYmd.compareTo(_jieQi['冬至']!.toYmd()) >= 0 &&
solarYmd.compareTo(_jieQi['夏至']!.toYmd()) < 0) {
asc = true;
} else if (solarYmd.compareTo(_jieQi['DONG_ZHI']!.toYmd()) >= 0) {
asc = true;
}
int start = asc ? 6 : 2;
String dayZhi = getDayZhi();
if ('子午卯酉'.contains(dayZhi)) {
start = asc ? 0 : 8;
} else if ('辰戌丑未'.contains(dayZhi)) {
start = asc ? 3 : 5;
}
int index = asc ? (start + _timeZhiIndex) : (start + 9 - _timeZhiIndex);
return new NineStar(index % 9);
}