根因:_syncCacheAfterBuild 调用 _cache.syncStrokes() 后没有触发 setState,导致 CachedStrokesPainter 不知道缓存已更新,不执行重绘。 对比正常绘画流程(addStroke 后有 setState),加载笔迹流程遗漏了 重绘触发。添加 .then(() => setState) 后,合成图重建完成即刷新画布。
nuanji_app
A new Flutter project.
Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.