{"id":15931441,"url":"https://github.com/geopjr/crutter","last_synced_at":"2026-04-24T22:37:48.450Z","repository":{"id":46962436,"uuid":"488368946","full_name":"GeopJr/crutter","owner":"GeopJr","description":"Create Flutter Widgets from Crystal","archived":false,"fork":false,"pushed_at":"2022-05-03T21:51:09.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-13T02:47:59.155Z","etag":null,"topics":["crystal","flutter"],"latest_commit_sha":null,"homepage":"https://crutter.geopjr.dev","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeopJr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-03T21:32:28.000Z","updated_at":"2023-08-14T07:49:53.000Z","dependencies_parsed_at":"2022-09-11T15:41:34.661Z","dependency_job_id":null,"html_url":"https://github.com/GeopJr/crutter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GeopJr/crutter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeopJr%2Fcrutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeopJr%2Fcrutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeopJr%2Fcrutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeopJr%2Fcrutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeopJr","download_url":"https://codeload.github.com/GeopJr/crutter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeopJr%2Fcrutter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32243754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crystal","flutter"],"created_at":"2024-10-07T01:21:04.691Z","updated_at":"2026-04-24T22:37:48.423Z","avatar_url":"https://github.com/GeopJr.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ecrutter\u003c/h1\u003e\n\u003ch4 align=\"center\"\u003eCreate Flutter Widgets from Crystal.\u003c/h4\u003e\n\u003cp align=\"center\"\u003e\n  \u003cbr /\u003e\n    \u003ca href=\"https://github.com/GeopJr/crutter/blob/main/CODE_OF_CONDUCT.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/Contributor%20Covenant-v2.1-08589c.svg?style=for-the-badge\u0026labelColor=44d1fd\" alt=\"Code Of Conduct\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/GeopJr/crutter/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/LICENSE-BSD--2--Clause-08589c.svg?style=for-the-badge\u0026labelColor=44d1fd\" alt=\"BSD-2-Clause\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/GeopJr/crutter/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/workflow/status/geopjr/crutter/Specs%20\u0026%20Lint/main?labelColor=44d1fd\u0026style=for-the-badge\" alt=\"ci action status\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## What is crutter?\n\nAs of now crutter is a POC.\n\nCrystal 1.4.0 introduced compiling to WASM. Dart has *minimal* support for consuming WASM right now.\n\ncrutter generates widgets in JSON format that are to be consumed by [json_dynamic_widget](https://github.com/peiffer-innovations/json_dynamic_widget), a Dart package that creates widgets dynamically from JSON.\n\njson_dynamic_widget has a lot of features like functions that exapand in Dart.\n\nSee [`./spec/`](./spec/).\n\n## Why is it a POC?\n\nDart's WASM support is *very* alpha. It uses wasmer and it's messy between platforms and SDK versions.\n\nEven after getting over those, it doesn't support all Crystal WASM functions (and honestly I'm unsure if it ever will).\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     crutter:\n       github: GeopJr/crutter\n   ```\n\n2. Run `shards install`\n\n## Usage\n\nYou can find crutter's docs on the sidebar.\n\nThe following code is just a concept, it's untested and depends on assumptions.\n\nWASM:\n\n```crystal\nrequire \"crutter\"\n\ndef create_text(title : String)\n  center = Crutter::Widget.new(\"center\")\n  text = Crutter::Widget.new(\"text\")\n\n  text.args[\"text\"] = title\n  center.children \u003c\u003c text\n\n  center.to_json #=\u003e {\"type\":\"center\",\"child\":{\"type\":\"text\",\"args\":{\"text\":\"#{title}\"}}}\nend\n```\n\nDart:\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:flutter_wasm/flutter_wasm.dart';\nimport 'package:json_dynamic_widget/json_dynamic_widget.dart';\n\nvoid main() async {\n  WidgetsFlutterBinding.ensureInitialized();\n  ByteData bytes = await rootBundle.load('crystal/main-final.wasm');\n  final data = bytes.buffer.asUint8List();\n  final mod = WasmModule(data);\n  final inst = mod.builder().build();\n  final create_text = inst.lookupFunction('create_text');\n\n  final text_widget = create_text(\"hello world\")\n  final json_data = json.decode(text_widget);\n\n  final json_widget_data = JsonWidgetData.fromDynamic(\n        json_data\n  );\n}\n```\n\n\u003e Unsure whether the above even compiles but gets the point across:\n\n\u003e Dart --create_text(\"hello world\")--\u003e Crystal (WASM) --widget--\u003e Dart\n\n## Contributing\n\n1. Read the [Code of Conduct](https://github.com/GeopJr/crutter/blob/main/CODE_OF_CONDUCT.md)\n2. Fork it (\u003chttps://github.com/GeopJr/crutter/fork\u003e)\n3. Create your feature branch (`git checkout -b my-new-feature`)\n4. Commit your changes (`git commit -am 'Add some feature'`)\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeopjr%2Fcrutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeopjr%2Fcrutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeopjr%2Fcrutter/lists"}