SuperAPI AI 工具集

custom-plugin-flutter-skill-navigation

通用与其它

查看项目

更新于 10-16 03:43

技能介绍

用途:面向 Flutter 应用的导航方案技能,帮助开发者掌握从命令式到声明式路由的完整导航体系,并落地生产级配置。

主要能力:

  1. Navigator 1.0 命令式导航:push、pop、pushAndRemoveUntil、pushReplacement、命名路由、onGenerateRoute、onUnknownRoute 与参数传递。
  2. Navigator 2.0 声明式导航:RouterDelegate、RouteInformationParser、pages 与 onPopPage 的完整实现。
  3. GoRouter:initialLocation、debugLogDiagnostics、refreshListenable、redirect、errorBuilder、GoRoute、ShellRoute 配置,以及 context.go、context.push、context.goNamed、context.pop 用法。
  4. 嵌套导航:ShellRoute 配合底部导航栏,parentNavigatorKey 控制全屏路由。
  5. 路由守卫与重定向:登录、引导流程、公开路由白名单与 redirect 参数回跳。
  6. 深链接:iOS Universal Links(Runner.entitlements 的 associated-domains)、Android App Links(AndroidManifest.xml 的 intent-filter),以及 app_links 手动处理 uriLinkStream 与 getInitialAppLink。
  7. 查询参数与 extras:queryParameters 读取、extra 类型安全传参。
  8. 排错指南:深链接失效、路由未找到、返回键异常、导航状态丢失的排查步骤。
  9. 导航模式选择表:简单应用、Web/深链接、复杂流程、Tab 导航、鉴权守卫、模态页面分别对应方案。

使用方式:按资料中的代码示例配置 router.dart 与 main.dart,使用 MaterialApp.router 接入 routerConfig;深链接需配置平台清单文件与 .well-known 校验文件。

适用场景:需要 Web URL 支持、深链接、鉴权跳转、Tab 嵌套导航的 Flutter 应用。

限制:资料未提供该技能的安装命令、版本要求、收费方式与平台支持范围,暂未提供。