update class name

This commit is contained in:
Adam Velebil 2024-09-09 13:13:36 +02:00
parent 17e383742c
commit dc8822d54d
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10
5 changed files with 14 additions and 14 deletions

View File

@ -41,7 +41,7 @@ import 'management/state.dart';
import 'oath/otp_auth_link_handler.dart';
import 'oath/state.dart';
import 'overlay/nfc/nfc_event_notifier.dart';
import 'overlay/nfc/nfc_overlay_provider.dart';
import 'overlay/nfc/nfc_overlay.dart';
import 'qr_scanner/qr_scanner_provider.dart';
import 'state.dart';
import 'window_state_provider.dart';
@ -122,8 +122,8 @@ Future<Widget> initialize() async {
// activates window state provider
ref.read(androidWindowStateProvider);
// initializes global handler for dialogs
ref.read(nfcOverlayProvider);
// initializes overlay for nfc events
ref.read(nfcOverlay);
// set context which will handle otpauth links
setupOtpAuthLinkHandler(context);

View File

@ -37,7 +37,7 @@ import '../../oath/models.dart';
import '../../oath/state.dart';
import '../../widgets/toast.dart';
import '../overlay/nfc/method_channel_notifier.dart';
import '../overlay/nfc/nfc_overlay_provider.dart';
import '../overlay/nfc/nfc_overlay.dart';
final _log = Logger('android.oath.state');
@ -157,7 +157,7 @@ Exception handlePlatformException(
toast(String message, {bool popStack = false}) =>
withContext((context) async {
ref.read(nfcOverlayProvider.notifier).hideOverlay();
ref.read(nfcOverlay.notifier).hide();
if (popStack) {
Navigator.of(context).popUntil((route) {
return route.isFirst;

View File

@ -17,7 +17,7 @@
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'nfc_overlay_provider.dart';
import 'nfc_overlay.dart';
class MethodChannelNotifier extends Notifier<void> {
final MethodChannel _channel;
@ -30,7 +30,7 @@ class MethodChannelNotifier extends Notifier<void> {
Future<dynamic> invoke(String name,
[Map<String, dynamic> args = const {}]) async {
final result = await _channel.invokeMethod(name, args);
await ref.read(nfcOverlayProvider.notifier).waitForHide();
await ref.read(nfcOverlay.notifier).waitForHide();
return result;
}
}

View File

@ -20,7 +20,7 @@ import 'package:logging/logging.dart';
import '../../../app/logging.dart';
import '../../../app/state.dart';
import 'nfc_overlay_provider.dart';
import 'nfc_overlay.dart';
import 'views/nfc_overlay_widget.dart';
final _log = Logger('android.nfc_event_notifier');
@ -98,7 +98,7 @@ class _NfcEventNotifierListener {
});
if (result == null) {
// the modal sheet was cancelled by Back button, close button or dismiss
_ref.read(nfcOverlayProvider.notifier).onCancel();
_ref.read(nfcOverlay.notifier).onCancel();
}
visible = false;
}

View File

@ -31,10 +31,10 @@ import 'views/nfc_overlay_widget.dart';
final _log = Logger('android.tap_request_dialog');
const _channel = MethodChannel('com.yubico.authenticator.channel.dialog');
final nfcOverlayProvider =
NotifierProvider<_NfcOverlayProvider, int>(_NfcOverlayProvider.new);
final nfcOverlay =
NotifierProvider<_NfcOverlayNotifier, int>(_NfcOverlayNotifier.new);
class _NfcOverlayProvider extends Notifier<int> {
class _NfcOverlayNotifier extends Notifier<int> {
Timer? processingViewTimeout;
late final l10n = ref.read(l10nProvider);
@ -80,7 +80,7 @@ class _NfcOverlayProvider extends Notifier<int> {
break;
case 'close':
hideOverlay();
hide();
break;
default:
@ -135,7 +135,7 @@ class _NfcOverlayProvider extends Notifier<int> {
showIfHidden: false);
}
void hideOverlay() {
void hide() {
ref.read(nfcEventNotifier.notifier).send(const NfcHideViewEvent());
}