StemBranch.year constructor
StemBranch.year(
- int year
Creates a year's StemBranch instance based on the given this year
.
Implementation
factory StemBranch.year(int year) {
final stemsYearOrdered = [
Stem.yangMetal,
Stem.yinMetal,
Stem.yangWater,
Stem.yinWater,
Stem.yangWood,
Stem.yinWood,
Stem.yangFire,
Stem.yinFire,
Stem.yangEarth,
Stem.yinEarth,
];
final branchesYearOrdered = [
Branch.monkey,
Branch.rooster,
Branch.dog,
Branch.pig,
Branch.rat,
Branch.ox,
Branch.tiger,
Branch.rabbit,
Branch.dragon,
Branch.snake,
Branch.horse,
Branch.goat,
];
return StemBranch(
stem: stemsYearOrdered[year % 10],
branch: branchesYearOrdered[year % 12]);
}