吴景华技术博客 记录、分享经验

mobile_scanner

识别一维/二维码目前用了多个模块中最好用的,在安卓中内部使用的是MLKit的barcode scanning捆绑版本,APP体积增加约3~10M。 google官方提供了barcode scanner但是没有捆绑版本(必须有谷歌套件)。 MLKit官方网址:https://developers.go

Administrator Published on 2025-06-09

开始写应用

修改应用图标 flutter pub add flutter_launcher_icons dart run flutter_launcher_icons:generate #在项目根目录中运行,生成默认配置模版flutter_launcher_icons.yaml #修改其中的image_pa

Administrator Published on 2025-06-08

http

请求API、上传文件等 链接:https://pub.dev/packages/http 引入依赖 pubspec.yaml dependencies: http: ^1.4.0 http_parser: ^4.1.2 get请求 var response = await http.

Administrator Published on 2025-06-08

dart语法

flutter开发必学的编程语言 变量&常量 var和变量类型不能同时存在 var name = "alice"; // 变量,自动推断为String类型 final int age = 18; //不可变变量 const double PI = 3.1415926; // 编绎时常量 late S

Administrator Published on 2025-06-06

expo-router

依赖 npx expo install expo-router 会自动在app.json的expo.plugin中添加 手动将package.json中的main替换为:expo-router/entry 基本 文件即路由 app下的所有目录和文件会自动解析为路由 存在一个目录下有_layout时,

Administrator Published on 2025-05-30

第一步

安装Android Studio 开发不使用这个IDE,用它安装AVD、SDK、tools等 所需的版本会随着版本更新而不同,具体安装什么版本的sdk可以查看rn官网页面:https://reactnative.dev/docs/next/set-up-your-environment?os=win

Administrator Published on 2025-05-27

LocalFocusManager和LocalSoftwareKeyboardController

LocalFocusManager 清除或移动焦点 val focusRequester = remember { FocusRequester() } var focusManager = LocalFocusManager.current LaunchedEffect(isShow) {

Administrator Published on 2025-04-27

androidx.compose.ui:ui-graphics-android

Brush相关文档 Brush 刷子,用于创建纹理和渐变图像 linearGradient start和end的取值范围和元素大小有关,下面的Box为200dp所以用with(LocalDensity.current) { 200.dp.toPx() }转成了Float

Administrator Published on 2025-03-26

开发疑难解决方法(合集)

更新compose版本 仓库地址:https://maven.google.com/web/index.html?q=androidx.compose.#androidx.compose.ui:ui-android:1.8.1 查看最新版本并复制Gradle Kotlin DSL,如:impleme

Administrator Published on 2025-03-26
Previous Next