{"id":20625380,"url":"https://github.com/insign/dart_var_dump","last_synced_at":"2026-04-20T00:32:36.191Z","repository":{"id":151938521,"uuid":"625044302","full_name":"insign/dart_var_dump","owner":"insign","description":"Dumps details in tree from variable. Optionally exits.","archived":false,"fork":false,"pushed_at":"2026-04-01T04:02:51.000Z","size":33,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-01T06:48:18.108Z","etag":null,"topics":["dart","debug","debugging","php","vardump","vardumper"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/var_dump","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/insign.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-07T23:06:58.000Z","updated_at":"2026-04-01T04:02:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc0f8cae-c6a3-4427-aa81-8063ce120036","html_url":"https://github.com/insign/dart_var_dump","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/insign/dart_var_dump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insign%2Fdart_var_dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insign%2Fdart_var_dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insign%2Fdart_var_dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insign%2Fdart_var_dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insign","download_url":"https://codeload.github.com/insign/dart_var_dump/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insign%2Fdart_var_dump/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32028053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"ssl_error","status_checked_at":"2026-04-20T00:17:31.068Z","response_time":55,"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":["dart","debug","debugging","php","vardump","vardumper"],"created_at":"2024-11-16T13:09:26.203Z","updated_at":"2026-04-20T00:32:36.183Z","avatar_url":"https://github.com/insign.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# var_dump for Dart\n\nA simple, yet powerful, variable dumper for Dart that provides detailed, colorized output, similar to Symfony's `var_dumper`.\n\n## Features\n\n*   **Detailed output:** Dumps detailed information about variables, including their type and value.\n*   **Colorized output:** Uses ANSI escape codes to colorize the output for better readability.\n*   **Handles complex data types:** Can dump nested lists, maps, and sets.\n*   **Handles custom objects:** Can dump custom objects, and will use the `toJson()` method if it is available.\n*   **Handles circular references:** Detects and handles circular references to prevent infinite loops.\n*   **Multiple dump functions:** Provides `dump()`, `var_dump()`, and `dd()` functions for different use cases.\n\n## Installation\n\nAdd the following to your `pubspec.yaml` file:\n\n```yaml\ndev_dependencies:\n  var_dump: ^0.5.0 # Replace with the latest version\n```\n\nThen, run `dart pub get`.\n\n## Usage\n\nImport the library:\n\n```dart\nimport 'package:var_dump/var_dump.dart';\n```\n\n### Basic Usage\n\nThe `dump()` function prints a detailed, colorized representation of a variable to the console.\n\n```dart\nvoid main() {\n  final myVariable = {'name': 'John Doe', 'age': 30};\n  dump(myVariable);\n}\n```\n\n### `var_dump()`\n\nThe `var_dump()` function is an alias for `dump()`.\n\n```dart\nvoid main() {\n  final myVariable = {'name': 'John Doe', 'age': 30};\n  var_dump(myVariable);\n}\n```\n\n### `dd()` (Dump and Die)\n\nThe `dd()` function dumps a variable and then immediately terminates the script.\n\n```dart\nvoid main() {\n  final myVariable = {'name': 'John Doe', 'age': 30};\n  dd(myVariable);\n  // This code will not be executed.\n  print('Hello, world!');\n}\n```\n\n### Examples\n\n#### Dumping a List\n\n```dart\nvoid main() {\n  final myList = [1, 'two', true, [1, 2, 3]];\n  dump(myList);\n}\n```\n\n#### Dumping a Map\n\n```dart\nvoid main() {\n  final myMap = {\n    'name': 'John Doe',\n    'age': 30,\n    'address': {\n      'street': '123 Main St',\n      'city': 'Anytown',\n    },\n  };\n  dump(myMap);\n}\n```\n\n#### Dumping a Custom Object\n\nIf a custom object has a `toJson()` method, the dumper will use it to get a map of the object's properties. Otherwise, it will use the `toString()` method.\n\n```dart\nclass MyClassWithToJson {\n  MyClassWithToJson(this.a, this.b);\n\n  final int a;\n  final String b;\n\n  Map\u003cString, dynamic\u003e toJson() =\u003e {\n        'a': a,\n        'b': b,\n      };\n}\n\nclass MyClassWithoutToJson {\n  MyClassWithoutToJson(this.a, this.b);\n\n  final int a;\n  final String b;\n}\n\nvoid main() {\n  final withToJson = MyClassWithToJson(1, 'two');\n  final withoutToJson = MyClassWithoutToJson(1, 'two');\n\n  dump(withToJson);\n  dump(withoutToJson);\n}\n```\n\n#### Disabling Colorization\n\nTo disable colorization, pass `colorize: false` to the dump function.\n\n```dart\nvoid main() {\n  final myVariable = {'name': 'John Doe', 'age': 30};\n  dump(myVariable, colorize: false);\n}\n```\n\n## Contributing\n\nContributions are welcome! If you find a bug or have a feature request, please open an issue. If you would like to contribute code, please open a pull request.\n\n## License\n\nThis project is licensed under the BSD 3-Clause License. See the [LICENSE](./LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsign%2Fdart_var_dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsign%2Fdart_var_dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsign%2Fdart_var_dump/lists"}