[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7195BJEHMYGC35TXN3VKG95":3,"skill-same:01M7195BJEHMYGC35TXN3VKG95":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":46,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M7195BJEHMYGC35TXN3VKG95","flutter-managing-state",null,"Manages application and ephemeral state in a Flutter app. Use when sharing data between widgets or handling complex UI state transitions.","openplaybooks-dev\u002Fconverge","openplaybooks-dev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F270560357?v=4","01M7191G17AHW5SXN63HJ0BEZV","01M7191G29922BDNWN8CFVG4PD",3,"MIT","https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev\u002Fconverge\u002Fblob\u002Fmain\u002Fexamples\u002Fflutter-app\u002F.converge\u002Fskills\u002Fflutter-managing-state\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34,35],"flutter","state","flutter managing state","app","use","when","transitions","widgets","sharing","data","flutter app","ui","application","2026-11-10 10:12:30",false,"---\nname: flutter-managing-state\ndescription: Manages application and ephemeral state in a Flutter app. Use when sharing data between widgets or handling complex UI state transitions.\n---\n# Managing State in Flutter\n\n## Contents\n- [Core Concepts](#core-concepts)\n- [Architecture and Data Flow](#architecture-and-data-flow)\n- [Workflow: Selecting a State Management Approach](#workflow-selecting-a-state-management-approach)\n- [Workflow: Implementing MVVM with Provider](#workflow-implementing-mvvm-with-provider)\n- [Examples](#examples)\n\n## Core Concepts\n\nFlutter's UI is declarative; it is built to reflect the current state of the app (`UI = f(state)`). When state changes, trigger a rebuild of the UI that depends on that state.\n\nDistinguish between two primary types of state:\n* **Ephemeral State (Local State):** State contained neatly within a single widget (e.g., current page in a `PageView`, current selected tab, animation progress). Manage this using a `StatefulWidget` and `setState()`.\n* **App State (Shared State):** State shared across multiple parts of the app and maintained between user sessions (e.g., user preferences, login info, shopping cart contents). Manage this using advanced approaches like `InheritedWidget`, the `provider` package, or Riverpod.\n\n## Architecture and Data Flow\n\nImplement **Unidirectional Data Flow (UDF)** for scalable app state management.\n\n* **Unidirectional Data Flow (UDF):** Enforce a strict flow where state flows *down* from the data layer, through the logic layer, to the UI layer. Events from user interactions flow *up* from the UI layer, to the logic layer, to the data layer.\n* **Single Source of Truth (SSOT):** Ensure data changes always happen in the data layer (Repositories\u002FProviders). The SSOT class must be the only class capable of modifying its respective data.\n* **Model (Data Layer):** Handle low-level tasks like HTTP requests, data caching, and system resources using Repository classes.\n* **ViewModel \u002F Provider (Logic Layer):** Manage the UI state. Convert app data from the Model into UI State. Call `notifyListeners()` (Provider) or update state (Riverpod) to trigger UI rebuilds when data changes.\n* **View (UI Layer):** Display the state provided by the ViewModel\u002FProvider. Keep views lean; they should contain minimal logic (only routing, animations, or simple UI conditionals).\n\n## Workflow: Selecting a State Management Approach\n\n* **If managing Ephemeral State (single widget scope):**\n  1. Subclass `StatefulWidget` and `State`.\n  2. Store mutable state as private fields within the `State` class.\n  3. Mutate state exclusively inside a `setState()` callback.\n\n* **If managing App State (shared across widgets):**\n  1. Implement providers (Riverpod or Provider package).\n  2. Use `ChangeNotifier` or Riverpod's `Notifier`\u002F`AsyncNotifier` to emit state updates.\n  3. Consume state in widgets using `Consumer`\u002F`ConsumerWidget` or `ref.watch()`.\n\n## Workflow: Implementing State with Riverpod\n\n1. Define the data model (Freezed classes or plain Dart).\n2. Create the provider (`@riverpod` annotation for code generation, or manual).\n3. Inject `ProviderScope` at the top of the widget tree.\n4. Consume state in widgets using `ConsumerWidget` and `ref.watch()`.\n5. Trigger mutations using `ref.read(provider.notifier).method()`.\n\n## Examples\n\n### Ephemeral State Implementation (`setState`)\n\n```dart\nclass EphemeralCounter extends StatefulWidget {\n  const EphemeralCounter({super.key});\n\n  @override\n  State\u003CEphemeralCounter> createState() => _EphemeralCounterState();\n}\n\nclass _EphemeralCounterState extends State\u003CEphemeralCounter> {\n  int _counter = 0;\n\n  void _increment() {\n    setState(() {\n      _counter++;\n    });\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return ElevatedButton(\n      onPressed: _increment,\n      child: Text('Count: $_counter'),\n    );\n  }\n}\n```\n\n### App State Implementation (Riverpod)\n\n```dart\n\u002F\u002F Provider\n@riverpod\nclass CartNotifier extends _$CartNotifier {\n  @override\n  List\u003CString> build() => [];\n\n  void addItem(String item) {\n    state = [...state, item];\n  }\n\n  void removeItem(String item) {\n    state = state.where((i) => i != item).toList();\n  }\n}\n\n\u002F\u002F View\nclass CartScreen extends ConsumerWidget {\n  const CartScreen({super.key});\n\n  @override\n  Widget build(BuildContext context, WidgetRef ref) {\n    final items = ref.watch(cartNotifierProvider);\n    return Scaffold(\n      body: ListView.builder(\n        itemCount: items.length,\n        itemBuilder: (_, index) => Text(items[index]),\n      ),\n      floatingActionButton: FloatingActionButton(\n        onPressed: () => ref.read(cartNotifierProvider.notifier).addItem('New Item'),\n        child: const Icon(Icons.add),\n      ),\n    );\n  }\n}\n```\n","# Managing State in Flutter\n\n## Contents\n- [Core Concepts](#core-concepts)\n- [Architecture and Data Flow](#architecture-and-data-flow)\n- [Workflow: Selecting a State Management Approach](#workflow-selecting-a-state-management-approach)\n- [Workflow: Implementing MVVM with Provider](#workflow-implementing-mvvm-with-provider)\n- [Examples](#examples)\n\n## Core Concepts\n\nFlutter's UI is declarative; it is built to reflect the current state of the app (`UI = f(state)`). When state changes, trigger a rebuild of the UI that depends on that state.\n\nDistinguish between two primary types of state:\n* **Ephemeral State (Local State):** State contained neatly within a single widget (e.g., current page in a `PageView`, current selected tab, animation progress). Manage this using a `StatefulWidget` and `setState()`.\n* **App State (Shared State):** State shared across multiple parts of the app and maintained between user sessions (e.g., user preferences, login info, shopping cart contents). Manage this using advanced approaches like `InheritedWidget`, the `provider` package, or Riverpod.\n\n## Architecture and Data Flow\n\nImplement **Unidirectional Data Flow (UDF)** for scalable app state management.\n\n* **Unidirectional Data Flow (UDF):** Enforce a strict flow where state flows *down* from the data layer, through the logic layer, to the UI layer. Events from user interactions flow *up* from the UI layer, to the logic layer, to the data layer.\n* **Single Source of Truth (SSOT):** Ensure data changes always happen in the data layer (Repositories\u002FProviders). The SSOT class must be the only class capable of modifying its respective data.\n* **Model (Data Layer):** Handle low-level tasks like HTTP requests, data caching, and system resources using Repository classes.\n* **ViewModel \u002F Provider (Logic Layer):** Manage the UI state. Convert app data from the Model into UI State. Call `notifyListeners()` (Provider) or update state (Riverpod) to trigger UI rebuilds when data changes.\n* **View (UI Layer):** Display the state provided by the ViewModel\u002FProvider. Keep views lean; they should contain minimal logic (only routing, animations, or simple UI conditionals).\n\n## Workflow: Selecting a State Management Approach\n\n* **If managing Ephemeral State (single widget scope):**\n  1. Subclass `StatefulWidget` and `State`.\n  2. Store mutable state as private fields within the `State` class.\n  3. Mutate state exclusively inside a `setState()` callback.\n\n* **If managing App State (shared across widgets):**\n  1. Implement providers (Riverpod or Provider package).\n  2. Use `ChangeNotifier` or Riverpod's `Notifier`\u002F`AsyncNotifier` to emit state updates.\n  3. Consume state in widgets using `Consumer`\u002F`ConsumerWidget` or `ref.watch()`.\n\n## Workflow: Implementing State with Riverpod\n\n1. Define the data model (Freezed classes or plain Dart).\n2. Create the provider (`@riverpod` annotation for code generation, or manual).\n3. Inject `ProviderScope` at the top of the widget tree.\n4. Consume state in widgets using `ConsumerWidget` and `ref.watch()`.\n5. Trigger mutations using `ref.read(provider.notifier).method()`.\n\n## Examples\n\n### Ephemeral State Implementation (`setState`)\n\n```dart\nclass EphemeralCounter extends StatefulWidget {\n  const EphemeralCounter({super.key});\n\n  @override\n  State\u003CEphemeralCounter> createState() => _EphemeralCounterState();\n}\n\nclass _EphemeralCounterState extends State\u003CEphemeralCounter> {\n  int _counter = 0;\n\n  void _increment() {\n    setState(() {\n      _counter++;\n    });\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return ElevatedButton(\n      onPressed: _increment,\n      child: Text('Count: $_counter'),\n    );\n  }\n}\n```\n\n### App State Implementation (Riverpod)\n\n```dart\n\u002F\u002F Provider\n@riverpod\nclass CartNotifier extends _$CartNotifier {\n  @override\n  List\u003CString> build() => [];\n\n  void addItem(String item) {\n    state = [...state, item];\n  }\n\n  void removeItem(String item) {\n    state = state.where((i) => i != item).toList();\n  }\n}\n\n\u002F\u002F View\nclass CartScreen extends ConsumerWidget {\n  const CartScreen({super.key});\n\n  @override\n  Widget build(BuildContext context, WidgetRef ref) {\n    final items = ref.watch(cartNotifierProvider);\n    return Scaffold(\n      body: ListView.builder(\n        itemCount: items.length,\n        itemBuilder: (_, index) => Text(items[index]),\n      ),\n      floatingActionButton: FloatingActionButton(\n        onPressed: () => ref.read(cartNotifierProvider.notifier).addItem('New Item'),\n        child: const Icon(Icons.add),\n      ),\n    );\n  }\n}\n```\n",{"name":5,"description":7},"main","7d618d8bc059f1a0974706d1d15ec25f73cf1e1d","examples\u002Fflutter-app\u002F.converge\u002Fskills\u002Fflutter-managing-state",1,"https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev\u002Fconverge","https:\u002F\u002Fplaybooks.to","https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev","2026-06-13 10:11:21",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add openplaybooks-dev\u002Fconverge --skill flutter-managing-state",{"tool":55,"command":56},"bunx","bunx skills add openplaybooks-dev\u002Fconverge --skill flutter-managing-state",{"tool":58,"command":59},"pnpm","pnpm dlx skills add openplaybooks-dev\u002Fconverge --skill flutter-managing-state","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev\u002Fconverge\u002Fblob\u002Fmain\u002Fexamples\u002Fflutter-app\u002F.converge\u002Fskills\u002Fflutter-managing-state\u002FSKILL.md",true,[],[64,86,95,117,142,170],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":71,"publishedAt":36},"01M71989MQF3GPZ7P5TX6S93PD","hello-checker","Use this skill when asked to \"verify\", \"check\", or \"validate\" a file's existence and content. It provides a reliable workflow for confirming files meet their spec.","https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev\u002Fconverge\u002Fblob\u002Fmain\u002Ftests\u002Ftest-codex-real\u002F.converge\u002Fskills\u002Fhello-checker\u002FSKILL.md",[70],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[72,73,74,75,27,76,77,78,79,80,81,82,28,83,84,85],"checker","hello checker","hello","it","content","validate","spec","verify","check","file","workflow","Meet","files","for",{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":92,"publishedAt":36},"01M7198823W79B3S15TPV97TCB","ask-skill","https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev\u002Fconverge\u002Fblob\u002Fmain\u002Ftests\u002Ftest-ask-autonomous\u002F.converge\u002Fplaybooks\u002Fdefault\u002Fskills\u002Fask-skill\u002FSKILL.md",[91],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[93,94],"ask skill","ask",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":105,"publishedAt":36},"01M71986EJ6VCM8YKGEM2YEDQV","html-review-artifact","Framework-wide guidance for crafting polished human-review artifacts as markdown or HTML","https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev\u002Fconverge\u002Fblob\u002Fmain\u002Fskills\u002Fhtml-review-artifact\u002FSKILL.md",[101,104],{"categoryNo":102,"categoryName":103,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[106,107,108,109,110,85,111,112,113,114,115,116],"html","artifact","review","html review artifact","as","framework","wide","guidance","markdown","human","artifacts",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":124,"publishedAt":36},"01M719833M2XWXG1VPBW30GW7J","converge-planning","Design a Converge playbook end-to-end. Use when the user says \"plan a project\", \"design a playbook\", \"decompose into tasks\", \"scaffold a Converge workflow\", \"onboard to Converge\", or asks how to write TASK.md \u002F playbook.yml. Two entry points: plan a new playbook or update an existing one. Hand off to `\u002Fconverge-control` after producing the playbook structure.","https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev\u002Fconverge\u002Fblob\u002Fmain\u002Fskills\u002Fconverge-planning\u002FSKILL.md",[123],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[125,126,127,128,82,129,27,130,131,132,133,134,135,136,137,138,139,140,141,28],"converge","converge planning","planning","structure","tasks","decompose","hand","write","plan","how","update","playbook","new","design","how to","end","project",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":154,"publishedAt":36},"01M7197XZT1T9GDYAJGVGX1J60","converge-control","Operate a Converge playbook end-to-end — start runs, monitor progress, narrow failures with `--select`, inspect runtime state, validate definitions, surgically reset subtrees, and stop stuck or orphaned runs. Use this skill whenever the user says \"run my playbook\", \"execute this\", \"monitor the run\", \"converge failed\", \"the run is stuck\", \"retry failures\", \"babysit this playbook\", \"what's the status?\", \"show me the gantt\", or asks how to use `converge run` \u002F `--select` \u002F `inspect` \u002F `doctor` \u002F `clean` \u002F `stop`. Also use it for `HTTP 401` \u002F `Invalid API key` failures on the first task — those are environment-not-playbook problems — and for any post-run cleanup work. Hand off to `converge-planning` if the user wants to design or restructure the playbook itself.","https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev\u002Fconverge\u002Fblob\u002Fmain\u002Fskills\u002Fconverge-control\u002FSKILL.md",[148,149],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":150,"categoryName":151,"taxonomyType":152,"taxonomyTypeDesc":153},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[155,156,125,157,158,159,160,161,162,163,131,164,165,138,139,166,140,167,168,169],"converge control","control","operate","invalid","show","api","me","work","reset","show me","cleanup","clean","inspect","select","retry",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":177,"publishedAt":36},"01M7197SCVN0QTD3CM4M83WYJH","repair-taskts","Fix task.ts definition issues — Seed syntax, missing .build(), empty checks, import errors, TypeScript errors","https:\u002F\u002Fgithub.com\u002Fopenplaybooks-dev\u002Fconverge\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fnavigator\u002Frepair\u002Fskill-templates\u002Frepair-taskts\u002FSKILL.md",[176],{"categoryNo":150,"categoryName":151,"taxonomyType":152,"taxonomyTypeDesc":153},[178,179,180,181,132,182,183,184,185,186,187,188,189,190,191,140,192,125,193,194],"repair taskts","repair","Bash","edit","read","line","at","spawn","code","analysis","number","errors","issues","fix","chain","definition","never"]