yubioath-flutter/lib/fido/views/fido_screen.dart
2022-03-15 17:26:14 +01:00

24 lines
780 B
Dart
Executable File

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../app/models.dart';
import '../../app/views/app_failure_screen.dart';
import '../../app/views/app_loading_screen.dart';
import '../state.dart';
class FidoScreen extends ConsumerWidget {
final YubiKeyData deviceData;
const FidoScreen(this.deviceData, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context, WidgetRef ref) =>
ref.watch(fidoStateProvider(deviceData.node.path)).when(
none: () => const AppLoadingScreen(),
failure: (reason) => AppFailureScreen(reason),
success: (state) => ListView(
children: [
Text('${state.info}'),
],
));
}