分类
Flutter

flutter之dialog

参考链接

Flutter – 自定义Dialog

分类
Node.js

fs文件操作

fs.writeFile():写入文件

fs.readFile() :读取文件

参考链接

fs文件操作模块

分类
Flutter

Dart语法学习

单例模式

class Manager {
  // 工厂模式
  factory Manager() =>_getInstance()
  static Manager get instance => _getInstance();
  static Manager _instance;
  Manager._internal() {
    // 初始化
  }
  static Manager _getInstance() {
    if (_instance == null) {
      _instance = new Manager._internal();
    }
    return _instance;
  }
}

调用

Manager manager = new Manager();
Manager manager2 = Manager.instance;
分类
Flutter

flutter手势


参考链接

Flutter进阶篇(3)– Flutter 的手势(GestureDetector)分析详解

分类
Flutter

flutter开发mac app

参考链接

使用 Flutter 开发 macOS App

分类
运营

Problem with the SSL CA cert (path? access rights?)

升级wordpress发现502,于是查找接近方式,有人提出执行如下命令

mv /usr/lib64/libsqlite3.so.0.8.6 /usr/lib64/libsqlite3.so.0.8.6.bak

当时并未发现异常,但是当需要git pull时,发现提示如下

fatal: unable to access ‘xxxx’: Problem with the SSL CA cert (path? access rights?)

尝试各种解决方式,当尝试如下方法时

yum update -y nss curl libcurl

发现提示

There was a problem importing one of the Python modules

required to run yum. The error leading to this problem was:

   No module named sqlite

Please install a package which provides this module, or

verify that the module is installed correctly.

It’s possible that the above module doesn’t match the

current version of Python, which is:

2.6.6 (r266:84292, Jan 22 2014, 09:42:36) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]

If you cannot solve this problem yourself, please go to 

the yum faq at:

于是怀疑是之前操作引起的问题,恢复后可以pull

http://yum.baseurl.org/wiki/Faq


分类
运营

阿里云服务器维护日常

查看硬盘剩余空间

df -hl 
  • 文件系统 Filesystem
  • 容量 Size
  • 已用 Used
  • 可用 Avail
  • 已用% Use%
  • 挂载点  Mounted on
分类
Flutter

flutter之bloc

参考说明

Flutter响应式编程:Streams和BLoC

分类
Flutter

flutter主题

flutter的主题机制对于程序人员独立开发很友好,更利于合理的搭配颜色

参考链接

flutter主题颜色

Flutter进阶—自定义主题风格

分类
App开发

android 如何获取网络视频的第一帧

String pathvideo = "你的网络视频路径";
//加载视频第一帧
Bitmap bitmap = getNetVideoBitmap(pathvideo);
holder.img.setImageBitmap(bitmap);//对应的ImageView赋值图片
public static Bitmap getNetVideoBitmap(String videoUrl) {
    Bitmap bitmap = null;

    MediaMetadataRetriever retriever = new MediaMetadataRetriever();
    try {
        //根据url获取缩略图
        retriever.setDataSource(videoUrl, new HashMap());
        //获得第一帧图片
        bitmap = retriever.getFrameAtTime();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } finally {
        retriever.release();
    }
    return bitmap;
}

参考链接

android 如何获取网络视频的第一帧