yubioath-flutter/lib/fido/views/fido_screen.dart

24 lines
780 B
Dart
Raw Normal View History

2022-03-15 19:16:14 +03:00
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}'),
],
));
}