[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-flutter-create-catalog-item":3,"mdc-x9v5gk-key":34,"related-repo-flutter-create-catalog-item":1208,"related-org-flutter-create-catalog-item":1231},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":30,"sourceUrl":32,"mdContent":33},"create-catalog-item","create Flutter UI components from JSON Schema","Use this skill when the user asks to create a new CatalogItem, data class, and\u002For widget class based on a JSON Schema definition in an application that uses Flutter's `genui` package.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"flutter","Flutter (Google)","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fflutter.png",[12,15,18,21],{"name":13,"slug":8,"type":14},"Flutter","tag",{"name":16,"slug":17,"type":14},"Dart","dart",{"name":19,"slug":20,"type":14},"UI Components","ui-components",{"name":22,"slug":23,"type":14},"Frontend","frontend",1703,"https:\u002F\u002Fgithub.com\u002Fflutter\u002Fgenui","2026-04-16T05:04:51.027381",null,159,[],{"repoUrl":25,"stars":24,"forks":28,"topics":31,"description":27},[],"https:\u002F\u002Fgithub.com\u002Fflutter\u002Fgenui\u002Ftree\u002FHEAD\u002Fpackages\u002Fgenui\u002Fskills\u002Fcreate-catalog-item","---\nname: create-catalog-item\ndescription: Use this skill when the user asks to create a new CatalogItem, data class, and\u002For widget class based on a JSON Schema definition in an application that uses Flutter's `genui` package.\n---\n\n# Create CatalogItem\n\n## Goal\nTo correctly implement a GenUI CatalogItem based on a provided json_schema_builder Schema, including its corresponding data class, CatalogItem instance, and Widget class. This ensures the AI model can properly generate and interact with the UI component.\n\n## Instructions\nWhen tasked with creating a CatalogItem from a `Schema`, follow these steps:\n\n1. **Create the Data Class**:\n   - Name it `_\u003CSchemaName>Data` (e.g., if schema is `myCardSchema`, data class is `_MyCardData`).\n   - Add final fields for each property defined in the schema.\n   - Create a `factory _\u003CSchemaName>Data.fromJson(Map\u003CString, Object?> json)` method.\n   - Use a `try-catch` block to parse the properties and return a new instance.\n   - Cast each property from the `json` map to its expected type, e.g., `title: json['title'] as String,` or `action: json['action'] as JsonMap?,`.\n   - Throw an `Exception('Invalid JSON for _\u003CSchemaName>Data')` in the `catch` block if an error occurs.\n\n2. **Create the CatalogItem Instance**:\n   - Name it identical to the schema name but without the \"Schema\" suffix (e.g., `myCard` for `myCardSchema`).\n   - Declare as a `final CatalogItem`.\n   - Set `name` to the capitalized version of the name (e.g., `'MyCard'`).\n   - Set `dataSchema` to the provided schema.\n   - Implement the `widgetBuilder: (itemContext)`:\n     - Cast `itemContext.data` to `Map\u003CString, Object?>`.\n     - Parse the data using the data class `fromJson` method: `_\u003CSchemaName>Data.fromJson(json)`.\n     - Return the corresponding Widget class and pass the required data.\n     - If the schema includes an action callback (like `onCompleted`), implement it here. You must parse the action context using `resolveContext` and dispatch an event using `itemContext.dispatchEvent(...)`.\n\n3. **Create the Widget Class**:\n   - Name it `_\u003CCapitalizedSchemaName>` (e.g., `_MyCard`).\n   - Inherit from `StatelessWidget` or `StatefulWidget` depending on state requirements.\n   - Add the Data Class as a required property (e.g., `final _\u003CSchemaName>Data data;`).\n   - Add any required callback properties (e.g., `final void Function(int) onCompleted;`).\n   - Implement the `build` method using Flutter Material components (e.g., Card, Column, Text). Make sure each data field in the data class is displayed, and that actions are represented by buttons or other interactive elements.\n\n## Examples\n### Input Schema\n```dart\nfinal basicCardSchema = S.object(\n  properties: {\n    'component': S.string(enumValues: ['BasicCard']),\n    'title': S.string(),\n    'description': \n    'action': A2uiSchemas.action(),\n  },\n  required: ['title'],\n);\n```\n\n### Expected Output\n```dart\nclass _BasicCardData {\n  final String title;\n  final JsonMap? action;\n\n  _BasicCardData({required this.title, this.action});\n\n  factory _BasicCardData.fromJson(Map\u003CString, Object?> json) {\n    try {\n      return _BasicCardData(\n        title: json['title'] as String,\n        action: json['action'] as JsonMap?,\n      );\n    } catch (e) {\n      throw Exception('Invalid JSON for _BasicCardData: $e');\n    }\n  }\n}\n\nfinal basicCard = CatalogItem(\n  name: 'BasicCard',\n  dataSchema: basicCardSchema,\n  widgetBuilder: (itemContext) {\n    final json = itemContext.data as Map\u003CString, Object?>;\n    final data = _BasicCardData.fromJson(json);\n\n    return _BasicCard(\n      data: data,\n      onTap: () async {\n        final action = data.action;\n        if (action == null) return;\n        final event = action['event'] as JsonMap?;\n        final name = (event?['name'] as String?) ?? '';\n        final JsonMap contextDefinition =\n            (event?['context'] as JsonMap?) ?? \u003CString, Object?>{};\n        final JsonMap resolvedContext = await resolveContext(\n          itemContext.dataContext,\n          contextDefinition,\n        );\n        itemContext.dispatchEvent(\n          UserActionEvent(\n            name: name,\n            sourceComponentId: itemContext.id,\n            context: resolvedContext,\n          ),\n        );\n      }\n    );\n  },\n);\n\nclass _BasicCard extends StatelessWidget {\n  final _BasicCardData data;\n  final VoidCallback onTap;\n\n  const _BasicCard({super.key, required this.data, required this.onTap});\n\n  @override\n  Widget build(BuildContext context) {\n    return Card(\n      child: ListTile(\n        title: Text(data.title),\n        onTap: onTap,\n      ),\n    );\n  }\n}\n```\n\n## Constraints\n- Ensure proper use of `try-catch` blocks and type casting when parsing JSON in `fromJson`.\n- Make sure action resolution accurately fetches variables via `resolveContext` and uses `itemContext.dispatchEvent` when actions are present in the Schema.\n",{"data":35,"body":36},{"name":4,"description":6},{"type":37,"children":38},"root",[39,48,55,61,67,81,462,468,475,568,574,1155,1161,1202],{"type":40,"tag":41,"props":42,"children":44},"element","h1",{"id":43},"create-catalogitem",[45],{"type":46,"value":47},"text","Create CatalogItem",{"type":40,"tag":49,"props":50,"children":52},"h2",{"id":51},"goal",[53],{"type":46,"value":54},"Goal",{"type":40,"tag":56,"props":57,"children":58},"p",{},[59],{"type":46,"value":60},"To correctly implement a GenUI CatalogItem based on a provided json_schema_builder Schema, including its corresponding data class, CatalogItem instance, and Widget class. This ensures the AI model can properly generate and interact with the UI component.",{"type":40,"tag":49,"props":62,"children":64},{"id":63},"instructions",[65],{"type":46,"value":66},"Instructions",{"type":40,"tag":56,"props":68,"children":69},{},[70,72,79],{"type":46,"value":71},"When tasked with creating a CatalogItem from a ",{"type":40,"tag":73,"props":74,"children":76},"code",{"className":75},[],[77],{"type":46,"value":78},"Schema",{"type":46,"value":80},", follow these steps:",{"type":40,"tag":82,"props":83,"children":84},"ol",{},[85,211,375],{"type":40,"tag":86,"props":87,"children":88},"li",{},[89,95,97],{"type":40,"tag":90,"props":91,"children":92},"strong",{},[93],{"type":46,"value":94},"Create the Data Class",{"type":46,"value":96},":",{"type":40,"tag":98,"props":99,"children":100},"ul",{},[101,130,135,148,161,190],{"type":40,"tag":86,"props":102,"children":103},{},[104,106,112,114,120,122,128],{"type":46,"value":105},"Name it ",{"type":40,"tag":73,"props":107,"children":109},{"className":108},[],[110],{"type":46,"value":111},"_\u003CSchemaName>Data",{"type":46,"value":113}," (e.g., if schema is ",{"type":40,"tag":73,"props":115,"children":117},{"className":116},[],[118],{"type":46,"value":119},"myCardSchema",{"type":46,"value":121},", data class is ",{"type":40,"tag":73,"props":123,"children":125},{"className":124},[],[126],{"type":46,"value":127},"_MyCardData",{"type":46,"value":129},").",{"type":40,"tag":86,"props":131,"children":132},{},[133],{"type":46,"value":134},"Add final fields for each property defined in the schema.",{"type":40,"tag":86,"props":136,"children":137},{},[138,140,146],{"type":46,"value":139},"Create a ",{"type":40,"tag":73,"props":141,"children":143},{"className":142},[],[144],{"type":46,"value":145},"factory _\u003CSchemaName>Data.fromJson(Map\u003CString, Object?> json)",{"type":46,"value":147}," method.",{"type":40,"tag":86,"props":149,"children":150},{},[151,153,159],{"type":46,"value":152},"Use a ",{"type":40,"tag":73,"props":154,"children":156},{"className":155},[],[157],{"type":46,"value":158},"try-catch",{"type":46,"value":160}," block to parse the properties and return a new instance.",{"type":40,"tag":86,"props":162,"children":163},{},[164,166,172,174,180,182,188],{"type":46,"value":165},"Cast each property from the ",{"type":40,"tag":73,"props":167,"children":169},{"className":168},[],[170],{"type":46,"value":171},"json",{"type":46,"value":173}," map to its expected type, e.g., ",{"type":40,"tag":73,"props":175,"children":177},{"className":176},[],[178],{"type":46,"value":179},"title: json['title'] as String,",{"type":46,"value":181}," or ",{"type":40,"tag":73,"props":183,"children":185},{"className":184},[],[186],{"type":46,"value":187},"action: json['action'] as JsonMap?,",{"type":46,"value":189},".",{"type":40,"tag":86,"props":191,"children":192},{},[193,195,201,203,209],{"type":46,"value":194},"Throw an ",{"type":40,"tag":73,"props":196,"children":198},{"className":197},[],[199],{"type":46,"value":200},"Exception('Invalid JSON for _\u003CSchemaName>Data')",{"type":46,"value":202}," in the ",{"type":40,"tag":73,"props":204,"children":206},{"className":205},[],[207],{"type":46,"value":208},"catch",{"type":46,"value":210}," block if an error occurs.",{"type":40,"tag":86,"props":212,"children":213},{},[214,219,220],{"type":40,"tag":90,"props":215,"children":216},{},[217],{"type":46,"value":218},"Create the CatalogItem Instance",{"type":46,"value":96},{"type":40,"tag":98,"props":221,"children":222},{},[223,242,254,274,286],{"type":40,"tag":86,"props":224,"children":225},{},[226,228,234,236,241],{"type":46,"value":227},"Name it identical to the schema name but without the \"Schema\" suffix (e.g., ",{"type":40,"tag":73,"props":229,"children":231},{"className":230},[],[232],{"type":46,"value":233},"myCard",{"type":46,"value":235}," for ",{"type":40,"tag":73,"props":237,"children":239},{"className":238},[],[240],{"type":46,"value":119},{"type":46,"value":129},{"type":40,"tag":86,"props":243,"children":244},{},[245,247,253],{"type":46,"value":246},"Declare as a ",{"type":40,"tag":73,"props":248,"children":250},{"className":249},[],[251],{"type":46,"value":252},"final CatalogItem",{"type":46,"value":189},{"type":40,"tag":86,"props":255,"children":256},{},[257,259,265,267,273],{"type":46,"value":258},"Set ",{"type":40,"tag":73,"props":260,"children":262},{"className":261},[],[263],{"type":46,"value":264},"name",{"type":46,"value":266}," to the capitalized version of the name (e.g., ",{"type":40,"tag":73,"props":268,"children":270},{"className":269},[],[271],{"type":46,"value":272},"'MyCard'",{"type":46,"value":129},{"type":40,"tag":86,"props":275,"children":276},{},[277,278,284],{"type":46,"value":258},{"type":40,"tag":73,"props":279,"children":281},{"className":280},[],[282],{"type":46,"value":283},"dataSchema",{"type":46,"value":285}," to the provided schema.",{"type":40,"tag":86,"props":287,"children":288},{},[289,291,297,299],{"type":46,"value":290},"Implement the ",{"type":40,"tag":73,"props":292,"children":294},{"className":293},[],[295],{"type":46,"value":296},"widgetBuilder: (itemContext)",{"type":46,"value":298},":\n",{"type":40,"tag":98,"props":300,"children":301},{},[302,322,342,347],{"type":40,"tag":86,"props":303,"children":304},{},[305,307,313,315,321],{"type":46,"value":306},"Cast ",{"type":40,"tag":73,"props":308,"children":310},{"className":309},[],[311],{"type":46,"value":312},"itemContext.data",{"type":46,"value":314}," to ",{"type":40,"tag":73,"props":316,"children":318},{"className":317},[],[319],{"type":46,"value":320},"Map\u003CString, Object?>",{"type":46,"value":189},{"type":40,"tag":86,"props":323,"children":324},{},[325,327,333,335,341],{"type":46,"value":326},"Parse the data using the data class ",{"type":40,"tag":73,"props":328,"children":330},{"className":329},[],[331],{"type":46,"value":332},"fromJson",{"type":46,"value":334}," method: ",{"type":40,"tag":73,"props":336,"children":338},{"className":337},[],[339],{"type":46,"value":340},"_\u003CSchemaName>Data.fromJson(json)",{"type":46,"value":189},{"type":40,"tag":86,"props":343,"children":344},{},[345],{"type":46,"value":346},"Return the corresponding Widget class and pass the required data.",{"type":40,"tag":86,"props":348,"children":349},{},[350,352,358,360,366,368,374],{"type":46,"value":351},"If the schema includes an action callback (like ",{"type":40,"tag":73,"props":353,"children":355},{"className":354},[],[356],{"type":46,"value":357},"onCompleted",{"type":46,"value":359},"), implement it here. You must parse the action context using ",{"type":40,"tag":73,"props":361,"children":363},{"className":362},[],[364],{"type":46,"value":365},"resolveContext",{"type":46,"value":367}," and dispatch an event using ",{"type":40,"tag":73,"props":369,"children":371},{"className":370},[],[372],{"type":46,"value":373},"itemContext.dispatchEvent(...)",{"type":46,"value":189},{"type":40,"tag":86,"props":376,"children":377},{},[378,383,384],{"type":40,"tag":90,"props":379,"children":380},{},[381],{"type":46,"value":382},"Create the Widget Class",{"type":46,"value":96},{"type":40,"tag":98,"props":385,"children":386},{},[387,406,426,438,450],{"type":40,"tag":86,"props":388,"children":389},{},[390,391,397,399,405],{"type":46,"value":105},{"type":40,"tag":73,"props":392,"children":394},{"className":393},[],[395],{"type":46,"value":396},"_\u003CCapitalizedSchemaName>",{"type":46,"value":398}," (e.g., ",{"type":40,"tag":73,"props":400,"children":402},{"className":401},[],[403],{"type":46,"value":404},"_MyCard",{"type":46,"value":129},{"type":40,"tag":86,"props":407,"children":408},{},[409,411,417,418,424],{"type":46,"value":410},"Inherit from ",{"type":40,"tag":73,"props":412,"children":414},{"className":413},[],[415],{"type":46,"value":416},"StatelessWidget",{"type":46,"value":181},{"type":40,"tag":73,"props":419,"children":421},{"className":420},[],[422],{"type":46,"value":423},"StatefulWidget",{"type":46,"value":425}," depending on state requirements.",{"type":40,"tag":86,"props":427,"children":428},{},[429,431,437],{"type":46,"value":430},"Add the Data Class as a required property (e.g., ",{"type":40,"tag":73,"props":432,"children":434},{"className":433},[],[435],{"type":46,"value":436},"final _\u003CSchemaName>Data data;",{"type":46,"value":129},{"type":40,"tag":86,"props":439,"children":440},{},[441,443,449],{"type":46,"value":442},"Add any required callback properties (e.g., ",{"type":40,"tag":73,"props":444,"children":446},{"className":445},[],[447],{"type":46,"value":448},"final void Function(int) onCompleted;",{"type":46,"value":129},{"type":40,"tag":86,"props":451,"children":452},{},[453,454,460],{"type":46,"value":290},{"type":40,"tag":73,"props":455,"children":457},{"className":456},[],[458],{"type":46,"value":459},"build",{"type":46,"value":461}," method using Flutter Material components (e.g., Card, Column, Text). Make sure each data field in the data class is displayed, and that actions are represented by buttons or other interactive elements.",{"type":40,"tag":49,"props":463,"children":465},{"id":464},"examples",[466],{"type":46,"value":467},"Examples",{"type":40,"tag":469,"props":470,"children":472},"h3",{"id":471},"input-schema",[473],{"type":46,"value":474},"Input Schema",{"type":40,"tag":476,"props":477,"children":481},"pre",{"className":478,"code":479,"language":17,"meta":480,"style":480},"language-dart shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","final basicCardSchema = S.object(\n  properties: {\n    'component': S.string(enumValues: ['BasicCard']),\n    'title': S.string(),\n    'description': \n    'action': A2uiSchemas.action(),\n  },\n  required: ['title'],\n);\n","",[482],{"type":40,"tag":73,"props":483,"children":484},{"__ignoreMap":480},[485,496,505,514,523,532,541,550,559],{"type":40,"tag":486,"props":487,"children":490},"span",{"class":488,"line":489},"line",1,[491],{"type":40,"tag":486,"props":492,"children":493},{},[494],{"type":46,"value":495},"final basicCardSchema = S.object(\n",{"type":40,"tag":486,"props":497,"children":499},{"class":488,"line":498},2,[500],{"type":40,"tag":486,"props":501,"children":502},{},[503],{"type":46,"value":504},"  properties: {\n",{"type":40,"tag":486,"props":506,"children":508},{"class":488,"line":507},3,[509],{"type":40,"tag":486,"props":510,"children":511},{},[512],{"type":46,"value":513},"    'component': S.string(enumValues: ['BasicCard']),\n",{"type":40,"tag":486,"props":515,"children":517},{"class":488,"line":516},4,[518],{"type":40,"tag":486,"props":519,"children":520},{},[521],{"type":46,"value":522},"    'title': S.string(),\n",{"type":40,"tag":486,"props":524,"children":526},{"class":488,"line":525},5,[527],{"type":40,"tag":486,"props":528,"children":529},{},[530],{"type":46,"value":531},"    'description': \n",{"type":40,"tag":486,"props":533,"children":535},{"class":488,"line":534},6,[536],{"type":40,"tag":486,"props":537,"children":538},{},[539],{"type":46,"value":540},"    'action': A2uiSchemas.action(),\n",{"type":40,"tag":486,"props":542,"children":544},{"class":488,"line":543},7,[545],{"type":40,"tag":486,"props":546,"children":547},{},[548],{"type":46,"value":549},"  },\n",{"type":40,"tag":486,"props":551,"children":553},{"class":488,"line":552},8,[554],{"type":40,"tag":486,"props":555,"children":556},{},[557],{"type":46,"value":558},"  required: ['title'],\n",{"type":40,"tag":486,"props":560,"children":562},{"class":488,"line":561},9,[563],{"type":40,"tag":486,"props":564,"children":565},{},[566],{"type":46,"value":567},");\n",{"type":40,"tag":469,"props":569,"children":571},{"id":570},"expected-output",[572],{"type":46,"value":573},"Expected Output",{"type":40,"tag":476,"props":575,"children":577},{"className":478,"code":576,"language":17,"meta":480,"style":480},"class _BasicCardData {\n  final String title;\n  final JsonMap? action;\n\n  _BasicCardData({required this.title, this.action});\n\n  factory _BasicCardData.fromJson(Map\u003CString, Object?> json) {\n    try {\n      return _BasicCardData(\n        title: json['title'] as String,\n        action: json['action'] as JsonMap?,\n      );\n    } catch (e) {\n      throw Exception('Invalid JSON for _BasicCardData: $e');\n    }\n  }\n}\n\nfinal basicCard = CatalogItem(\n  name: 'BasicCard',\n  dataSchema: basicCardSchema,\n  widgetBuilder: (itemContext) {\n    final json = itemContext.data as Map\u003CString, Object?>;\n    final data = _BasicCardData.fromJson(json);\n\n    return _BasicCard(\n      data: data,\n      onTap: () async {\n        final action = data.action;\n        if (action == null) return;\n        final event = action['event'] as JsonMap?;\n        final name = (event?['name'] as String?) ?? '';\n        final JsonMap contextDefinition =\n            (event?['context'] as JsonMap?) ?? \u003CString, Object?>{};\n        final JsonMap resolvedContext = await resolveContext(\n          itemContext.dataContext,\n          contextDefinition,\n        );\n        itemContext.dispatchEvent(\n          UserActionEvent(\n            name: name,\n            sourceComponentId: itemContext.id,\n            context: resolvedContext,\n          ),\n        );\n      }\n    );\n  },\n);\n\nclass _BasicCard extends StatelessWidget {\n  final _BasicCardData data;\n  final VoidCallback onTap;\n\n  const _BasicCard({super.key, required this.data, required this.onTap});\n\n  @override\n  Widget build(BuildContext context) {\n    return Card(\n      child: ListTile(\n        title: Text(data.title),\n        onTap: onTap,\n      ),\n    );\n  }\n}\n",[578],{"type":40,"tag":73,"props":579,"children":580},{"__ignoreMap":480},[581,589,597,605,614,622,629,637,645,653,662,671,680,689,698,707,716,725,733,742,751,760,769,778,787,795,804,813,822,831,840,849,858,867,876,885,894,903,912,921,930,939,948,957,966,974,983,992,1000,1008,1016,1025,1034,1043,1051,1060,1068,1077,1086,1095,1104,1113,1122,1131,1139,1147],{"type":40,"tag":486,"props":582,"children":583},{"class":488,"line":489},[584],{"type":40,"tag":486,"props":585,"children":586},{},[587],{"type":46,"value":588},"class _BasicCardData {\n",{"type":40,"tag":486,"props":590,"children":591},{"class":488,"line":498},[592],{"type":40,"tag":486,"props":593,"children":594},{},[595],{"type":46,"value":596},"  final String title;\n",{"type":40,"tag":486,"props":598,"children":599},{"class":488,"line":507},[600],{"type":40,"tag":486,"props":601,"children":602},{},[603],{"type":46,"value":604},"  final JsonMap? action;\n",{"type":40,"tag":486,"props":606,"children":607},{"class":488,"line":516},[608],{"type":40,"tag":486,"props":609,"children":611},{"emptyLinePlaceholder":610},true,[612],{"type":46,"value":613},"\n",{"type":40,"tag":486,"props":615,"children":616},{"class":488,"line":525},[617],{"type":40,"tag":486,"props":618,"children":619},{},[620],{"type":46,"value":621},"  _BasicCardData({required this.title, this.action});\n",{"type":40,"tag":486,"props":623,"children":624},{"class":488,"line":534},[625],{"type":40,"tag":486,"props":626,"children":627},{"emptyLinePlaceholder":610},[628],{"type":46,"value":613},{"type":40,"tag":486,"props":630,"children":631},{"class":488,"line":543},[632],{"type":40,"tag":486,"props":633,"children":634},{},[635],{"type":46,"value":636},"  factory _BasicCardData.fromJson(Map\u003CString, Object?> json) {\n",{"type":40,"tag":486,"props":638,"children":639},{"class":488,"line":552},[640],{"type":40,"tag":486,"props":641,"children":642},{},[643],{"type":46,"value":644},"    try {\n",{"type":40,"tag":486,"props":646,"children":647},{"class":488,"line":561},[648],{"type":40,"tag":486,"props":649,"children":650},{},[651],{"type":46,"value":652},"      return _BasicCardData(\n",{"type":40,"tag":486,"props":654,"children":656},{"class":488,"line":655},10,[657],{"type":40,"tag":486,"props":658,"children":659},{},[660],{"type":46,"value":661},"        title: json['title'] as String,\n",{"type":40,"tag":486,"props":663,"children":665},{"class":488,"line":664},11,[666],{"type":40,"tag":486,"props":667,"children":668},{},[669],{"type":46,"value":670},"        action: json['action'] as JsonMap?,\n",{"type":40,"tag":486,"props":672,"children":674},{"class":488,"line":673},12,[675],{"type":40,"tag":486,"props":676,"children":677},{},[678],{"type":46,"value":679},"      );\n",{"type":40,"tag":486,"props":681,"children":683},{"class":488,"line":682},13,[684],{"type":40,"tag":486,"props":685,"children":686},{},[687],{"type":46,"value":688},"    } catch (e) {\n",{"type":40,"tag":486,"props":690,"children":692},{"class":488,"line":691},14,[693],{"type":40,"tag":486,"props":694,"children":695},{},[696],{"type":46,"value":697},"      throw Exception('Invalid JSON for _BasicCardData: $e');\n",{"type":40,"tag":486,"props":699,"children":701},{"class":488,"line":700},15,[702],{"type":40,"tag":486,"props":703,"children":704},{},[705],{"type":46,"value":706},"    }\n",{"type":40,"tag":486,"props":708,"children":710},{"class":488,"line":709},16,[711],{"type":40,"tag":486,"props":712,"children":713},{},[714],{"type":46,"value":715},"  }\n",{"type":40,"tag":486,"props":717,"children":719},{"class":488,"line":718},17,[720],{"type":40,"tag":486,"props":721,"children":722},{},[723],{"type":46,"value":724},"}\n",{"type":40,"tag":486,"props":726,"children":728},{"class":488,"line":727},18,[729],{"type":40,"tag":486,"props":730,"children":731},{"emptyLinePlaceholder":610},[732],{"type":46,"value":613},{"type":40,"tag":486,"props":734,"children":736},{"class":488,"line":735},19,[737],{"type":40,"tag":486,"props":738,"children":739},{},[740],{"type":46,"value":741},"final basicCard = CatalogItem(\n",{"type":40,"tag":486,"props":743,"children":745},{"class":488,"line":744},20,[746],{"type":40,"tag":486,"props":747,"children":748},{},[749],{"type":46,"value":750},"  name: 'BasicCard',\n",{"type":40,"tag":486,"props":752,"children":754},{"class":488,"line":753},21,[755],{"type":40,"tag":486,"props":756,"children":757},{},[758],{"type":46,"value":759},"  dataSchema: basicCardSchema,\n",{"type":40,"tag":486,"props":761,"children":763},{"class":488,"line":762},22,[764],{"type":40,"tag":486,"props":765,"children":766},{},[767],{"type":46,"value":768},"  widgetBuilder: (itemContext) {\n",{"type":40,"tag":486,"props":770,"children":772},{"class":488,"line":771},23,[773],{"type":40,"tag":486,"props":774,"children":775},{},[776],{"type":46,"value":777},"    final json = itemContext.data as Map\u003CString, Object?>;\n",{"type":40,"tag":486,"props":779,"children":781},{"class":488,"line":780},24,[782],{"type":40,"tag":486,"props":783,"children":784},{},[785],{"type":46,"value":786},"    final data = _BasicCardData.fromJson(json);\n",{"type":40,"tag":486,"props":788,"children":790},{"class":488,"line":789},25,[791],{"type":40,"tag":486,"props":792,"children":793},{"emptyLinePlaceholder":610},[794],{"type":46,"value":613},{"type":40,"tag":486,"props":796,"children":798},{"class":488,"line":797},26,[799],{"type":40,"tag":486,"props":800,"children":801},{},[802],{"type":46,"value":803},"    return _BasicCard(\n",{"type":40,"tag":486,"props":805,"children":807},{"class":488,"line":806},27,[808],{"type":40,"tag":486,"props":809,"children":810},{},[811],{"type":46,"value":812},"      data: data,\n",{"type":40,"tag":486,"props":814,"children":816},{"class":488,"line":815},28,[817],{"type":40,"tag":486,"props":818,"children":819},{},[820],{"type":46,"value":821},"      onTap: () async {\n",{"type":40,"tag":486,"props":823,"children":825},{"class":488,"line":824},29,[826],{"type":40,"tag":486,"props":827,"children":828},{},[829],{"type":46,"value":830},"        final action = data.action;\n",{"type":40,"tag":486,"props":832,"children":834},{"class":488,"line":833},30,[835],{"type":40,"tag":486,"props":836,"children":837},{},[838],{"type":46,"value":839},"        if (action == null) return;\n",{"type":40,"tag":486,"props":841,"children":843},{"class":488,"line":842},31,[844],{"type":40,"tag":486,"props":845,"children":846},{},[847],{"type":46,"value":848},"        final event = action['event'] as JsonMap?;\n",{"type":40,"tag":486,"props":850,"children":852},{"class":488,"line":851},32,[853],{"type":40,"tag":486,"props":854,"children":855},{},[856],{"type":46,"value":857},"        final name = (event?['name'] as String?) ?? '';\n",{"type":40,"tag":486,"props":859,"children":861},{"class":488,"line":860},33,[862],{"type":40,"tag":486,"props":863,"children":864},{},[865],{"type":46,"value":866},"        final JsonMap contextDefinition =\n",{"type":40,"tag":486,"props":868,"children":870},{"class":488,"line":869},34,[871],{"type":40,"tag":486,"props":872,"children":873},{},[874],{"type":46,"value":875},"            (event?['context'] as JsonMap?) ?? \u003CString, Object?>{};\n",{"type":40,"tag":486,"props":877,"children":879},{"class":488,"line":878},35,[880],{"type":40,"tag":486,"props":881,"children":882},{},[883],{"type":46,"value":884},"        final JsonMap resolvedContext = await resolveContext(\n",{"type":40,"tag":486,"props":886,"children":888},{"class":488,"line":887},36,[889],{"type":40,"tag":486,"props":890,"children":891},{},[892],{"type":46,"value":893},"          itemContext.dataContext,\n",{"type":40,"tag":486,"props":895,"children":897},{"class":488,"line":896},37,[898],{"type":40,"tag":486,"props":899,"children":900},{},[901],{"type":46,"value":902},"          contextDefinition,\n",{"type":40,"tag":486,"props":904,"children":906},{"class":488,"line":905},38,[907],{"type":40,"tag":486,"props":908,"children":909},{},[910],{"type":46,"value":911},"        );\n",{"type":40,"tag":486,"props":913,"children":915},{"class":488,"line":914},39,[916],{"type":40,"tag":486,"props":917,"children":918},{},[919],{"type":46,"value":920},"        itemContext.dispatchEvent(\n",{"type":40,"tag":486,"props":922,"children":924},{"class":488,"line":923},40,[925],{"type":40,"tag":486,"props":926,"children":927},{},[928],{"type":46,"value":929},"          UserActionEvent(\n",{"type":40,"tag":486,"props":931,"children":933},{"class":488,"line":932},41,[934],{"type":40,"tag":486,"props":935,"children":936},{},[937],{"type":46,"value":938},"            name: name,\n",{"type":40,"tag":486,"props":940,"children":942},{"class":488,"line":941},42,[943],{"type":40,"tag":486,"props":944,"children":945},{},[946],{"type":46,"value":947},"            sourceComponentId: itemContext.id,\n",{"type":40,"tag":486,"props":949,"children":951},{"class":488,"line":950},43,[952],{"type":40,"tag":486,"props":953,"children":954},{},[955],{"type":46,"value":956},"            context: resolvedContext,\n",{"type":40,"tag":486,"props":958,"children":960},{"class":488,"line":959},44,[961],{"type":40,"tag":486,"props":962,"children":963},{},[964],{"type":46,"value":965},"          ),\n",{"type":40,"tag":486,"props":967,"children":969},{"class":488,"line":968},45,[970],{"type":40,"tag":486,"props":971,"children":972},{},[973],{"type":46,"value":911},{"type":40,"tag":486,"props":975,"children":977},{"class":488,"line":976},46,[978],{"type":40,"tag":486,"props":979,"children":980},{},[981],{"type":46,"value":982},"      }\n",{"type":40,"tag":486,"props":984,"children":986},{"class":488,"line":985},47,[987],{"type":40,"tag":486,"props":988,"children":989},{},[990],{"type":46,"value":991},"    );\n",{"type":40,"tag":486,"props":993,"children":995},{"class":488,"line":994},48,[996],{"type":40,"tag":486,"props":997,"children":998},{},[999],{"type":46,"value":549},{"type":40,"tag":486,"props":1001,"children":1003},{"class":488,"line":1002},49,[1004],{"type":40,"tag":486,"props":1005,"children":1006},{},[1007],{"type":46,"value":567},{"type":40,"tag":486,"props":1009,"children":1011},{"class":488,"line":1010},50,[1012],{"type":40,"tag":486,"props":1013,"children":1014},{"emptyLinePlaceholder":610},[1015],{"type":46,"value":613},{"type":40,"tag":486,"props":1017,"children":1019},{"class":488,"line":1018},51,[1020],{"type":40,"tag":486,"props":1021,"children":1022},{},[1023],{"type":46,"value":1024},"class _BasicCard extends StatelessWidget {\n",{"type":40,"tag":486,"props":1026,"children":1028},{"class":488,"line":1027},52,[1029],{"type":40,"tag":486,"props":1030,"children":1031},{},[1032],{"type":46,"value":1033},"  final _BasicCardData data;\n",{"type":40,"tag":486,"props":1035,"children":1037},{"class":488,"line":1036},53,[1038],{"type":40,"tag":486,"props":1039,"children":1040},{},[1041],{"type":46,"value":1042},"  final VoidCallback onTap;\n",{"type":40,"tag":486,"props":1044,"children":1046},{"class":488,"line":1045},54,[1047],{"type":40,"tag":486,"props":1048,"children":1049},{"emptyLinePlaceholder":610},[1050],{"type":46,"value":613},{"type":40,"tag":486,"props":1052,"children":1054},{"class":488,"line":1053},55,[1055],{"type":40,"tag":486,"props":1056,"children":1057},{},[1058],{"type":46,"value":1059},"  const _BasicCard({super.key, required this.data, required this.onTap});\n",{"type":40,"tag":486,"props":1061,"children":1063},{"class":488,"line":1062},56,[1064],{"type":40,"tag":486,"props":1065,"children":1066},{"emptyLinePlaceholder":610},[1067],{"type":46,"value":613},{"type":40,"tag":486,"props":1069,"children":1071},{"class":488,"line":1070},57,[1072],{"type":40,"tag":486,"props":1073,"children":1074},{},[1075],{"type":46,"value":1076},"  @override\n",{"type":40,"tag":486,"props":1078,"children":1080},{"class":488,"line":1079},58,[1081],{"type":40,"tag":486,"props":1082,"children":1083},{},[1084],{"type":46,"value":1085},"  Widget build(BuildContext context) {\n",{"type":40,"tag":486,"props":1087,"children":1089},{"class":488,"line":1088},59,[1090],{"type":40,"tag":486,"props":1091,"children":1092},{},[1093],{"type":46,"value":1094},"    return Card(\n",{"type":40,"tag":486,"props":1096,"children":1098},{"class":488,"line":1097},60,[1099],{"type":40,"tag":486,"props":1100,"children":1101},{},[1102],{"type":46,"value":1103},"      child: ListTile(\n",{"type":40,"tag":486,"props":1105,"children":1107},{"class":488,"line":1106},61,[1108],{"type":40,"tag":486,"props":1109,"children":1110},{},[1111],{"type":46,"value":1112},"        title: Text(data.title),\n",{"type":40,"tag":486,"props":1114,"children":1116},{"class":488,"line":1115},62,[1117],{"type":40,"tag":486,"props":1118,"children":1119},{},[1120],{"type":46,"value":1121},"        onTap: onTap,\n",{"type":40,"tag":486,"props":1123,"children":1125},{"class":488,"line":1124},63,[1126],{"type":40,"tag":486,"props":1127,"children":1128},{},[1129],{"type":46,"value":1130},"      ),\n",{"type":40,"tag":486,"props":1132,"children":1134},{"class":488,"line":1133},64,[1135],{"type":40,"tag":486,"props":1136,"children":1137},{},[1138],{"type":46,"value":991},{"type":40,"tag":486,"props":1140,"children":1142},{"class":488,"line":1141},65,[1143],{"type":40,"tag":486,"props":1144,"children":1145},{},[1146],{"type":46,"value":715},{"type":40,"tag":486,"props":1148,"children":1150},{"class":488,"line":1149},66,[1151],{"type":40,"tag":486,"props":1152,"children":1153},{},[1154],{"type":46,"value":724},{"type":40,"tag":49,"props":1156,"children":1158},{"id":1157},"constraints",[1159],{"type":46,"value":1160},"Constraints",{"type":40,"tag":98,"props":1162,"children":1163},{},[1164,1182],{"type":40,"tag":86,"props":1165,"children":1166},{},[1167,1169,1174,1176,1181],{"type":46,"value":1168},"Ensure proper use of ",{"type":40,"tag":73,"props":1170,"children":1172},{"className":1171},[],[1173],{"type":46,"value":158},{"type":46,"value":1175}," blocks and type casting when parsing JSON in ",{"type":40,"tag":73,"props":1177,"children":1179},{"className":1178},[],[1180],{"type":46,"value":332},{"type":46,"value":189},{"type":40,"tag":86,"props":1183,"children":1184},{},[1185,1187,1192,1194,1200],{"type":46,"value":1186},"Make sure action resolution accurately fetches variables via ",{"type":40,"tag":73,"props":1188,"children":1190},{"className":1189},[],[1191],{"type":46,"value":365},{"type":46,"value":1193}," and uses ",{"type":40,"tag":73,"props":1195,"children":1197},{"className":1196},[],[1198],{"type":46,"value":1199},"itemContext.dispatchEvent",{"type":46,"value":1201}," when actions are present in the Schema.",{"type":40,"tag":1203,"props":1204,"children":1205},"style",{},[1206],{"type":46,"value":1207},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1209,"total":498},[1210,1217],{"slug":4,"name":4,"fn":5,"description":6,"org":1211,"tags":1212,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1213,1214,1215,1216],{"name":16,"slug":17,"type":14},{"name":13,"slug":8,"type":14},{"name":22,"slug":23,"type":14},{"name":19,"slug":20,"type":14},{"slug":1218,"name":1218,"fn":1219,"description":1220,"org":1221,"tags":1222,"stars":24,"repoUrl":25,"updatedAt":1230},"integrate-genui-firebase","integrate Flutter genui with Firebase AI Logic","Use this skill when the user asks to integrate the genui package and get a simple conversation going with Firebase AI Logic.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1223,1226,1227],{"name":1224,"slug":1225,"type":14},"Firebase","firebase",{"name":13,"slug":8,"type":14},{"name":1228,"slug":1229,"type":14},"Mobile","mobile","2026-04-16T05:04:52.392424",{"items":1232,"total":806},[1233,1246,1257,1269,1280,1289,1301,1313,1325,1337,1351,1361],{"slug":1234,"name":1234,"fn":1235,"description":1236,"org":1237,"tags":1238,"stars":1243,"repoUrl":1244,"updatedAt":1245},"dart-add-unit-test","write unit tests for Dart code","Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains correct and regression-free.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1239,1240],{"name":16,"slug":17,"type":14},{"name":1241,"slug":1242,"type":14},"Testing","testing",2664,"https:\u002F\u002Fgithub.com\u002Fflutter\u002Fagent-plugins","2026-07-15T05:22:40.104823",{"slug":1247,"name":1247,"fn":1248,"description":1249,"org":1250,"tags":1251,"stars":1243,"repoUrl":1244,"updatedAt":1256},"dart-build-cli-app","build Dart command line applications","Entrypoint structure, exit codes, cross-platform scripts. Use when building command line utilities, scripts, or applications.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1252,1255],{"name":1253,"slug":1254,"type":14},"CLI","cli",{"name":16,"slug":17,"type":14},"2026-07-15T05:22:18.863572",{"slug":1258,"name":1258,"fn":1259,"description":1260,"org":1261,"tags":1262,"stars":1243,"repoUrl":1244,"updatedAt":1268},"dart-collect-coverage","collect Dart test coverage reports","Collect coverage using the coverage packge and create an LCOV report",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1263,1264,1267],{"name":16,"slug":17,"type":14},{"name":1265,"slug":1266,"type":14},"Reporting","reporting",{"name":1241,"slug":1242,"type":14},"2026-07-15T05:22:21.38636",{"slug":1270,"name":1270,"fn":1271,"description":1272,"org":1273,"tags":1274,"stars":1243,"repoUrl":1244,"updatedAt":1279},"dart-fix-runtime-errors","debug and fix Dart runtime errors","Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via hot_reload.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1275,1276],{"name":16,"slug":17,"type":14},{"name":1277,"slug":1278,"type":14},"Debugging","debugging","2026-07-15T05:22:22.622501",{"slug":1281,"name":1281,"fn":1282,"description":1283,"org":1284,"tags":1285,"stars":1243,"repoUrl":1244,"updatedAt":1288},"dart-generate-test-mocks","generate mock objects for Dart tests","Define and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing classes that depend on complex external services like APIs or databases.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1286,1287],{"name":16,"slug":17,"type":14},{"name":1241,"slug":1242,"type":14},"2026-07-15T05:22:42.607449",{"slug":1290,"name":1290,"fn":1291,"description":1292,"org":1293,"tags":1294,"stars":1243,"repoUrl":1244,"updatedAt":1300},"dart-migrate-to-checks-package","migrate test matchers to checks package","Replace the usage of `expect` and similar functions from `package:matcher`\nto `package:checks` equivalents.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1295,1296,1299],{"name":16,"slug":17,"type":14},{"name":1297,"slug":1298,"type":14},"Migration","migration",{"name":1241,"slug":1242,"type":14},"2026-07-15T05:22:31.276564",{"slug":1302,"name":1302,"fn":1303,"description":1304,"org":1305,"tags":1306,"stars":1243,"repoUrl":1244,"updatedAt":1312},"dart-resolve-package-conflicts","resolve Dart package version conflicts","Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1307,1308,1309],{"name":16,"slug":17,"type":14},{"name":1277,"slug":1278,"type":14},{"name":1310,"slug":1311,"type":14},"Engineering","engineering","2026-07-15T05:22:30.059335",{"slug":1314,"name":1314,"fn":1315,"description":1316,"org":1317,"tags":1318,"stars":1243,"repoUrl":1244,"updatedAt":1324},"dart-run-static-analysis","run static analysis and apply fixes","Execute `dart analyze` to identify warnings and errors, and use `dart fix --apply` to automatically resolve mechanical lint issues. Use during development to ensure code quality and before committing changes.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1319,1322,1323],{"name":1320,"slug":1321,"type":14},"Code Analysis","code-analysis",{"name":16,"slug":17,"type":14},{"name":1277,"slug":1278,"type":14},"2026-07-15T05:22:23.861119",{"slug":1326,"name":1326,"fn":1327,"description":1328,"org":1329,"tags":1330,"stars":1243,"repoUrl":1244,"updatedAt":1336},"dart-setup-ffi-assets","package C\u002FC++ assets for Dart","Guides agents in compiling and packaging C\u002FC++ source code into dynamic or static libraries (Code Assets) using Dart's Native Assets hook system (via hook\u002Fbuild.dart and hook\u002Flink.dart utilizing package:hooks and package:native_toolchain_c). Use when a user asks to: 'setup native assets', 'compile C\u002FC++ source code', 'bundle dynamic libraries', 'build native C code', 'link native assets', 'implement build.dart or link.dart hooks', or 'integrate C\u002FC++ interop in Dart\u002FFlutter'. Helps agents avoid manual toolchain orchestration and configures secure hash-validated binary downloads or advanced linker tree-shaking with package:record_use mapping.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1331,1332,1335],{"name":16,"slug":17,"type":14},{"name":1333,"slug":1334,"type":14},"Deployment","deployment",{"name":1310,"slug":1311,"type":14},"2026-07-15T05:22:20.138636",{"slug":1338,"name":1338,"fn":1339,"description":1340,"org":1341,"tags":1342,"stars":1243,"repoUrl":1244,"updatedAt":1350},"dart-skills-lint-setup","configure dart_skills_lint for Dart projects","Use this skill when you need to set up validation for AI agent skills in a Dart project for the first time.\nAdds the linter as a dev_dependency, creates a configuration file, and generates a baseline for legacy repos.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1343,1344,1347],{"name":16,"slug":17,"type":14},{"name":1345,"slug":1346,"type":14},"Plugin Development","plugin-development",{"name":1348,"slug":1349,"type":14},"QA","qa","2026-07-15T05:22:47.488998",{"slug":1352,"name":1352,"fn":1353,"description":1354,"org":1355,"tags":1356,"stars":1243,"repoUrl":1244,"updatedAt":1360},"dart-skills-lint-validation","validate agent skills with dart_skills_lint","Use this skill when you need to validate AI agent skills with dart_skills_lint — running the linter, interpreting failures, fixing violations, and authoring custom rules.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1357,1358,1359],{"name":16,"slug":17,"type":14},{"name":1345,"slug":1346,"type":14},{"name":1348,"slug":1349,"type":14},"2026-07-21T05:38:34.451024",{"slug":1362,"name":1362,"fn":1363,"description":1364,"org":1365,"tags":1366,"stars":1243,"repoUrl":1244,"updatedAt":1369},"dart-use-ffigen","generate FFI bindings with ffigen","Guide agents to use `package:ffigen` to automatically generate FFI bindings instead of writing them manually. Use this skill when a task involves writing new FFI bindings, extending C\u002FObjective-C\u002FSwift integrations, or replacing hand-crafted `dart:ffi` setups.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1367,1368],{"name":16,"slug":17,"type":14},{"name":1310,"slug":1311,"type":14},"2026-07-15T05:22:17.592351"]