HeraApp constructor
HeraApp({
- Key? key,
- required Widget child,
- required LoginType loginType,
- NuntioText? nuntioText,
- NuntioColor? nuntioColor,
- NuntioTextStyle? nuntioTextStyle,
- NuntioStyle? nuntioStyle,
- Brightness? brightness,
- Widget? logo,
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();
}