{"id":19120418,"url":"https://github.com/cubetiq/system-config-dart","last_synced_at":"2026-04-18T10:32:22.021Z","repository":{"id":53562285,"uuid":"350982920","full_name":"CUBETIQ/system-config-dart","owner":"CUBETIQ","description":"System Configuration and Dotenv Environment for Dart","archived":false,"fork":false,"pushed_at":"2023-12-15T20:24:18.000Z","size":37,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-03T08:15:02.139Z","etag":null,"topics":["dart","dotenv","system-config"],"latest_commit_sha":null,"homepage":"","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/CUBETIQ.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":"2021-03-24T07:19:08.000Z","updated_at":"2021-05-28T08:23:28.000Z","dependencies_parsed_at":"2023-02-04T08:31:44.231Z","dependency_job_id":null,"html_url":"https://github.com/CUBETIQ/system-config-dart","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CUBETIQ%2Fsystem-config-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CUBETIQ%2Fsystem-config-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CUBETIQ%2Fsystem-config-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CUBETIQ%2Fsystem-config-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CUBETIQ","download_url":"https://codeload.github.com/CUBETIQ/system-config-dart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240177055,"owners_count":19760308,"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":["dart","dotenv","system-config"],"created_at":"2024-11-09T05:14:06.699Z","updated_at":"2026-04-18T10:32:21.952Z","avatar_url":"https://github.com/CUBETIQ.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dart Configurable Environment\n\n[![Pub](https://img.shields.io/pub/v/configurable.svg)](https://pub.dartlang.org/packages/configurable)\n\n- [x] Allow to get property from env file\n- [x] Cache property for runtime\n- [x] Dotenv file support (use DotenvConfigurationProvider)\n- [x] Support functions (getConfig, getConfigOrNull, hasConfigKey, setConfig)\n- [x] Support nullsafety (dart 2.12.2+)\n- [x] Custom configuration provider\n- [x] Add Async functions support\n\n# Issue\n- Flutter app not support for dotenv (.env) when run on devices (because of runtime in device)\n\n# Resolution\n- Flutter app can be use persistence storage like SharedPreference or FlutterSecureStorage to implement the configuration provider\n\n# Example\n\n```dart\nimport 'package:configurable/configurable.dart';\nimport 'package:configurable/dotenv_configuration_provider.dart';\nimport 'package:configurable/simple_configuration_provider.dart';\nimport 'package:configurable/system_config.dart';\n\nvoid main() {\n  var key = 'app.name';\n  var value = 'CUBETIQ Solution';\n\n  /// in-memory provider (built-in)\n  var simpleProvider = SimpleConfigurationProvider();\n  SystemConfig.setProvider(simpleProvider);\n  var result1 = SystemConfig.getOrNull(key, defaultValue: value);\n\n  /// output: CUBETIQ Solution\n  print(result1);\n\n  /// get config functions\n  getConfig('app.title', defaultValue: 'My App Title!');\n  getConfigOrNull('app.null.ignore');\n\n  /// set config functions\n  /// support only mutable configuration provider\n  setConfig('my.app', 'Hello My App');\n\n  /// dotenv provider (from file .env)\n  var dotenvProvider = DotenvConfigurationProvider();\n  SystemConfig.setProvider(dotenvProvider);\n  var result2 = SystemConfig.getOrNull('HOME');\n\n  /// output: user's home directory\n  print(result2);\n}\n```\n\n# Implement custom configuration provider\n\n```dart\nclass MyCustomProvider implements ConfigurationProvider {\n  Map\u003cString, String?\u003e configDataSet = {};\n\n  @override\n  bool containsKey(String key) {\n    return configDataSet.containsKey(key);\n  }\n\n  @override\n  String? getOrNull(String key, {String? defaultValue}) {\n    var value = configDataSet[key];\n\n    if (value == null) {\n      return defaultValue;\n    }\n\n    return value;\n  }\n}\n```\n\n# Contributors\n\n- Sambo Chea \u003csombochea@cubetiqs.com\u003e\n\n# License\n\n```text\nMIT License\n\nCopyright (c) 2021 CUBETIQ Solution\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubetiq%2Fsystem-config-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcubetiq%2Fsystem-config-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubetiq%2Fsystem-config-dart/lists"}