YADESK-632 never calculate in build() on Android

This commit is contained in:
Adam Velebil 2022-04-07 10:48:59 +02:00
parent 411d744537
commit 1c80e9ceac
No known key found for this signature in database
GPG Key ID: AC6D6B9D715FC084

View File

@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../core/state.dart';
import '../../widgets/dialog_frame.dart';
import '../models.dart';
import 'account_mixin.dart';
@ -57,7 +58,9 @@ class AccountDialog extends ConsumerWidget with AccountMixin {
Widget build(BuildContext context, WidgetRef ref) {
final code = getCode(ref);
if (code == null) {
Timer(Duration.zero, () => calculateCode(context, ref));
if (isDesktop) {
Timer(Duration.zero, () => calculateCode(context, ref));
}
}
return DialogFrame(
child: AlertDialog(