摘要: 封装,继承,多态 封装 封装的意义在于业务理解,控制属性的访问权限,增加代码的易用性,也能更好的防止使用者随意更改属性,造成bug 抽象 隐藏方法内部实现 方法名也可以抽象一点,不要暴露太多细节,防止生变无法兼容 继承 代码复用,注意不要嵌套太深 多态 继承+方法重写,接口 代码复用,代码拓展 阅读全文
posted @ 2023-04-27 01:15 c-若曦 阅读(19) 评论(0) 推荐(0)
摘要: Flutter开启边界布局 1.导包: import 'package:flutter/rendering.dart'; 2.设置debugPaintSizeEnabled = true import 'package:flutter/material.dart'; import 'package: 阅读全文
posted @ 2023-04-27 01:14 c-若曦 阅读(227) 评论(0) 推荐(0)
摘要: Android 冷启动时间检测 //开始检测启动时间 Debug.startMethodTracing(base.getExternalCacheDir()+"/provider.trace",50*1024*1024); //结束检测时间 Debug.stopMethodTracing() 阅读全文
posted @ 2023-04-27 01:13 c-若曦 阅读(56) 评论(0) 推荐(0)
摘要: Android 透明主题踩坑 (1) 在Oncreat中,setContentView前可动态设置主题 (2) onAttachedToWindow 方法中重新设置decorView高度,这个方法会在第一次视图onMeasure之后、onDraw 之前调用时调用,只会调用一次,十分合适修改windo 阅读全文
posted @ 2023-04-27 01:13 c-若曦 阅读(34) 评论(0) 推荐(0)
摘要: app:layout_constrainedWidth="true" 阅读全文
posted @ 2023-04-27 01:12 c-若曦 阅读(111) 评论(0) 推荐(0)
摘要: public static void configureStatusBar(Activity activity, int color, boolean isBlackTheme) { if (Build.VERSION.SDK_INT >= 21 && Build.VERSION.SDK_INT < 阅读全文
posted @ 2023-04-27 01:12 c-若曦 阅读(28) 评论(0) 推荐(0)
摘要: Flutter 自定义页面跳转动画 import 'package:flutter/material.dart'; class FadeRoute extends PageRouteBuilder { final Widget page; FadeRoute({this.page}) : super 阅读全文
posted @ 2023-04-27 01:11 c-若曦 阅读(388) 评论(0) 推荐(0)
摘要: class EmptyPageState extends State<EmptyPage> with AutoDisposeMixin{ @override void initState() { super.initState(); WidgetsBinding.instance.addPostFr 阅读全文
posted @ 2023-04-27 01:11 c-若曦 阅读(39) 评论(0) 推荐(0)
摘要: 普通返回 Navigator.pop(context); 退出当前原生界面 SystemNavigator.pop(); 阅读全文
posted @ 2023-04-27 01:11 c-若曦 阅读(41) 评论(0) 推荐(0)
摘要: Flutter dp px相互转换 获取屏幕宽度 import 'dart:ui'; //屏幕宽度 window.physicalSize.width px //像素密度 单位 px/dp window.devicePixelRatio //屏幕宽度dp window.physicalSize.wi 阅读全文
posted @ 2023-04-27 01:10 c-若曦 阅读(311) 评论(0) 推荐(0)
摘要: diffCount =$(git rev-list "${commitId2}".."${commitId1}" --count) 获取两个commit 距离 最近的放后面 commitId1=$(git rev-parse --short HEAD) 获取最近一次commitID git rev- 阅读全文
posted @ 2023-04-27 01:09 c-若曦 阅读(49) 评论(0) 推荐(0)
摘要: MAC系统无法删除被锁文件 1.root也不行 2.也不能解锁 解决方案 chflags noschg zhetenga.com.txt 参考链接 https://www.zhetenga.com/view/mac%20osx%E5%88%A0%E9%99%A4%E6%96%87%E4%BB%B6% 阅读全文
posted @ 2023-04-27 01:09 c-若曦 阅读(28) 评论(0) 推荐(0)
摘要: shell git 查询分支是否存在 fun hasBranch(branch: String):Boolean { return !shell("git ls-remote --heads origin $branch",path).isNullOrEmpty() } 阅读全文
posted @ 2023-04-27 01:08 c-若曦 阅读(55) 评论(0) 推荐(0)
摘要: file=/dir1/dir2/dir3/my.file.txt 可以用${ }分别替换得到不同的值: ${file#/}:删掉第一个 / 及其左边的字符串:dir1/dir2/dir3/my.file.txt ${file##/}:删掉最后一个 / 及其左边的字符串:my.file.txt ${f 阅读全文
posted @ 2023-04-27 01:06 c-若曦 阅读(353) 评论(0) 推荐(0)