cpdf_keyboard_util.dart 762 B

1234567891011121314151617181920
  1. import 'package:flutter/services.dart';
  2. import 'package:flutter/material.dart';
  3. ///
  4. /// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
  5. ///
  6. /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  7. /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  8. /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  9. /// This notice may not be removed from this file.
  10. class CPDFKeyboardUtils {
  11. static Future<void> hideKeyShowFocused() async {
  12. await SystemChannels.textInput.invokeMethod('TextInput.hide');
  13. }
  14. static Future<void> hideKeyShowUnfocused() async {
  15. FocusManager.instance.primaryFocus?.unfocus();
  16. }
  17. }