yubioath-flutter/lib/widgets/focus_utils.dart

18 lines
394 B
Dart
Raw Normal View History

2023-05-31 11:24:41 +03:00
import 'package:flutter/cupertino.dart';
import 'package:logging/logging.dart';
import '../app/logging.dart';
final _log = Logger('FocusUtils');
class FocusUtils {
static void unfocus(BuildContext context) {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
_log.debug('Removing focus...');
currentFocus.unfocus();
}
}
}