{"id":16131511,"url":"https://github.com/thislight/fruit","last_synced_at":"2025-04-06T14:32:56.711Z","repository":{"id":204702717,"uuid":"712325416","full_name":"thislight/fruit","owner":"thislight","description":"Experimental breathe-taking UI data management for Flutter.","archived":false,"fork":false,"pushed_at":"2023-10-31T14:47:39.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T20:37:58.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thislight.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-31T08:45:41.000Z","updated_at":"2023-10-31T15:00:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9c04627-6bdc-48e5-94b3-133cbd20af17","html_url":"https://github.com/thislight/fruit","commit_stats":null,"previous_names":["thislight/fruit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thislight%2Ffruit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thislight%2Ffruit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thislight%2Ffruit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thislight%2Ffruit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thislight","download_url":"https://codeload.github.com/thislight/fruit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247496019,"owners_count":20948148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-09T22:25:28.567Z","updated_at":"2025-04-06T14:32:56.682Z","avatar_url":"https://github.com/thislight.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Experimental UI data management for Flutter\nExperimental breathe-taking UI data management for Flutter. This package is an experiment.\n\n## Features\n\n- [x] Basic primitives\n    - `createRoot`, `untrack`, `batch`\n    - `Signal` and `Memo`\n    - `createRenderEffect`, `createEffect`\n    - `onMount` and `onCleanup`\n- [ ] Handle errors\n- [ ] `Resource`\n\n## Getting started\n\nDownload this repository and use as dependency.\n\n## Usage\n\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:fruit/signals.dart';\nimport 'package:fruit/widgets.dart';\n\nclass Clock extends FruitWidget {\n  final Duration offset;\n  Clock(this.offset, {super.key});\n\n  @override\n  FruitState\u003cFruitWidget\u003e createState() {\n    return ClockState(this);\n  }\n}\n\nclass ClockState extends FruitState\u003cClock\u003e {\n  final time = Signal(DateTime.now());\n\n  ClockState(super.widget) {\n    Timer? timer;\n\n    onMount(() {\n      timer = Timer.periodic(const Duration(seconds: 1), (timer) {\n        time.set(DateTime.now());\n      });\n    });\n\n    onCleanup(() {\n      timer?.cancel();\n    });\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Row(\n      crossAxisAlignment: CrossAxisAlignment.center,\n      children: [Text(\"Offset: ${widget.offset}\"), Text(time().toIso8601String())],\n    );\n  }\n}\n```\n\n## Known Behaviour\n\n- After the widget reconstructed, the effects will be executed again.\n    - That's expected behaviour because we reinitialised the element when the widget changed.\n    - The key is the widget is not integrated within the reactive system, so the effects could not automatically notified when an exact value is changed.\n\n## License\n\n```\nCopyright 2023 Rubicon Rowe\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthislight%2Ffruit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthislight%2Ffruit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthislight%2Ffruit/lists"}