Snowflake constructor
Snowflake(
- dynamic id
Creates instance of an Snowflake
Implementation
factory Snowflake(dynamic id) {
if (id is int) {
return Snowflake.value(id);
} else {
try {
return Snowflake.value(int.parse(id.toString()));
} on FormatException {
throw InvalidSnowflakeException(id);
}
}
}