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