-
-
Notifications
You must be signed in to change notification settings - Fork 189
Synced newly added hooks to the zh_doc #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughRenames and standardizes Chinese section/column headers in the Flutter Hooks Chinese README, refines hook descriptions across groups, updates phrasing, adjusts grouping titles, and adds multiple new hook entries in the “杂项” section. No code or API changes; documentation text only. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/flutter_hooks/resources/translations/zh_cn/README.md (1)
95-95: Fix wrong GitHub org in anchor link.此处“已有的钩子”锚点链接到个人 fork(Cierra-Runis)。应指向官方仓库 rrousselGit。
Apply this diff:
-[已有的钩子](https://github.com/Cierra-Runis/flutter_hooks/blob/master/packages/flutter_hooks/resources/translations/zh_cn/README.md#%E5%B7%B2%E6%9C%89%E7%9A%84%E9%92%A9%E5%AD%90) +[已有的钩子](https://github.com/rrousselGit/flutter_hooks/blob/master/packages/flutter_hooks/resources/translations/zh_cn/README.md#%E5%B7%B2%E6%9C%89%E7%9A%84%E9%92%A9%E5%AD%90)
🧹 Nitpick comments (3)
packages/flutter_hooks/resources/translations/zh_cn/README.md (3)
297-301: Polish the group title and punctuation/wording.
- 建议把“Object-binding”中的连字符去掉,以与英文 README 对齐。
- 将“dispose”本地化为“释放”,并补齐标点,读起来更自然。
Apply this diff:
-### 对象绑定(Object-binding) +### 对象绑定(Object binding) -这类钩子用于操作现有的 Flutter 及 Dart 对象\ -它们负责创建、更新以及 dispose 对象 +这类钩子用于操作现有的 Flutter 与 Dart 对象。\ +它们负责创建、更新以及释放这些对象。
313-318: Unify phrasing for auto-dispose.与下方“杂项”中“创建并自动释放一个 …”的表述保持一致:
-| [useAnimationController](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useAnimationController.html) | 创建并会自动释放的 `AnimationController` | +| [useAnimationController](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useAnimationController.html) | 创建并自动释放一个 `AnimationController` |
331-359: Misc hooks: fix a few link/wording issues and note deprecation.
- usePrevious:更精确地说明返回“上一次传入的值”。
- useDraggableScrollableController:为一致性建议链接到该 Hook 的 API 文档,而非 Flutter 类文档;并统一“创建并自动释放一个 …”表述。(该 Hook 于 2024-07-08 加入。)
- 若这些 Hook 会自动释放,请统一表述为“创建并自动释放一个 …”:useExpansibleController、useTreeSliverController。
- useIsMounted 已在 2024-02-05 标记弃用,建议在中文表格里提示替代方案。
Apply this diff:
-| [usePrevious](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/usePrevious.html) | 返回上一次调用 `usePrevious` 时的参数 | +| [usePrevious](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/usePrevious.html) | 返回上一次传入的值 | @@ -| [useExpansibleController](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useExpansibleController.html) | 创建一个 `ExpansibleController` | +| [useExpansibleController](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useExpansibleController.html) | 创建并自动释放一个 `ExpansibleController` | -| [useDraggableScrollableController](https://api.flutter.dev/flutter/widgets/DraggableScrollableController-class.html) | 创建一个 `DraggableScrollableController` | +| [useDraggableScrollableController](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useDraggableScrollableController.html) | 创建并自动释放一个 `DraggableScrollableController` | @@ -| [useTreeSliverController](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useTreeSliverController.html) | 创建一个 `TreeSliverController` | +| [useTreeSliverController](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useTreeSliverController.html) | 创建并自动释放一个 `TreeSliverController` | @@ -| [useIsMounted](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useIsMounted.html) | Hook 版本的 `State.mounted` | +| [useIsMounted](https://pub.dev/documentation/flutter_hooks/latest/flutter_hooks/useIsMounted.html) | Hook 版本的 `State.mounted`(已弃用,推荐改用 `BuildContext.mounted`) |Rationales:
- useDraggableScrollableController/useTreeSliverController 等为 flutter_hooks 新增 Hook;链接到包内 API 更一致。(pub.dev)
- useCarouselController/useSnapshotController 的 API 页面已存在,当前用法正确。(pub.dev)
- useOverlayPortalController 的 API 页面已存在,当前用法正确。(pub.dev)
- useIsMounted 已宣布弃用,应提示替代方案。(pub.dev)
请同时确认以下链接当前是否可用(避免读者 404):
- useDraggableScrollableController(flutter_hooks 文档页)
- useTreeSliverController(flutter_hooks 文档页)
- useCupertinoController(flutter_hooks 文档页)
如果需要,我可以附上一个小脚本批量检查这些 URL 的可达性。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/flutter_hooks/resources/translations/zh_cn/README.md(1 hunks)
🔇 Additional comments (4)
packages/flutter_hooks/resources/translations/zh_cn/README.md (4)
279-286: Section title rename reads well.“已有的 Hook” 标题与全文用语更一致。无需改动。
287-296: Primitives table looks consistent.列头统一为“描述”,各条定义清晰。无需改动。
304-310: Async hooks table LGTM.描述准确(返回 AsyncSnapshot、自动释放/返回订阅等)。无需改动。
321-327: Listenable hooks table LGTM.措辞统一、准确。无需改动。
|
Thanks! |
Summary by CodeRabbit