{"id":16379817,"url":"https://github.com/ericgrandt/money-field","last_synced_at":"2026-01-11T13:34:11.879Z","repository":{"id":56834904,"uuid":"165292598","full_name":"ericgrandt/money-field","owner":"ericgrandt","description":"A simple to use TextEditingController for handling money values in Flutter.","archived":false,"fork":false,"pushed_at":"2019-01-11T19:00:27.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-08T14:09:20.183Z","etag":null,"topics":["controller","dart","flutter","library","money"],"latest_commit_sha":null,"homepage":null,"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/ericgrandt.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":"2019-01-11T18:43:17.000Z","updated_at":"2023-05-30T08:21:59.000Z","dependencies_parsed_at":"2022-09-02T03:50:56.583Z","dependency_job_id":null,"html_url":"https://github.com/ericgrandt/money-field","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericgrandt/money-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgrandt%2Fmoney-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgrandt%2Fmoney-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgrandt%2Fmoney-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgrandt%2Fmoney-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericgrandt","download_url":"https://codeload.github.com/ericgrandt/money-field/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgrandt%2Fmoney-field/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264284401,"owners_count":23584679,"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":["controller","dart","flutter","library","money"],"created_at":"2024-10-11T03:49:44.665Z","updated_at":"2026-01-11T13:34:11.872Z","avatar_url":"https://github.com/ericgrandt.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Money Field\n\nA simple to use TextEditingController for handling money values.\n\n## Install\n\n### 1. Add money_field to your pubspec.yaml:\n\n```yaml\ndependencies:\n    money_field: ^1.0.0\n```\n\n### 2. Install it\n\n```\nflutter packages get\n```\n\n### 3. Import it:\n\n```dart\nimport 'package:money_field/money_field.dart';\n```\n\n## Usage\n\n```dart\nfinal _moneyFieldController = MoneyFieldController();\n\n...\n\nTextFormField(\n    controller: _moneyFieldController,\n    keyboardType: TextInputType.number,\n),\n```\n\n### Customization Options\n\n```dart\nfinal _moneyFieldController = MoneyFieldController(\n    decimalSeparator = '.',\n    thousandsSeparator = ',',\n    invalidFormatError = 'Invalid input format',\n    invalidLengthError = 'Length must be less than or equal to 9',\n    maxDigitsBeforeDecimal = 9\n);\n```\n\n### Convert Input to Double\n\n```dart\nfinal _moneyFieldController = MoneyFieldController();\n\nvar doubleValue = _moneyFieldController.doubleValue();\n```\n\n### Field Validation\n\n```dart\nfinal _moneyFieldController = MoneyFieldController();\n\nTextFormField(\n    controller: _moneyFieldController,\n    keyboardType: TextInputType.number,\n    validator: (_) {\n        return _moneyFieldController.moneyFieldValidator();\n    },\n),\n```\n\n### Check if Input is Valid\n\nIf you'd just like to check if the input is valid, without using the validator, you can:\n\n```dart\nfinal _moneyFieldController = MoneyFieldController();\n\nbool isFormatValid = _moneyFieldController.isFormatValid();\nbool isLengthValid = _moneyFieldController.isLengthValid();\n\n// Checks if format and length are valid\nbool isValid = _moneyFieldController.isInputValid();\n```\n\n## Issues\n\nIf you encounter any issues, feel free to post them on the [GitHub page](https://github.com/Erigitic/money-field/issues).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgrandt%2Fmoney-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericgrandt%2Fmoney-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgrandt%2Fmoney-field/lists"}