{"id":32282549,"url":"https://github.com/anotherglitchinthematrix/asis","last_synced_at":"2026-05-07T09:34:35.316Z","repository":{"id":48982311,"uuid":"267567117","full_name":"anotherglitchinthematrix/asis","owner":"anotherglitchinthematrix","description":"A small utility library to handle http responses easily.","archived":false,"fork":false,"pushed_at":"2021-07-02T09:28:00.000Z","size":34,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-23T01:04:48.758Z","etag":null,"topics":["dart","flutter","http","json"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/asis","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anotherglitchinthematrix.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-05-28T11:03:48.000Z","updated_at":"2021-07-02T09:18:42.000Z","dependencies_parsed_at":"2022-09-20T22:01:54.583Z","dependency_job_id":null,"html_url":"https://github.com/anotherglitchinthematrix/asis","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/anotherglitchinthematrix/asis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anotherglitchinthematrix%2Fasis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anotherglitchinthematrix%2Fasis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anotherglitchinthematrix%2Fasis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anotherglitchinthematrix%2Fasis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anotherglitchinthematrix","download_url":"https://codeload.github.com/anotherglitchinthematrix/asis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anotherglitchinthematrix%2Fasis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32731621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["dart","flutter","http","json"],"created_at":"2025-10-23T01:02:38.672Z","updated_at":"2026-05-07T09:34:35.311Z","avatar_url":"https://github.com/anotherglitchinthematrix.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Dart CI](https://github.com/anotherglitchinthematrix/asis/workflows/Dart%20CI/badge.svg?branch=master)\r\n# ASIS \r\n\r\nA small utility library to handle JSON encoded http responses easily, transforms the response into an internal type of data and extends the capabilities of `Response`, `Iterable`, `List`, `Future\u003cResponse\u003e`, `Future\u003cIterable\u003e`, `Future\u003cList\u003e` to handle data manipulation on the same future chain.\r\n\r\n## Getting Started\r\n\r\nThis package built upon the [http](https://pub.dev/packages/http) package to work with it's internal [Response](https://pub.dev/documentation/http/latest/http/Response-class.html) type.\r\n\r\nIt's also possible to use some of the internal features without depending to [http](https://pub.dev/packages/http) package, such as the extensions, `Future\u003cList\u003cT\u003e\u003e`, `Future\u003cIterable\u003cT\u003e\u003e`,  that helps to manipulate the data on the same future chain.\r\n\r\n## Example\r\nHere is a working example that shows the brief functionality of the library, this example highlights how to transform the JSON encoded HTTP body to an internal custom object and a list of that custom object on top of some data manipulation without leaving the same future chain that get's the data from the http call.\r\n\r\n```dart\r\nimport 'package:http/http.dart' as http;\r\nimport 'package:asis/asis.dart';\r\n\r\nclass Task {\r\n  final int userId;\r\n  final int id;\r\n  final String title;\r\n  final bool completed;\r\n\r\n  // Task({this.userId, this.id, this.title, this.completed});\r\n\r\n  Task.fromJson(Map\u003cString, dynamic\u003e e)\r\n      : userId = e['userId'],\r\n        id = e['id'],\r\n        title = e['title'],\r\n        completed = e['completed'];\r\n\r\n  /// Static method to pass the handler directly to the input.\r\n  static Task handler(Map\u003cString, dynamic\u003e e) {\r\n    return Task.fromJson(e);\r\n  }\r\n}\r\n\r\n/// Resource url.\r\nvar url = 'http://jsonplaceholder.typicode.com/todos';\r\n\r\n/// Returns a task object.\r\nFuture\u003cTask\u003e task(int id) =\u003e http.get('$url/$id').as(Task.handler);\r\n\r\n/// Returns a list of tasks.\r\nFuture\u003cList\u003cTask\u003e\u003e get tasks =\u003e http.get(url).asList(Task.handler);\r\n\r\nvoid main() async {\r\n  /// Get the third task and print the title.\r\n  task(3)\r\n      .then((e) =\u003e e.title)\r\n      .then((e) =\u003e 'Title of the third task: $e')\r\n      .then(print);\r\n\r\n  /// Print the title of the top 3 task.\r\n  tasks.take(3).each((e) =\u003e print(e.title));\r\n\r\n  /// Count of the completed tasks.\r\n  tasks\r\n      .where((e) =\u003e e.completed)\r\n      .fold(0, (p, _) =\u003e p + 1)\r\n      .then((e) =\u003e 'Number of the completed tasks: $e')\r\n      .then(print);\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanotherglitchinthematrix%2Fasis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanotherglitchinthematrix%2Fasis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanotherglitchinthematrix%2Fasis/lists"}