fix: call updateEmail after initState to avoid runtime exception
updateEmail uses getEnteColorScheme() which adds an inherited widget as dependency to the widget. Adding an inherited widget as dependency before init state is completed throws an exception
This commit is contained in:
parent
8137825693
commit
04e45b7908
1 changed files with 3 additions and 3 deletions
|
@ -29,18 +29,18 @@ class _LoginPageState extends State<LoginPage> {
|
|||
final Logger _logger = Logger('_LoginPageState');
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
if ((_config.getEmail() ?? '').isNotEmpty) {
|
||||
updateEmail(_config.getEmail()!);
|
||||
} else if (kDebugMode) {
|
||||
updateEmail(const String.fromEnvironment("email"));
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
|
||||
final isKeypadOpen = MediaQuery.viewInsetsOf(context).bottom > 100;
|
||||
|
||||
FloatingActionButtonLocation? fabLocation() {
|
||||
if (isKeypadOpen) {
|
||||
|
|
Loading…
Add table
Reference in a new issue