TOTP constructor

TOTP({
  1. required String secret,
  2. int digits = 6,
  3. int interval = 30,
  4. OTPAlgorithm algorithm = OTPAlgorithm.SHA1,
})

This constructor will create an TOTP instance.

All parameters are mandatory however interval, digits and algorithm have a default values, so can be ignored.

Will throw an exception if the line above isn't satisfied.

Implementation

TOTP({
  required String secret,
  int digits = 6,
  int interval = 30,
  OTPAlgorithm algorithm = OTPAlgorithm.SHA1,
}) : super(
        secret: secret,
        digits: digits,
        algorithm: algorithm,
      ) {
  this.interval = interval;
}