mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2025-01-03 15:47:52 +03:00
Adds the "diagnose" command to the about page.
This commit is contained in:
parent
ad6c9ce76b
commit
f69d22a9a8
@ -3,7 +3,8 @@ import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:yubico_authenticator/core/state.dart';
|
||||
|
||||
import 'core/state.dart';
|
||||
|
||||
final log = Logger('about');
|
||||
|
||||
@ -49,6 +50,21 @@ class AboutPage extends ConsumerWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
log.info('Running diagnostics...');
|
||||
final response =
|
||||
await ref.read(rpcProvider).command('diagnose', []);
|
||||
log.info('Response', response['diagnostics']);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Diagnostics done. See log for results...'),
|
||||
duration: Duration(seconds: 2),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Text('Run diagnostics...'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user