HeraApp constructor

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

Implementation

HeraApp({
  Key? key,
  required this.child,
  required this.loginType,
  HeraText? nuntioText,
  HeraColor? nuntioColor,
  HeraTextStyle? nuntioTextStyle,
  NuntioStyle? nuntioStyle,
  NuntioFooter? nuntioFooter,
  Brightness? brightness,
  this.logo,
}) {
  if (loginType == LoginType.NOTHING) {
    identifierInputType = TextInputType.none;
  } else if (loginType == LoginType.EMAIL_PASSWORD ||
      loginType == LoginType.EMAIL_VERIFICATION_CODE) {
    identifierInputType = TextInputType.emailAddress;
  } else if (loginType == LoginType.PHONE_PASSWORD ||
      loginType == LoginType.PHONE_VERIFICATION_CODE) {
    identifierInputType = TextInputType.phone;
  } else if (loginType == LoginType.USERNAME_PASSWORD) {
    identifierInputType = TextInputType.text;
  } else {
    throw Exception("invalid login type");
  }
  this.brightness =
      brightness ?? SchedulerBinding.instance.window.platformBrightness;
  print(this.brightness);

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

  this.nuntioText = nuntioText ?? HeraText(loginType: loginType);

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

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

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