{"id":16746588,"url":"https://github.com/helightdev/chainmail","last_synced_at":"2025-03-16T02:16:38.520Z","repository":{"id":61975346,"uuid":"499685997","full_name":"helightdev/chainmail","owner":"helightdev","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-01T15:25:50.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T09:33:02.530Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/helightdev.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":"2022-06-04T00:26:19.000Z","updated_at":"2022-06-04T00:26:34.000Z","dependencies_parsed_at":"2022-10-24T13:45:41.979Z","dependency_job_id":null,"html_url":"https://github.com/helightdev/chainmail","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/helightdev%2Fchainmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helightdev%2Fchainmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helightdev%2Fchainmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helightdev%2Fchainmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helightdev","download_url":"https://codeload.github.com/helightdev/chainmail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814895,"owners_count":20352038,"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-13T02:07:23.555Z","updated_at":"2025-03-16T02:16:38.500Z","avatar_url":"https://github.com/helightdev.png","language":"Dart","readme":"## Features\nChainmail offers a mixin based extension model to improve code quality.\nYou might already know mixins and their advantages from the infamous\nTickerProvider mixins.\n\nThe package ships with following features already implemented:\n* Extensible mixin based chain model\n* Full integrations with the default state class\n* `Blocs`: Bind to list of blocs and listen to updated\n* `Loading`: Await a future and show a placeholder\n* `Errors`: Catch custom or loading errors and show them\n* `Responsive`: Implement orientation specific build methods\n* `Disposables`: Register StreamSubscriptions and dispose callbacks\n* `LateRender`: Wait for one frame before building to access the RenderBox\n\n\n## Usage\nTo use chainmail extensions, just change your state implementations\ntype to ChainmailState and implement the `mainBuild` method instead of `build`.\n\n```dart\nclass ExampleWidget extends StatefulWidget {\n  const ExampleWidget({Key? key}) : super(key: key);\n\n  @override\n  State\u003cExampleWidget\u003e createState() =\u003e ExampleState();\n}\n\nclass ExampleState extends ChainmailState\u003cExampleWidget\u003e {\n  @override\n  Widget mainBuild() =\u003e const Text(\"Hello World\");\n}\n```\n\nYou can use the BuildContext as usual with the `context` variable, which in\nthis case is declared at class level and is accessible from everywhere inside\nthe class and always up-to-date. You can also use one of the numerous\nquality of life getters for common scenarios, like getting MediaQueries or\naccessing the nearest Theme and TextTheme.\n\nTo use an extension (from now on referred to as chainlinks), just use the `with`\nkeyword followed by the mixin class. You then possibly have to implement\nrequired methods.\n\n```dart\nclass ExampleState extends ChainmailState\u003cExampleWidget\u003e with Loading {\n  @override\n  Widget mainBuild() =\u003e const Text(\"Test!\");\n  \n  @override\n  Future initialize() async {\n    await Future.delayed(const Duration(seconds: 1));\n  }\n}\n```\n\nThe chainlinks will be applied in natural order, contrary to the \"common\"\nreverse order, because of readability.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelightdev%2Fchainmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelightdev%2Fchainmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelightdev%2Fchainmail/lists"}