一键导入
upgrade-flutter-gemma
Upgrade flutter_gemma dependency — discover API changes, fix compilation, support new features, update tests, bump version
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Upgrade flutter_gemma dependency — discover API changes, fix compilation, support new features, update tests, bump version
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | upgrade-flutter-gemma |
| description | Upgrade flutter_gemma dependency — discover API changes, fix compilation, support new features, update tests, bump version |
Follow these 5 phases sequentially. Do not skip phases. Ask the user before making decisions about new features (Phase 3).
dart pub outdated to identify the available flutter_gemma versionflutter_gemma version in both:
pubspec.yamlexample/pubspec.yamlflutter pub getfind ~/.pub-cache/hosted/pub.dev -maxdepth 1 -name "flutter_gemma-*" | sort
Then read the CHANGELOG.md from the latest version directory.Run dart analyze
Fix all compilation errors. These typically appear in:
Checklist of files that depend on flutter_gemma API:
lib/src/flutter_gemma_runtime.dart — FlutterGemma.getActiveModel(), FlutterGemma.getActiveEmbedder() signatureslib/src/flutter_gemma_model.dart — InferenceModel.createChat() signature, ModelResponse pattern matching, InferenceChat methodslib/src/flutter_gemma_embedder.dart — EmbeddingModel.generateEmbeddings() signature, PreferredBackend enumlib/src/converters/request_converter.dart — Message constructors (.withImage, .withAudio, .toolCall, .toolResponse)lib/src/converters/response_converter.dart — ModelResponse subtypes (TextResponse, FunctionCallResponse, ParallelFunctionCallResponse, ThinkingResponse)lib/src/converters/tool_converter.dart — Tool constructorlib/src/flutter_gemma_plugin.dart — ModelType, ModelFileType enumstest/src/fake_runtime.dart — FakeInferenceModel, FakeInferenceChat, FakeEmbeddingModel must match upstream abstract class signaturesRepeat dart analyze until clean (0 issues)
Based on the CHANGELOG from Phase 1, decide with the user which new APIs to support.
For each new feature, the typical integration points are:
createChat() or createSession()$FlutterGemmaModelOptions in lib/src/flutter_gemma_options.dartlib/src/flutter_gemma_options.g.dart:
@overridefromJson parsingtoJson serializationjsonSchema() property entrylib/src/flutter_gemma_model.dart (_executeGeneration)FakeInferenceModel.createChat() in test/src/fake_runtime.dart — add parameter, store in last* field for test assertionsModelFileType)lib/src/flutter_gemma_plugin.dart (FlutterGemmaModelConfig.fileType)InferenceChat or InferenceModelFakeInferenceChat or FakeInferenceModel in test/src/fake_runtime.dartsupports map in lib/src/flutter_gemma_plugin.dart (list() method, ~line 123)lib/src/converters/extractSystemInstruction() if system message handling changedIMPORTANT: The .g.dart file is manually maintained (build_runner is broken). Always update it by hand when changing the schema.
flutter test — all tests must pass/pr-review-toolkit:review-pr for comprehensive reviewpubspec.yaml:
0.1.1 → 0.2.0) if there are breaking behavioral changes0.1.1 → 0.1.2) if only bug fixes / non-breaking additionsCHANGELOG.md — add new version section at the top with:
**Breaking**:)README.md:
dart analyze
flutter test
dart pub publish --dry-run
All must pass cleanly.feature/flutter-gemma-X.Y.Z)