{"id":13511409,"url":"https://github.com/jonataslaw/easy","last_synced_at":"2025-07-14T09:10:45.612Z","repository":{"id":56828342,"uuid":"276194121","full_name":"jonataslaw/easy","owner":"jonataslaw","description":"The easiest state manager for Flutter.","archived":false,"fork":false,"pushed_at":"2020-10-02T00:50:10.000Z","size":158,"stargazers_count":19,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-19T04:31:07.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonataslaw.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}},"created_at":"2020-06-30T19:47:54.000Z","updated_at":"2023-07-06T05:08:21.000Z","dependencies_parsed_at":"2022-08-29T02:40:44.773Z","dependency_job_id":null,"html_url":"https://github.com/jonataslaw/easy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonataslaw%2Feasy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonataslaw%2Feasy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonataslaw%2Feasy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonataslaw%2Feasy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonataslaw","download_url":"https://codeload.github.com/jonataslaw/easy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250265270,"owners_count":21402066,"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-08-01T03:00:49.332Z","updated_at":"2025-04-22T15:23:53.020Z","avatar_url":"https://github.com/jonataslaw.png","language":"Dart","funding_links":[],"categories":["other"],"sub_categories":[],"readme":"# EASY\n\n**The easiest state manager for Flutter.**\n\n## Why Easy?\n\nFlutter already has a lot of state managers (a lot of them!), But I think it's incredible how there are still niches and more niches today.\nRecently someone questioned in my other lib (GetX), if there was a middle ground between using Simple State Management, and reactive State Management, because both are extreme. One updates the screen through a hashset of callbacks, the most simplistic approach that can exist (that's why RAM is so economical), and the second is a highly powerful management, which uses streams under the hood and can solve literally any problem.\nPersonally, I use GetX with reactive management in my projects, simply because I am demanding when it comes to state management. However, many people just don't like streams, and no matter how much you say they're awesome, you're not going to convince them.\nThat's when I came up with the idea of ​​using callback HashSets (like the simple state manager) to do something reactive, and the result was this.\nEasy does not work with Streams, and does not work with ChangeNotifier.\nIn fact, it is somewhat similar to ChangeNotifier, but it doesn't use ObservableList or anything like that.\nWhy hashset? Why not List? Why not ObservableList?\nWell, I think the Flutter team has a good reason to base ChangeNotifier on an ObservableList, but we don't have that. Even because the listener with Easy will be created vertically, from the reactive variable to the widget.\nIt is something that GetX does automatically, but here you don't need a \".value\", on the other hand, you need to put your variable inside a callback.\nAnyway, this is just another state management solution, quite different from the conventional one, which has a good performance.\nYou can fully integrate it with GetX, including EasyStore is a DisposableInterface, which responds to the controllers' lifecycle. That's it, let's see now how Easy works:\n\n\nadd \".reactive\" to the end of your variable.\n\n```dart\nvar name = 'Jonny'.reactive;\n```\n\nInsert the Widget you want to change within an EasyBuilder.\n```dart\nEasyBuilder(($) =\u003e Text($(name))),\n```\n\nThere, now whenever name is changed, it will be updated on the screen.\n\nYou can change name in several ways.\nThe first is accessing its value, just like in GetX\n\n```dart\nname.value = 'Pietro';\n```\nor add literally within name:\n\n```dart\nname('Pietro');\n```\n\nin the same way you can get the value of name with name.value or with name()\n\nOnly within GetBuilder are you required to enclose your reactive variable in a \"tracker\".\nIn the example we use the symbol \"$\" as a tracker, you can use literally anything.\n\n\nWhat if I want to access the value of a reactive variable, elsewhere? how do I do?\n\n```dart\nclass UserStore extends EasyStore {\nvar name = 'Jonny'.reactive;\n}\n\nclass HomePage extends StatelessWidget {\n  final state = Easy.put(UserStore());\n  \n  @override\n  Widget build(BuildContext context) {\n  return EasyBuilder(($) =\u003e Text($(state.name)));\n}  \n```\non other screen:\n```dart\nclass Other extends StatelessWidget {\n \n  @override\n  Widget build(BuildContext context) {\n  UserStore state = Easy.find();\n  return EasyBuilder(($) =\u003e Text($(state.name)));\n}  \n```\nWhen name is changed, it will be changed automatically on both screens.\n\nOkay, but what if I want to reactivate an entire class, is that possible?\nWell, this is much easier here than any other approach in the world. Easy not, ridiculously easy.\n\ncreate a class\n\n```dart\nclass User {\n  User({this.name = 'Jonny', this.age = 18});\n  String name;\n  int age;\n}\n\n\n```\n\nMake your class reactive.\n\n```dart\nfinal user = User().reactive;\n```\n\nLet's say you need to display a user's name and age, and you want it to change when you change data. How to do this?\nThis is your widget:\n```dart\n EasyBuilder(($) {\n              var user = $(state.user);\n              return Text('Name: ${user.name} Age: ${user.age}');\n            }),\n```\n\nTo change it you just need to call update, and update the variables you want. Ridiculously easy.\n\n```dart\nuser.update((user) {\n      user.name = 'Pietro';\n      user.age = 16;\n    });\n```\n\nDone!\n\nI believe it was easy, very easy for you.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonataslaw%2Feasy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonataslaw%2Feasy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonataslaw%2Feasy/lists"}