摘要: 1. Dart是代码类型安全的语言,但可用var定义而不用显示指定 2. Dart的流程控制语句 if...else if for (final item in items) while() 3. Dart建议为每个函数参数和返回值都指定类型 4. 胖箭头 => 用于仅包含一条语句的函数,该语法在将 阅读全文
posted @ 2025-11-09 14:37 呢哇哦比较 阅读(1) 评论(0) 推荐(0)
摘要: 邮箱正则 bool _isValidEmail(String text) { return RegExp( r'(?<name>[a-zA-Z0-9]+)' r'@' r'(?<domain>[a-zA-Z0-9]+)' r'\.' r'(?<topLevelDomain>[a-zA-Z0-9]+) 阅读全文
posted @ 2025-09-01 16:07 呢哇哦比较 阅读(5) 评论(0) 推荐(0)
摘要: 直接获取国外的资源包 python3 -m pip install 包名 使用国内镜像获取资源包 阿里云镜像 python3 -m pip install -i https://mirrors.aliyun.com/pypi/simple/ 包名 豆瓣镜像 python3 -m pip instal 阅读全文
posted @ 2025-08-12 11:36 呢哇哦比较 阅读(12) 评论(0) 推荐(0)
摘要: 1.获取所有的文件夹和文件-递归 def get_all_contents_recursive(folder_path): """ 递归获取文件夹下所有子文件夹和文件 返回: {"子文件夹": [路径列表], "文件": [路径列表]} """ result = {"子文件夹": [], "文件": 阅读全文
posted @ 2025-08-12 11:33 呢哇哦比较 阅读(7) 评论(0) 推荐(0)
摘要: 1.更换图片的颜色,包括 jpg png gif svg # jpg,png替换 from PIL import Image , ImageSequence import numpy as np from scipy.ndimage import binary_erosion, binary_dil 阅读全文
posted @ 2025-08-12 11:31 呢哇哦比较 阅读(18) 评论(0) 推荐(0)
摘要: > 所有的State类型部件都可通过其GlobalKey去调用里面的方法 final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>(); _scaffoldKey.currentState!.openDrawer() 阅读全文
posted @ 2025-07-11 15:30 呢哇哦比较 阅读(25) 评论(0) 推荐(0)
摘要: 依赖 dependencies: get: 导入 import 'package:get/get.dart'; 1.全局配置 MaterialApp --》 GetMaterialApp GetMaterialApp不是使用Get的必要项 如果你只是使用 Get 进行状态管理或依赖管理,则不需要使用 阅读全文
posted @ 2025-07-05 16:46 呢哇哦比较 阅读(127) 评论(0) 推荐(0)
摘要: Future<bool> loopRequest({final loopCount = 5}) async { int count = 0; bool b = false; await Future.doWhile(() async { ++count; try { bool result = aw 阅读全文
posted @ 2025-07-02 16:20 呢哇哦比较 阅读(5) 评论(0) 推荐(0)
摘要: void main() async { CancelableTask<String> cancelableTask = CancelableTask(); cancelableTask.startTask(operater()).then((value) { print("yyyyy:$value" 阅读全文
posted @ 2025-07-02 15:57 呢哇哦比较 阅读(17) 评论(0) 推荐(0)
摘要: class NBLoading{ static OverlayEntry? _entry; static Widget? _showWidget; static void show(BuildContext context,Widget widget){ _showWidget = widget; 阅读全文
posted @ 2025-07-01 17:57 呢哇哦比较 阅读(6) 评论(0) 推荐(0)