mirror of
https://github.com/ente-io/ente.git
synced 2025-08-14 02:07:33 +00:00
Fix warnings around missing awaits
This commit is contained in:
@@ -167,7 +167,7 @@ class SuperLogging {
|
|||||||
await setupLogDir();
|
await setupLogDir();
|
||||||
}
|
}
|
||||||
if (sentryIsEnabled) {
|
if (sentryIsEnabled) {
|
||||||
setupSentry();
|
await setupSentry();
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.root.level = Level.ALL;
|
Logger.root.level = Level.ALL;
|
||||||
@@ -250,7 +250,7 @@ class SuperLogging {
|
|||||||
|
|
||||||
// add error to sentry queue
|
// add error to sentry queue
|
||||||
if (sentryIsEnabled && rec.error != null) {
|
if (sentryIsEnabled && rec.error != null) {
|
||||||
_sendErrorToSentry(rec.error!, null);
|
await _sendErrorToSentry(rec.error!, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ class SuperLogging {
|
|||||||
SuperLogging.setUserID(await _getOrCreateAnonymousUserID());
|
SuperLogging.setUserID(await _getOrCreateAnonymousUserID());
|
||||||
await for (final error in sentryQueueControl.stream.asBroadcastStream()) {
|
await for (final error in sentryQueueControl.stream.asBroadcastStream()) {
|
||||||
try {
|
try {
|
||||||
Sentry.captureException(
|
await Sentry.captureException(
|
||||||
error,
|
error,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:adaptive_theme/adaptive_theme.dart';
|
import 'package:adaptive_theme/adaptive_theme.dart';
|
||||||
@@ -46,7 +47,7 @@ Future<void> _runInForeground() async {
|
|||||||
_logger.info("Starting app in foreground");
|
_logger.info("Starting app in foreground");
|
||||||
await _init(false, via: 'mainMethod');
|
await _init(false, via: 'mainMethod');
|
||||||
final Locale locale = await getLocale();
|
final Locale locale = await getLocale();
|
||||||
UpdateService.instance.showUpdateNotification();
|
unawaited(UpdateService.instance.showUpdateNotification());
|
||||||
runApp(
|
runApp(
|
||||||
AppLock(
|
AppLock(
|
||||||
builder: (args) => App(locale: locale),
|
builder: (args) => App(locale: locale),
|
||||||
@@ -83,7 +84,7 @@ Future _runWithLogs(Function() function, {String prefix = ""}) async {
|
|||||||
|
|
||||||
Future<void> _init(bool bool, {String? via}) async {
|
Future<void> _init(bool bool, {String? via}) async {
|
||||||
// Start workers asynchronously. No need to wait for them to start
|
// Start workers asynchronously. No need to wait for them to start
|
||||||
Computer.shared().turnOn(workersCount: 4, verbose: kDebugMode);
|
Computer.shared().turnOn(workersCount: 4, verbose: kDebugMode).ignore();
|
||||||
CryptoUtil.init();
|
CryptoUtil.init();
|
||||||
await PreferenceService.instance.init();
|
await PreferenceService.instance.init();
|
||||||
await CodeStore.instance.init();
|
await CodeStore.instance.init();
|
||||||
|
@@ -103,6 +103,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
|||||||
),
|
),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final locale = await getLocale();
|
final locale = await getLocale();
|
||||||
|
// ignore: unawaited_futures
|
||||||
routeToPage(
|
routeToPage(
|
||||||
context,
|
context,
|
||||||
LanguageSelectorPage(
|
LanguageSelectorPage(
|
||||||
@@ -228,6 +229,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
|||||||
}
|
}
|
||||||
if (hasOptedBefore || result?.action == ButtonAction.first) {
|
if (hasOptedBefore || result?.action == ButtonAction.first) {
|
||||||
await Configuration.instance.optForOfflineMode();
|
await Configuration.instance.optForOfflineMode();
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@@ -208,7 +208,7 @@ class AuthenticatorService {
|
|||||||
if (deletedIDs.isNotEmpty) {
|
if (deletedIDs.isNotEmpty) {
|
||||||
await _db.deleteByIDs(ids: deletedIDs);
|
await _db.deleteByIDs(ids: deletedIDs);
|
||||||
}
|
}
|
||||||
_prefs.setInt(_lastEntitySyncTime, maxSyncTime);
|
await _prefs.setInt(_lastEntitySyncTime, maxSyncTime);
|
||||||
_logger.info("Setting synctime to " + maxSyncTime.toString());
|
_logger.info("Setting synctime to " + maxSyncTime.toString());
|
||||||
if (result.length == fetchLimit) {
|
if (result.length == fetchLimit) {
|
||||||
_logger.info("Diff limit reached, pulling again");
|
_logger.info("Diff limit reached, pulling again");
|
||||||
|
@@ -54,6 +54,7 @@ class LocalAuthenticationService {
|
|||||||
.setEnabled(Configuration.instance.shouldShowLockScreen());
|
.setEnabled(Configuration.instance.shouldShowLockScreen());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
errorDialogTitle,
|
errorDialogTitle,
|
||||||
|
@@ -27,6 +27,7 @@ class NotificationService {
|
|||||||
_flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<
|
_flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<
|
||||||
AndroidFlutterLocalNotificationsPlugin>();
|
AndroidFlutterLocalNotificationsPlugin>();
|
||||||
if (implementation != null) {
|
if (implementation != null) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
implementation.requestPermission();
|
implementation.requestPermission();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:ente_auth/core/constants.dart';
|
import 'package:ente_auth/core/constants.dart';
|
||||||
@@ -70,9 +71,11 @@ class UpdateService {
|
|||||||
if (shouldUpdate &&
|
if (shouldUpdate &&
|
||||||
hasBeen3DaysSinceLastNotification &&
|
hasBeen3DaysSinceLastNotification &&
|
||||||
_latestVersion!.shouldNotify!) {
|
_latestVersion!.shouldNotify!) {
|
||||||
|
unawaited(
|
||||||
NotificationService.instance.showNotification(
|
NotificationService.instance.showNotification(
|
||||||
"Update available",
|
"Update available",
|
||||||
"Click to install our best version yet",
|
"Click to install our best version yet",
|
||||||
|
),
|
||||||
);
|
);
|
||||||
await _prefs.setInt(kUpdateAvailableShownTimeKey, now);
|
await _prefs.setInt(kUpdateAvailableShownTimeKey, now);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -147,18 +147,18 @@ class UserService {
|
|||||||
final userDetails = UserDetails.fromMap(response.data);
|
final userDetails = UserDetails.fromMap(response.data);
|
||||||
if (shouldCache) {
|
if (shouldCache) {
|
||||||
if (userDetails.profileData != null) {
|
if (userDetails.profileData != null) {
|
||||||
_preferences.setBool(
|
await _preferences.setBool(
|
||||||
kIsEmailMFAEnabled,
|
kIsEmailMFAEnabled,
|
||||||
userDetails.profileData!.isEmailMFAEnabled,
|
userDetails.profileData!.isEmailMFAEnabled,
|
||||||
);
|
);
|
||||||
_preferences.setBool(
|
await _preferences.setBool(
|
||||||
kCanDisableEmailMFA,
|
kCanDisableEmailMFA,
|
||||||
userDetails.profileData!.canDisableEmailMFA,
|
userDetails.profileData!.canDisableEmailMFA,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// handle email change from different client
|
// handle email change from different client
|
||||||
if (userDetails.email != _config.getEmail()) {
|
if (userDetails.email != _config.getEmail()) {
|
||||||
setEmail(userDetails.email);
|
await setEmail(userDetails.email);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return userDetails;
|
return userDetails;
|
||||||
@@ -282,6 +282,7 @@ class UserService {
|
|||||||
throw Exception("unexpected response during passkey verification");
|
throw Exception("unexpected response during passkey verification");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -331,6 +332,7 @@ class UserService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -354,6 +356,7 @@ class UserService {
|
|||||||
);
|
);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.incorrectCode,
|
context.l10n.incorrectCode,
|
||||||
@@ -363,6 +366,7 @@ class UserService {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
_logger.severe(e);
|
_logger.severe(e);
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
@@ -399,6 +403,7 @@ class UserService {
|
|||||||
Bus.instance.fire(UserDetailsChangedEvent());
|
Bus.instance.fire(UserDetailsChangedEvent());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
@@ -407,12 +412,14 @@ class UserService {
|
|||||||
} on DioError catch (e) {
|
} on DioError catch (e) {
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
if (e.response != null && e.response!.statusCode == 403) {
|
if (e.response != null && e.response!.statusCode == 403) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
context.l10n.thisEmailIsAlreadyInUse,
|
context.l10n.thisEmailIsAlreadyInUse,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.incorrectCode,
|
context.l10n.incorrectCode,
|
||||||
@@ -422,6 +429,7 @@ class UserService {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
_logger.severe(e);
|
_logger.severe(e);
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
@@ -632,6 +640,7 @@ class UserService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -709,6 +718,7 @@ class UserService {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
showShortToast(context, context.l10n.authenticationSuccessful);
|
showShortToast(context, context.l10n.authenticationSuccessful);
|
||||||
await _saveConfiguration(response);
|
await _saveConfiguration(response);
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -723,6 +733,7 @@ class UserService {
|
|||||||
_logger.severe(e);
|
_logger.severe(e);
|
||||||
if (e.response != null && e.response!.statusCode == 404) {
|
if (e.response != null && e.response!.statusCode == 404) {
|
||||||
showToast(context, "Session expired");
|
showToast(context, "Session expired");
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -732,6 +743,7 @@ class UserService {
|
|||||||
(route) => route.isFirst,
|
(route) => route.isFirst,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.incorrectCode,
|
context.l10n.incorrectCode,
|
||||||
@@ -741,6 +753,7 @@ class UserService {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
_logger.severe(e);
|
_logger.severe(e);
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
@@ -760,6 +773,7 @@ class UserService {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -777,6 +791,7 @@ class UserService {
|
|||||||
_logger.severe(e);
|
_logger.severe(e);
|
||||||
if (e.response != null && e.response!.statusCode == 404) {
|
if (e.response != null && e.response!.statusCode == 404) {
|
||||||
showToast(context, context.l10n.sessionExpired);
|
showToast(context, context.l10n.sessionExpired);
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -786,6 +801,7 @@ class UserService {
|
|||||||
(route) => route.isFirst,
|
(route) => route.isFirst,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
@@ -794,6 +810,7 @@ class UserService {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_logger.severe(e);
|
_logger.severe(e);
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
@@ -853,6 +870,7 @@ class UserService {
|
|||||||
context.l10n.twofactorAuthenticationSuccessfullyReset,
|
context.l10n.twofactorAuthenticationSuccessfullyReset,
|
||||||
);
|
);
|
||||||
await _saveConfiguration(response);
|
await _saveConfiguration(response);
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -866,6 +884,7 @@ class UserService {
|
|||||||
_logger.severe(e);
|
_logger.severe(e);
|
||||||
if (e.response != null && e.response!.statusCode == 404) {
|
if (e.response != null && e.response!.statusCode == 404) {
|
||||||
showToast(context, "Session expired");
|
showToast(context, "Session expired");
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -875,6 +894,7 @@ class UserService {
|
|||||||
(route) => route.isFirst,
|
(route) => route.isFirst,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
@@ -883,6 +903,7 @@ class UserService {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_logger.severe(e);
|
_logger.severe(e);
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
@@ -925,7 +946,7 @@ class UserService {
|
|||||||
"isEnabled": isEnabled,
|
"isEnabled": isEnabled,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
_preferences.setBool(kIsEmailMFAEnabled, isEnabled);
|
await _preferences.setBool(kIsEmailMFAEnabled, isEnabled);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_logger.severe("Failed to update email mfa", e);
|
_logger.severe("Failed to update email mfa", e);
|
||||||
rethrow;
|
rethrow;
|
||||||
|
@@ -236,7 +236,7 @@ class DeleteAccountPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
// ignore: unawaited_futures
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@@ -61,7 +61,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
isFormValid: _emailIsValid,
|
isFormValid: _emailIsValid,
|
||||||
buttonText: context.l10n.logInLabel,
|
buttonText: context.l10n.logInLabel,
|
||||||
onPressedFunction: () async {
|
onPressedFunction: () async {
|
||||||
UserService.instance.setEmail(_email!);
|
await UserService.instance.setEmail(_email!);
|
||||||
Configuration.instance.resetVolatilePassword();
|
Configuration.instance.resetVolatilePassword();
|
||||||
SrpAttributes? attr;
|
SrpAttributes? attr;
|
||||||
bool isEmailVerificationEnabled = true;
|
bool isEmailVerificationEnabled = true;
|
||||||
@@ -74,6 +74,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (attr != null && !isEmailVerificationEnabled) {
|
if (attr != null && !isEmailVerificationEnabled) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@@ -23,6 +23,7 @@ Future<void> autoLogoutAlert(BuildContext context) async {
|
|||||||
int pendingSyncCount =
|
int pendingSyncCount =
|
||||||
await AuthenticatorDB.instance.getNeedSyncCount();
|
await AuthenticatorDB.instance.getNeedSyncCount();
|
||||||
if (pendingSyncCount > 0) {
|
if (pendingSyncCount > 0) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showChoiceActionSheet(
|
showChoiceActionSheet(
|
||||||
context,
|
context,
|
||||||
title: l10n.pendingSyncs,
|
title: l10n.pendingSyncs,
|
||||||
|
@@ -399,6 +399,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
_logger.severe(e, s);
|
_logger.severe(e, s);
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
|
// ignore: unawaited_futures
|
||||||
showGenericErrorDialog(context: context);
|
showGenericErrorDialog(context: context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -446,6 +447,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||||||
await UserService.instance.setAttributes(result);
|
await UserService.instance.setAttributes(result);
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
Configuration.instance.resetVolatilePassword();
|
Configuration.instance.resetVolatilePassword();
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushAndRemoveUntil(
|
Navigator.of(context).pushAndRemoveUntil(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -457,10 +459,11 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
_logger.severe(e, s);
|
_logger.severe(e, s);
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
|
// ignore: unawaited_futures
|
||||||
showGenericErrorDialog(context: context);
|
showGenericErrorDialog(context: context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ignore: unawaited_futures
|
||||||
routeToPage(
|
routeToPage(
|
||||||
context,
|
context,
|
||||||
RecoveryKeyPage(
|
RecoveryKeyPage(
|
||||||
@@ -476,12 +479,14 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
|
|||||||
_logger.severe(e);
|
_logger.severe(e);
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
if (e is UnsupportedError) {
|
if (e is UnsupportedError) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.insecureDevice,
|
context.l10n.insecureDevice,
|
||||||
context.l10n.sorryWeCouldNotGenerateSecureKeysOnThisDevicennplease,
|
context.l10n.sorryWeCouldNotGenerateSecureKeysOnThisDevicennplease,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showGenericErrorDialog(context: context);
|
showGenericErrorDialog(context: context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -116,6 +116,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
|
|||||||
firstButtonLabel: context.l10n.useRecoveryKey,
|
firstButtonLabel: context.l10n.useRecoveryKey,
|
||||||
);
|
);
|
||||||
if (dialogChoice!.action == ButtonAction.first) {
|
if (dialogChoice!.action == ButtonAction.first) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@@ -54,6 +54,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
|||||||
await Configuration.instance.recover(_recoveryKey.text.trim());
|
await Configuration.instance.recover(_recoveryKey.text.trim());
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
showToast(context, "Recovery successful!");
|
showToast(context, "Recovery successful!");
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).pushReplacement(
|
Navigator.of(context).pushReplacement(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -72,6 +73,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
|||||||
if (e is AssertionError) {
|
if (e is AssertionError) {
|
||||||
errMessage = '$errMessage : ${e.message}';
|
errMessage = '$errMessage : ${e.message}';
|
||||||
}
|
}
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(context, "Incorrect recovery key", errMessage);
|
showErrorDialog(context, "Incorrect recovery key", errMessage);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -78,7 +78,7 @@ class _RequestPasswordVerificationPageState
|
|||||||
onPressedFunction: () async {
|
onPressedFunction: () async {
|
||||||
FocusScope.of(context).unfocus();
|
FocusScope.of(context).unfocus();
|
||||||
final dialog = createProgressDialog(context, context.l10n.pleaseWait);
|
final dialog = createProgressDialog(context, context.l10n.pleaseWait);
|
||||||
dialog.show();
|
await dialog.show();
|
||||||
try {
|
try {
|
||||||
final attributes = Configuration.instance.getKeyAttributes()!;
|
final attributes = Configuration.instance.getKeyAttributes()!;
|
||||||
final Uint8List keyEncryptionKey = await CryptoUtil.deriveKey(
|
final Uint8List keyEncryptionKey = await CryptoUtil.deriveKey(
|
||||||
@@ -92,17 +92,18 @@ class _RequestPasswordVerificationPageState
|
|||||||
keyEncryptionKey,
|
keyEncryptionKey,
|
||||||
Sodium.base642bin(attributes.keyDecryptionNonce),
|
Sodium.base642bin(attributes.keyDecryptionNonce),
|
||||||
);
|
);
|
||||||
dialog.show();
|
await dialog.show();
|
||||||
// pop
|
// pop
|
||||||
await widget.onPasswordVerified(keyEncryptionKey);
|
await widget.onPasswordVerified(keyEncryptionKey);
|
||||||
dialog.hide();
|
await dialog.hide();
|
||||||
Navigator.of(context).pop(true);
|
Navigator.of(context).pop(true);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
_logger.severe("Error while verifying password", e, s);
|
_logger.severe("Error while verifying password", e, s);
|
||||||
dialog.hide();
|
await dialog.hide();
|
||||||
if (widget.onPasswordError != null) {
|
if (widget.onPasswordError != null) {
|
||||||
widget.onPasswordError!();
|
widget.onPasswordError!();
|
||||||
} else {
|
} else {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.incorrectPasswordTitle,
|
context.l10n.incorrectPasswordTitle,
|
||||||
|
@@ -121,6 +121,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
_logger.severe('failed to terminate');
|
_logger.severe('failed to terminate');
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.oops,
|
context.l10n.oops,
|
||||||
@@ -184,7 +185,7 @@ class _SessionsPageState extends State<SessionsPage> {
|
|||||||
if (isLoggingOutFromThisDevice) {
|
if (isLoggingOutFromThisDevice) {
|
||||||
await UserService.instance.logout(context);
|
await UserService.instance.logout(context);
|
||||||
} else {
|
} else {
|
||||||
_terminateSession(session);
|
await _terminateSession(session);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@@ -92,6 +92,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
|
|||||||
String recoveryKey;
|
String recoveryKey;
|
||||||
try {
|
try {
|
||||||
recoveryKey = Sodium.bin2hex(Configuration.instance.getRecoveryKey());
|
recoveryKey = Sodium.bin2hex(Configuration.instance.getRecoveryKey());
|
||||||
|
// ignore: unawaited_futures
|
||||||
routeToPage(
|
routeToPage(
|
||||||
context,
|
context,
|
||||||
RecoveryKeyPage(
|
RecoveryKeyPage(
|
||||||
@@ -104,6 +105,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showGenericErrorDialog(context: context);
|
showGenericErrorDialog(context: context);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -356,6 +356,7 @@ class _CodeWidgetState extends State<CodeWidget> {
|
|||||||
await FlutterClipboard.copy(content);
|
await FlutterClipboard.copy(content);
|
||||||
showToast(context, confirmationMessage);
|
showToast(context, confirmationMessage);
|
||||||
if (Platform.isAndroid && shouldMinimizeOnCopy) {
|
if (Platform.isAndroid && shouldMinimizeOnCopy) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
MoveToBackground.moveTaskToBack();
|
MoveToBackground.moveTaskToBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -385,7 +386,7 @@ class _CodeWidgetState extends State<CodeWidget> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (code != null) {
|
if (code != null) {
|
||||||
CodeStore.instance.addCode(code);
|
await CodeStore.instance.addCode(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -146,6 +146,7 @@ class ProgressDialog {
|
|||||||
try {
|
try {
|
||||||
if (!_isShowing) {
|
if (!_isShowing) {
|
||||||
_dialog = _Body();
|
_dialog = _Body();
|
||||||
|
// ignore: unawaited_futures
|
||||||
showDialog<dynamic>(
|
showDialog<dynamic>(
|
||||||
context: _context!,
|
context: _context!,
|
||||||
barrierDismissible: _barrierDismissible,
|
barrierDismissible: _barrierDismissible,
|
||||||
|
@@ -120,7 +120,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (code != null) {
|
if (code != null) {
|
||||||
CodeStore.instance.addCode(code);
|
await CodeStore.instance.addCode(code);
|
||||||
// Focus the new code by searching
|
// Focus the new code by searching
|
||||||
if (_codes.length > 2) {
|
if (_codes.length > 2) {
|
||||||
_focusNewCode(code);
|
_focusNewCode(code);
|
||||||
@@ -137,7 +137,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (code != null) {
|
if (code != null) {
|
||||||
CodeStore.instance.addCode(code);
|
await CodeStore.instance.addCode(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,6 +151,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
MoveToBackground.moveTaskToBack();
|
MoveToBackground.moveTaskToBack();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -36,6 +36,7 @@ class AboutSectionWidget extends StatelessWidget {
|
|||||||
trailingIcon: Icons.chevron_right_outlined,
|
trailingIcon: Icons.chevron_right_outlined,
|
||||||
trailingIconIsMuted: true,
|
trailingIconIsMuted: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
// ignore: unawaited_futures
|
||||||
launchUrl(Uri.parse("https://github.com/ente-io/ente"));
|
launchUrl(Uri.parse("https://github.com/ente-io/ente"));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -68,6 +69,7 @@ class AboutSectionWidget extends StatelessWidget {
|
|||||||
await UpdateService.instance.shouldUpdate();
|
await UpdateService.instance.shouldUpdate();
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
if (shouldUpdate) {
|
if (shouldUpdate) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -115,6 +117,7 @@ class AboutMenuItemWidget extends StatelessWidget {
|
|||||||
trailingIcon: Icons.chevron_right_outlined,
|
trailingIcon: Icons.chevron_right_outlined,
|
||||||
trailingIconIsMuted: true,
|
trailingIconIsMuted: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@@ -48,6 +48,7 @@ class AccountSectionWidget extends StatelessWidget {
|
|||||||
l10n.authToChangeYourEmail,
|
l10n.authToChangeYourEmail,
|
||||||
);
|
);
|
||||||
if (hasAuthenticated) {
|
if (hasAuthenticated) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -74,6 +75,7 @@ class AccountSectionWidget extends StatelessWidget {
|
|||||||
l10n.authToChangeYourPassword,
|
l10n.authToChangeYourPassword,
|
||||||
);
|
);
|
||||||
if (hasAuthenticated) {
|
if (hasAuthenticated) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -106,9 +108,11 @@ class AccountSectionWidget extends StatelessWidget {
|
|||||||
recoveryKey =
|
recoveryKey =
|
||||||
Sodium.bin2hex(Configuration.instance.getRecoveryKey());
|
Sodium.bin2hex(Configuration.instance.getRecoveryKey());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showGenericErrorDialog(context: context);
|
showGenericErrorDialog(context: context);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// ignore: unawaited_futures
|
||||||
routeToPage(
|
routeToPage(
|
||||||
context,
|
context,
|
||||||
RecoveryKeyPage(
|
RecoveryKeyPage(
|
||||||
@@ -142,6 +146,7 @@ class AccountSectionWidget extends StatelessWidget {
|
|||||||
trailingIcon: Icons.chevron_right_outlined,
|
trailingIcon: Icons.chevron_right_outlined,
|
||||||
trailingIconIsMuted: true,
|
trailingIconIsMuted: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
// ignore: unawaited_futures
|
||||||
routeToPage(context, const DeleteAccountPage());
|
routeToPage(context, const DeleteAccountPage());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@@ -174,6 +174,7 @@ class _ApkDownloaderDialogState extends State<ApkDownloaderDialog> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||||
|
// ignore: unawaited_futures
|
||||||
OpenFilex.open(_saveUrl);
|
OpenFilex.open(_saveUrl);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Logger("ApkDownloader").severe(e);
|
Logger("ApkDownloader").severe(e);
|
||||||
@@ -214,7 +215,7 @@ class _ApkDownloaderDialogState extends State<ApkDownloaderDialog> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
// ignore: unawaited_futures
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@@ -46,6 +46,7 @@ class DangerSectionWidget extends StatelessWidget {
|
|||||||
trailingIcon: Icons.chevron_right_outlined,
|
trailingIcon: Icons.chevron_right_outlined,
|
||||||
trailingIconIsMuted: true,
|
trailingIconIsMuted: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
// ignore: unawaited_futures
|
||||||
routeToPage(context, const DeleteAccountPage());
|
routeToPage(context, const DeleteAccountPage());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@@ -35,6 +35,7 @@ class DataSectionWidget extends StatelessWidget {
|
|||||||
trailingIcon: Icons.chevron_right_outlined,
|
trailingIcon: Icons.chevron_right_outlined,
|
||||||
trailingIconIsMuted: true,
|
trailingIconIsMuted: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
// ignore: unawaited_futures
|
||||||
routeToPage(context, ImportCodePage());
|
routeToPage(context, ImportCodePage());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@@ -98,7 +98,7 @@ Future<void> _requestForEncryptionPassword(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
// get json value of data
|
// get json value of data
|
||||||
_exportCodes(context, jsonEncode(data.toJson()));
|
await _exportCodes(context, jsonEncode(data.toJson()));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
Logger("ExportWidget").severe(e, s);
|
Logger("ExportWidget").severe(e, s);
|
||||||
showToast(context, "Error while exporting codes.");
|
showToast(context, "Error while exporting codes.");
|
||||||
|
@@ -56,6 +56,7 @@ Future<void> showGoogleAuthInstruction(BuildContext context) async {
|
|||||||
await CodeStore.instance.addCode(code, shouldSync: false);
|
await CodeStore.instance.addCode(code, shouldSync: false);
|
||||||
}
|
}
|
||||||
unawaited(AuthenticatorService.instance.onlineSync());
|
unawaited(AuthenticatorService.instance.onlineSync());
|
||||||
|
// ignore: unawaited_futures
|
||||||
importSuccessDialog(context, codes.length);
|
importSuccessDialog(context, codes.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -19,29 +19,29 @@ class ImportService {
|
|||||||
Future<void> initiateImport(BuildContext context, ImportType type) async {
|
Future<void> initiateImport(BuildContext context, ImportType type) async {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ImportType.plainText:
|
case ImportType.plainText:
|
||||||
showImportInstructionDialog(context);
|
await showImportInstructionDialog(context);
|
||||||
break;
|
break;
|
||||||
case ImportType.encrypted:
|
case ImportType.encrypted:
|
||||||
showEncryptedImportInstruction(context);
|
await showEncryptedImportInstruction(context);
|
||||||
break;
|
break;
|
||||||
case ImportType.ravio:
|
case ImportType.ravio:
|
||||||
showRaivoImportInstruction(context);
|
await showRaivoImportInstruction(context);
|
||||||
break;
|
break;
|
||||||
case ImportType.googleAuthenticator:
|
case ImportType.googleAuthenticator:
|
||||||
showGoogleAuthInstruction(context);
|
await showGoogleAuthInstruction(context);
|
||||||
// showToast(context, 'coming soon');
|
// showToast(context, 'coming soon');
|
||||||
break;
|
break;
|
||||||
case ImportType.aegis:
|
case ImportType.aegis:
|
||||||
showAegisImportInstruction(context);
|
await showAegisImportInstruction(context);
|
||||||
break;
|
break;
|
||||||
case ImportType.twoFas:
|
case ImportType.twoFas:
|
||||||
show2FasImportInstruction(context);
|
await show2FasImportInstruction(context);
|
||||||
break;
|
break;
|
||||||
case ImportType.bitwarden:
|
case ImportType.bitwarden:
|
||||||
showBitwardenImportInstruction(context);
|
await showBitwardenImportInstruction(context);
|
||||||
break;
|
break;
|
||||||
case ImportType.lastpass:
|
case ImportType.lastpass:
|
||||||
showLastpassImportInstruction(context);
|
await showLastpassImportInstruction(context);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -105,7 +105,7 @@ class ImportCodePage extends StatelessWidget {
|
|||||||
index != importOptions.length - 1,
|
index != importOptions.length - 1,
|
||||||
isTopBorderRadiusRemoved: index != 0,
|
isTopBorderRadiusRemoved: index != 0,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
ImportService().initiateImport(context, type);
|
await ImportService().initiateImport(context, type);
|
||||||
// routeToPage(context, ImportCodePage());
|
// routeToPage(context, ImportCodePage());
|
||||||
// _showImportInstructionDialog(context);
|
// _showImportInstructionDialog(context);
|
||||||
},
|
},
|
||||||
|
@@ -61,6 +61,7 @@ class _DeveloperSettingsPageState extends State<DeveloperSettingsPage> {
|
|||||||
throw const FormatException();
|
throw const FormatException();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showErrorDialog(
|
showErrorDialog(
|
||||||
context,
|
context,
|
||||||
context.l10n.invalidEndpoint,
|
context.l10n.invalidEndpoint,
|
||||||
|
@@ -48,6 +48,7 @@ class _AdvancedSectionWidgetState extends State<AdvancedSectionWidget> {
|
|||||||
trailingIconIsMuted: true,
|
trailingIconIsMuted: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final locale = await getLocale();
|
final locale = await getLocale();
|
||||||
|
// ignore: unawaited_futures
|
||||||
routeToPage(
|
routeToPage(
|
||||||
context,
|
context,
|
||||||
LanguageSelectorPage(
|
LanguageSelectorPage(
|
||||||
|
@@ -116,6 +116,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
|||||||
context.l10n.authToViewYourActiveSessions,
|
context.l10n.authToViewYourActiveSessions,
|
||||||
);
|
);
|
||||||
if (hasAuthenticated) {
|
if (hasAuthenticated) {
|
||||||
|
// ignore: unawaited_futures
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@@ -81,6 +81,7 @@ class SocialsMenuItemWidget extends StatelessWidget {
|
|||||||
trailingIcon: Icons.chevron_right_outlined,
|
trailingIcon: Icons.chevron_right_outlined,
|
||||||
trailingIconIsMuted: true,
|
trailingIconIsMuted: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
// ignore: unawaited_futures
|
||||||
launchUrlString(
|
launchUrlString(
|
||||||
url,
|
url,
|
||||||
mode: launchInExternalApp
|
mode: launchInExternalApp
|
||||||
|
@@ -42,6 +42,7 @@ class _SupportSectionWidgetState extends State<SupportSectionWidget> {
|
|||||||
trailingIcon: Icons.chevron_right_outlined,
|
trailingIcon: Icons.chevron_right_outlined,
|
||||||
trailingIconIsMuted: true,
|
trailingIconIsMuted: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showModalBottomSheet<void>(
|
showModalBottomSheet<void>(
|
||||||
backgroundColor: Theme.of(context).colorScheme.background,
|
backgroundColor: Theme.of(context).colorScheme.background,
|
||||||
barrierColor: Colors.black87,
|
barrierColor: Colors.black87,
|
||||||
@@ -61,6 +62,7 @@ class _SupportSectionWidgetState extends State<SupportSectionWidget> {
|
|||||||
trailingIcon: Icons.chevron_right_outlined,
|
trailingIcon: Icons.chevron_right_outlined,
|
||||||
trailingIconIsMuted: true,
|
trailingIconIsMuted: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
// ignore: unawaited_futures
|
||||||
launchUrlString(
|
launchUrlString(
|
||||||
githubDiscussionsUrl,
|
githubDiscussionsUrl,
|
||||||
mode: LaunchMode.externalApplication,
|
mode: LaunchMode.externalApplication,
|
||||||
|
@@ -56,7 +56,7 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
|
|||||||
text: context.l10n.unlock,
|
text: context.l10n.unlock,
|
||||||
iconData: Icons.lock_open_outlined,
|
iconData: Icons.lock_open_outlined,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
_showLockScreen(source: "tapUnlock");
|
await _showLockScreen(source: "tapUnlock");
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@@ -119,7 +119,7 @@ class _TwoFactorAuthenticationPageState
|
|||||||
child: OutlinedButton(
|
child: OutlinedButton(
|
||||||
onPressed: _code.length == 6
|
onPressed: _code.length == 6
|
||||||
? () async {
|
? () async {
|
||||||
_verifyTwoFactorCode(_code);
|
await _verifyTwoFactorCode(_code);
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
child: Text(l10n.verify),
|
child: Text(l10n.verify),
|
||||||
|
@@ -62,6 +62,7 @@ Future<void> sendLogs(
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
// ignore: unawaited_futures
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -118,6 +119,7 @@ Future<void> sendLogs(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
// ignore: unawaited_futures
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
@@ -159,7 +161,7 @@ Future<String> getZippedLogsFile(BuildContext context) async {
|
|||||||
tempPath + "/logs-${Configuration.instance.getUserID() ?? 0}.zip";
|
tempPath + "/logs-${Configuration.instance.getUserID() ?? 0}.zip";
|
||||||
final encoder = ZipFileEncoder();
|
final encoder = ZipFileEncoder();
|
||||||
encoder.create(zipFilePath);
|
encoder.create(zipFilePath);
|
||||||
encoder.addDirectory(logsDirectory);
|
await encoder.addDirectory(logsDirectory);
|
||||||
encoder.close();
|
encoder.close();
|
||||||
await dialog.hide();
|
await dialog.hide();
|
||||||
return zipFilePath;
|
return zipFilePath;
|
||||||
|
@@ -2,14 +2,14 @@ import 'package:ente_auth/ente_theme_data.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
|
|
||||||
Future showToast(
|
void showToast(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
String message, {
|
String message, {
|
||||||
toastLength = Toast.LENGTH_LONG,
|
toastLength = Toast.LENGTH_LONG,
|
||||||
iOSDismissOnTap = true,
|
iOSDismissOnTap = true,
|
||||||
}) async {
|
}) async {
|
||||||
await Fluttertoast.cancel();
|
await Fluttertoast.cancel();
|
||||||
return Fluttertoast.showToast(
|
await Fluttertoast.showToast(
|
||||||
msg: message,
|
msg: message,
|
||||||
toastLength: toastLength,
|
toastLength: toastLength,
|
||||||
gravity: ToastGravity.BOTTOM,
|
gravity: ToastGravity.BOTTOM,
|
||||||
@@ -20,6 +20,6 @@ Future showToast(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> showShortToast(context, String message) {
|
void showShortToast(context, String message) {
|
||||||
return showToast(context, message, toastLength: Toast.LENGTH_SHORT);
|
showToast(context, message, toastLength: Toast.LENGTH_SHORT);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user