refactor: Migrate to null safety

This commit is contained in:
Krille Fear 2022-01-29 12:35:03 +01:00 committed by Christian Pauly
commit 55f0300f9f
163 changed files with 1759 additions and 1903 deletions

View file

@ -11,7 +11,7 @@ import 'settings_3pid_view.dart';
class Settings3Pid extends StatefulWidget {
static int sendAttempt = 0;
const Settings3Pid({Key key}) : super(key: key);
const Settings3Pid({Key? key}) : super(key: key);
@override
Settings3PidController createState() => Settings3PidController();
@ -22,12 +22,12 @@ class Settings3PidController extends State<Settings3Pid> {
final input = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context).enterAnEmailAddress,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
title: L10n.of(context)!.enterAnEmailAddress,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
textFields: [
DialogTextField(
hintText: L10n.of(context).enterAnEmailAddress,
hintText: L10n.of(context)!.enterAnEmailAddress,
keyboardType: TextInputType.emailAddress,
),
],
@ -46,17 +46,17 @@ class Settings3PidController extends State<Settings3Pid> {
final ok = await showOkAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context).weSentYouAnEmail,
message: L10n.of(context).pleaseClickOnLink,
okLabel: L10n.of(context).iHaveClickedOnLink,
title: L10n.of(context)!.weSentYouAnEmail,
message: L10n.of(context)!.pleaseClickOnLink,
okLabel: L10n.of(context)!.iHaveClickedOnLink,
);
if (ok == null) return;
if (ok != OkCancelResult.ok) return;
final success = await showFutureLoadingDialog(
context: context,
future: () => Matrix.of(context).client.uiaRequestBackground(
(auth) => Matrix.of(context).client.add3PID(
clientSecret,
response.result.sid,
response.result!.sid,
auth: auth,
),
),
@ -65,15 +65,15 @@ class Settings3PidController extends State<Settings3Pid> {
setState(() => request = null);
}
Future<List<ThirdPartyIdentifier>> request;
Future<List<ThirdPartyIdentifier>?>? request;
void delete3Pid(ThirdPartyIdentifier identifier) async {
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.cancel,
) !=
OkCancelResult.ok) {
return;