NicInfo class
This class represents the information extracted from a NIC number.
Constructors
- NicInfo({required String nicNo, required String format, required String serialNo, required String birthDate, required String weekDay, required String age, required String gender, required String votability})
-
Constructs a
NicInfo
object with required fields.const - NicInfo.from12Digit(String nicVal)
-
Creates a
NicInfo
object from a 12-digit Sri Lankan NIC number.factory - NicInfo.from9Digit(String nicVal)
-
Creates a
NicInfo
object from a 9-digit Sri Lankan NIC number.factory
Properties
- age → String
-
The calculated age of the NIC holder.
final
- birthDate → String
-
The extracted birth date in
YYYY/MM/DD
format.final - format → String
-
The format of the NIC (
"Old"
for 9-digit NIC,"New"
for 12-digit NIC).final - gender → String
-
The gender of the NIC holder (
"Male"
or"Female"
).final - hashCode → int
-
The hash code for this object.
no setterinherited
- nicNo → String
-
The original NIC number provided.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serialNo → String
-
The serial number extracted from the NIC.
final
- votability → String
-
Indicates whether the NIC holder is eligible to vote (
"Yes"
or"No"
).final - weekDay → String
-
The weekday of the birth date.
final
Methods
-
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
Static Methods
-
isLeapYear(
int year) → bool - Determines whether a given year is a leap year.