HeraApp constructor

HeraApp({
  1. Key? key,
  2. required Widget child,
  3. required LoginType loginType,
  4. NuntioText? nuntioText,
  5. NuntioColor? nuntioColor,
  6. NuntioTextStyle? nuntioTextStyle,
  7. NuntioStyle? nuntioStyle,
  8. NuntioFooter? nuntioFooter,
  9. Brightness? brightness,
})

Implementation

HeraApp({
  Key? key,
  required this.child,
  required this.loginType,
  NuntioText? nuntioText,
  NuntioColor? nuntioColor,
  NuntioTextStyle? nuntioTextStyle,
  NuntioStyle? nuntioStyle,
  NuntioFooter? nuntioFooter,
  Brightness? brightness,
  this.logo,
}) {
  if (loginType == LoginType.LOGIN_TYPE_INVALID) {
    identifierInputType = TextInputType.none;
  } else if (loginType == LoginType.LOGIN_TYPE_EMAIL_PASSWORD ||
      loginType == LoginType.LOGIN_TYPE_EMAIL_VERIFICATION_CODE) {
    identifierInputType = TextInputType.emailAddress;
  } else if (loginType == LoginType.LOGIN_TYPE_PHONE_PASSWORD ||
      loginType == LoginType.LOGIN_TYPE_PHONE_VERIFICATION_CODE) {
    identifierInputType = TextInputType.phone;
  } else {
    // todo: throw error hera and match on username
    identifierInputType = TextInputType.text;
  }
  this.brightness =
      brightness ?? SchedulerBinding.instance.window.platformBrightness;
  print(this.brightness);

  this.nuntioStyle = nuntioStyle ?? NuntioStyle();
  this.nuntioStyle.build(this.brightness);

  this.nuntioText = nuntioText ?? NuntioText();

  this.nuntioColor = nuntioColor ?? NuntioColor();
  this.nuntioColor.build(this.brightness);

  this.nuntioTextStyle = nuntioTextStyle ?? NuntioTextStyle();
  this.nuntioTextStyle.build(this.brightness);

  this.nuntioFooter = nuntioFooter ?? NuntioFooter();
}