StemBranch class
Represents a combination of a Stem and a Branch (People combine a stem with a branch to form the official name of things that need to be named (day, hour, month, year, etc.)).
This class provides methods to create StemBranch instances based on the year, month, day of the LunarDateTime.
Example usage:
// Create a StemBranch for the year 2022
StemBranch yearBranch = StemBranch.year(2022);
print('Year Branch: ${yearBranch.name(LanguageName.vietnamese)}');
// Create a StemBranch for the month of December in the year 2000
StemBranch monthBranch = StemBranch.month(12, 2000);
print('Month Branch: ${monthBranch.name(LanguageName.vietnamese)}');
Constructors
- StemBranch({required Stem stem, required Branch branch})
- Constructs a StemBranch with the provided Stem and Branch.
- StemBranch.day(int julianDay)
-
Creates a StemBranch instance based on the given the Julian day:
julianDay
.factory - StemBranch.dayFromLunar(LunarDateTime date)
-
Creates a StemBranch instance based on the given the instance of LunarDateTime
date
.factory - StemBranch.hour(LunarDateTime date, int index)
-
Creates a StemBranch instance based on the given LunarDateTime
date
andindex
in range [0-11
].factory - StemBranch.month(int month, int year)
-
Creates a month's StemBranch instance based on the given this
month
andyear
of thismonth
.factory - StemBranch.year(int year)
-
Creates a year's StemBranch instance based on the given this
year
.factory
Properties
Methods
-
name(
LanguageName lang) → String -
Generates the name of the StemBranch in the specified
lang
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited