ByteNote LogoByteNote

Navigation

  • Blog
  • 工具

    © 2025 ByteNote. All rights reserved.

    Flutter 隐藏软键盘

    Aug 1, 20226 min read
    /// @class : KeyboardUtils
    /// @name : jhf
    /// @description :软键盘相关工具类
    class KeyboardUtils{
    
    
      ///隐藏软键盘
      ///[context] 上下文
      static hideKeyboard(BuildContext context) {
        FocusScopeNode currentFocus = FocusScope.of(context);
        if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
          FocusManager.instance.primaryFocus?.unfocus();
        }
      }
    
    }
    
    

    相关文章

    golang如何获取变量的类型

    在Go语言中,可以使用`fmt.Sprintf("%T", v)`或`reflect.TypeOf(v).String()`方法来获取变量的类型。

    从本地计算机访问 AWS EC2 实例上的 Ollama API

    要访问 AWS EC2 实例上的 Ollama API,需确保 API 监听所有接口、防火墙和安全组允许端口 11434 的流量,并检查网络 ACL 设置和端口状态。

    ngx_http_sticky_module.c:295:42: error: ‘iphp’ undeclared (first use in this function)

    The error message indicates that the variable "iphp" is undeclared, and to resolve it, declare "iphp" with the correct data type before its first use in the function.

    Flutter粘贴板操作 Clipboard、ClipboardData

    该Flutter代码示例展示了如何使用Clipboard和ClipboardData类在应用中实现文本的复制和粘贴功能。

    curl 输出的 json 如何格式化美化

    使用 curl 命令获取 JSON 输出并通过管道传递给 python3 -m json.tool 进行格式化,但需注意中文字符会被转换为 Unicode 编码。