diff --git a/.github/scripts/update_changelog.dart b/.github/scripts/update_changelog.dart index 96afa7f..71a601a 100644 --- a/.github/scripts/update_changelog.dart +++ b/.github/scripts/update_changelog.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 21a184c..db61594 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -1,8 +1,9 @@ ##.title ## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ## -## Dart/Flutter (DF) Packages by DevCetra.com & contributors. ee LICENSE file -## in root directory. +## Dart/Flutter (DF) Packages by DevCetra.com & contributors. Use of this +## source code is governed by an MIT-style license that can be found in the +## LICENSE file. ## ## For more about publishing, see: https://dart.dev/tools/pub/automated-publishing ## @@ -30,9 +31,6 @@ jobs: - name: Set up Dart uses: dart-lang/setup-dart@v1.2 - - name: Upgrade dependencies - run: dart pub upgrade --tighten - - name: Format Dart code run: dart format . diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index eed4fad..e27507d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,7 @@ ## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ## ## Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -## file in the root directory. +## file in root directory. ## ## A workflow that publishes a Dart package to pub.dev. For more about ## publishing, see: https://dart.dev/tools/pub/automated-publishing diff --git a/.gitignore b/.gitignore index 690fbaa..88ebb3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,18 @@ ##.title ## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ## -## Dart/Flutter (DF) Packages by DevCetra.com & contributors. See LICENSE file -## in root directory. +## Dart/Flutter (DF) Packages by DevCetra.com & contributors. Use of this +## source code is governed by an MIT-style license that can be found in the +## LICENSE file. ## ## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ##.title~ -**/___generators/ **/.dart_tool/ **/.DS_Store **/build/ **/pubspec.lock -**/.github/.git \ No newline at end of file +**/.github/.git +**/.metadata +**/.flutter-plugins +**/.flutter-plugins-dependencies \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6784471..601c2ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ ## [0.1.1] - Released @ 8/2024 (UTC) -- chore: Update imports in \_index.g.dart +- chore: Update imports in _index.g.dart ## [0.1.0] diff --git a/README.md b/README.md index 028a1de..b3f7532 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # DF Config +Buy Me A Coffee + Dart & Flutter Packages by DevCetra.com & contributors. [![Pub Package](https://img.shields.io/pub/v/df_config.svg)](https://pub.dev/packages/df_config) @@ -23,20 +25,40 @@ Use this package as a dependency by adding it to your `pubspec.yaml` file (see [ ## Contributing and Discussions -This is an open-source project, and contributions are welcome from everyone, regardless of experience level. Contributing to projects is a great way to learn, share knowledge, and showcase your skills to the community. Join the discussions to ask questions, report bugs, suggest features, share ideas, or find out how you can contribute. +This is an open-source project, and we warmly welcome contributions from everyone, regardless of experience level. Whether you're a seasoned developer or just starting out, contributing to this project is a fantastic way to learn, share your knowledge, and make a meaningful impact on the community. -### Join GitHub Discussions: +### Ways you can contribute: -💬 https://github.com/robmllze/df_config/discussions/ +- **Join the discussions and ask questions:** Your curiosity can lead to valuable insights and improvements. +- **Buy me a coffee:** If you'd like to support the project financially, consider [buying me a coffee](https://www.buymeacoffee.com/robmllze). Your support helps cover the costs of development and keeps the project growing. +- **Share your ideas:** Every perspective matters, and your ideas can spark innovation. +- **Report bugs:** Help us identify and fix issues to make the project more robust. +- **Suggest improvements or new features:** Your ideas can help shape the future of the project. +- **Help clarify documentation:** Good documentation is key to accessibility. You can make it easier for others to get started by improving or expanding our documentation. +- **Write articles:** Share your knowledge by writing tutorials, guides, or blog posts about your experiences with the project. It's a great way to contribute and help others learn. + +No matter how you choose to contribute, your involvement is greatly appreciated and valued! + +--- ### Join Reddit Discussions: 💬 https://www.reddit.com/r/df_config/ +### Join GitHub Discussions: + +💬 https://github.com/robmllze/df_config/discussions/ + ### Chief Maintainer: 📧 Email _Robert Mollentze_ at robmllze@gmail.com +### Dontations: + +If you're enjoying this package and find it valuable, consider showing your appreciation with a small donation. Every bit helps in supporting future development. You can donate here: + +https://www.buymeacoffee.com/robmllze + --- ## License diff --git a/analysis_options.yaml b/analysis_options.yaml index 35e9bc1..0a26d0b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,8 +1,9 @@ ##.title ## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ## -## Dart/Flutter (DF) Packages by DevCetra.com & contributors. See LICENSE file -## in root directory. +## Dart/Flutter (DF) Packages by DevCetra.com & contributors. Use of this +## source code is governed by an MIT-style license that can be found in the +## LICENSE file. ## ## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ##.title~ @@ -13,9 +14,11 @@ include: package:lints/recommended.yaml linter: rules: - always_declare_return_types: true - avoid_renaming_method_parameters: false + avoid_web_libraries_in_flutter: true + camel_case_types: false constant_identifier_names: false + file_names: false + library_private_types_in_public_api: false non_constant_identifier_names: false omit_local_variable_types: true prefer_const_constructors_in_immutables: true @@ -24,14 +27,22 @@ linter: prefer_relative_imports: true prefer_single_quotes: true require_trailing_commas: true - unnecessary_this: false - camel_case_types: false + unnecessary_this: true analyzer: exclude: - build/** - #- '**/*.g.dart' + errors: + always_declare_return_types: error + avoid_renaming_method_parameters: error + avoid_type_to_string: error + depend_on_referenced_packages: error + flutter_style_todos: error + invalid_use_of_protected_member: error + no_leading_underscores_for_local_identifiers: error prefer_final_in_for_each: error + prefer_relative_imports: error unnecessary_new: error unrelated_type_equality_checks: error + use_key_in_widget_constructors: error diff --git a/flutter_analysis_options.yaml b/flutter_analysis_options.yaml deleted file mode 100644 index ba535ed..0000000 --- a/flutter_analysis_options.yaml +++ /dev/null @@ -1,46 +0,0 @@ -##.title -## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -## -## Dart/Flutter (DF) Packages by DevCetra.com & contributors. See LICENSE file -## in root directory. -## -## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -##.title~ - -include: package:flutter_lints/flutter.yaml - -## ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ - -linter: - rules: - avoid_web_libraries_in_flutter: true - constant_identifier_names: false - file_names: false - non_constant_identifier_names: false - omit_local_variable_types: true - prefer_const_constructors_in_immutables: true - prefer_const_constructors: true - prefer_final_fields: true - prefer_relative_imports: true - prefer_single_quotes: true - require_trailing_commas: true - unnecessary_this: false - camel_case_types: false - library_private_types_in_public_api: false - -analyzer: - exclude: - - build/** - - errors: - always_declare_return_types: error - avoid_renaming_method_parameters: error - avoid_type_to_string: error - depend_on_referenced_packages: error - flutter_style_todos: error - no_leading_underscores_for_local_identifiers: error - prefer_final_in_for_each: error - prefer_relative_imports: error - unnecessary_new: error - unrelated_type_equality_checks: error - use_key_in_widget_constructors: error diff --git a/lib/df_config.dart b/lib/df_config.dart index 413b4a4..7e5af1f 100644 --- a/lib/df_config.dart +++ b/lib/df_config.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/configs/config.dart b/lib/src/configs/config.dart index 5a0a3bd..dc2f473 100644 --- a/lib/src/configs/config.dart +++ b/lib/src/configs/config.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/configs/file_config.dart b/lib/src/configs/file_config.dart index 797ecf4..848da29 100644 --- a/lib/src/configs/file_config.dart +++ b/lib/src/configs/file_config.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ @@ -45,18 +45,18 @@ class FileConfig extends Config { /// Reads and processes the associated file. Future readAssociatedFile() async { - switch (this.ref?.type) { + switch (ref?.type) { case ConfigFileType.JSON: - await this._readJsonFile(); + await _readJsonFile(); break; case ConfigFileType.JSONC: - await this._readJsoncFile(); + await _readJsoncFile(); break; case ConfigFileType.YAML: - await this._readYamlFile(); + await _readYamlFile(); break; case ConfigFileType.CSV: - await this._readCsvFile(); + await _readCsvFile(); break; default: return false; @@ -66,37 +66,37 @@ class FileConfig extends Config { /// Processes a JSON file. Future _readJsonFile() async { - final src = await this.ref?.read?.call(); + final src = await ref?.read?.call(); if (src != null) { final data = jsonToData(src); - this.setFields(data); + setFields(data); } } /// Processes a JSONC file. Future _readJsoncFile() async { - var src = await this.ref?.read?.call(); + var src = await ref?.read?.call(); if (src != null) { final data = jsoncToData(src); - this.setFields(data); + setFields(data); } } /// Processes a YAML file. Future _readYamlFile() async { - final src = await this.ref?.read?.call(); + final src = await ref?.read?.call(); if (src != null) { final data = yamlToData(src); - this.setFields(data); + setFields(data); } } /// Processes a CSV file. Future _readCsvFile() async { - final src = await this.ref?.read?.call(); + final src = await ref?.read?.call(); if (src != null) { - final data = csvToData(src, this.settings); - this.setFields(data); + final data = csvToData(src, settings); + setFields(data); } } } diff --git a/lib/src/extensions/cf_on_string_extension.dart b/lib/src/extensions/cf_on_string_extension.dart index 2995ff4..93b4c4b 100644 --- a/lib/src/extensions/cf_on_string_extension.dart +++ b/lib/src/extensions/cf_on_string_extension.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/extensions/tr_on_string_extension.dart b/lib/src/extensions/tr_on_string_extension.dart index ee5f796..04db6ee 100644 --- a/lib/src/extensions/tr_on_string_extension.dart +++ b/lib/src/extensions/tr_on_string_extension.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/managers/config_manager.dart b/lib/src/managers/config_manager.dart index d2386fe..8c25979 100644 --- a/lib/src/managers/config_manager.dart +++ b/lib/src/managers/config_manager.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ @@ -34,8 +34,7 @@ class ConfigManager { // void setConfig(TConfig config) async { - final added = - this.configs.firstWhereOrNull((e) => e.ref == config.ref) != null; + final added = this.configs.firstWhereOrNull((e) => e.ref == config.ref) != null; if (!added) { this.configs.add(config); } diff --git a/lib/src/managers/file_config_manager.dart b/lib/src/managers/file_config_manager.dart index ddf91a6..4a8c2cb 100644 --- a/lib/src/managers/file_config_manager.dart +++ b/lib/src/managers/file_config_manager.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ @@ -26,10 +26,9 @@ class FileConfigManager extends ConfigManager { // Future setFileConfig(FileConfig fileConfig) async { - final added = - this.configs.firstWhereOrNull((e) => e.ref == fileConfig.ref) != null; + final added = configs.firstWhereOrNull((e) => e.ref == fileConfig.ref) != null; if (!added) { - this.configs.add(fileConfig); + configs.add(fileConfig); await fileConfig.readAssociatedFile(); } } diff --git a/lib/src/managers/translation_manager.dart b/lib/src/managers/translation_manager.dart index 2ee9114..bb77843 100644 --- a/lib/src/managers/translation_manager.dart +++ b/lib/src/managers/translation_manager.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/refs/config_file_ref.dart b/lib/src/refs/config_file_ref.dart index 23b549c..49b4add 100644 --- a/lib/src/refs/config_file_ref.dart +++ b/lib/src/refs/config_file_ref.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/refs/config_ref.dart b/lib/src/refs/config_ref.dart index 991b557..c5c903c 100644 --- a/lib/src/refs/config_ref.dart +++ b/lib/src/refs/config_ref.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/refs/locale_ref.dart b/lib/src/refs/locale_ref.dart index 5518117..37d2e14 100644 --- a/lib/src/refs/locale_ref.dart +++ b/lib/src/refs/locale_ref.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/utils/config_file_type.dart b/lib/src/utils/config_file_type.dart index c2ea1c7..689da21 100644 --- a/lib/src/utils/config_file_type.dart +++ b/lib/src/utils/config_file_type.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/utils/extract_scopes.dart b/lib/src/utils/extract_scopes.dart index 2bce78f..1caace9 100644 --- a/lib/src/utils/extract_scopes.dart +++ b/lib/src/utils/extract_scopes.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/utils/parse_source_for_strings_and_comments.dart b/lib/src/utils/parse_source_for_strings_and_comments.dart index 77b546d..2def2f2 100644 --- a/lib/src/utils/parse_source_for_strings_and_comments.dart +++ b/lib/src/utils/parse_source_for_strings_and_comments.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ @@ -18,22 +18,19 @@ ParseSourceForStringsAndCommentsResult parseSourceForStringsAndComments( var buffer = ''; final cNull = const Utf8Decoder().convert([0]); final cNotNewline = RegExp('[^\n]'); - final matchesMultiLineComments = - RegExp(_REG_EXP_MULTI_LINE_COMMENT).allMatches(source); + final matchesMultiLineComments = RegExp(_REG_EXP_MULTI_LINE_COMMENT).allMatches(source); for (final match in matchesMultiLineComments) { final a = match.group(0)!; final b = a.replaceAll(cNotNewline, cNull); buffer = source.replaceFirst(a, b); } - final matchesQuotedStrings = - RegExp(_REG_EXP_QUOTED_STRING).allMatches(buffer); + final matchesQuotedStrings = RegExp(_REG_EXP_QUOTED_STRING).allMatches(buffer); for (final match in matchesQuotedStrings) { final a = match.group(0)!; final b = a.replaceAll(cNotNewline, cNull); buffer = buffer.replaceFirst(a, b); } - final matchesSingleLineComments = - RegExp(_REG_EXP_SINGLE_LINE_COMMENT).allMatches(buffer); + final matchesSingleLineComments = RegExp(_REG_EXP_SINGLE_LINE_COMMENT).allMatches(buffer); final multiLineComments = []; for (final match in matchesMultiLineComments) { multiLineComments.add(source.substring(match.start, match.end)); @@ -63,8 +60,7 @@ ParseSourceForStringsAndCommentsResult parseSourceForStringsAndComments( // ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ -const _REG_EXP_MULTI_LINE_COMMENT = - r'(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)'; +const _REG_EXP_MULTI_LINE_COMMENT = r'(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)'; const _REG_EXP_SINGLE_LINE_COMMENT = r'\/\/.*'; const _REG_EXP_QUOTED_STRING = r'''(["'])([^\\]*?(?:\\.[^\\]*?)*)\1'''; diff --git a/lib/src/utils/recursive_replace.dart b/lib/src/utils/recursive_replace.dart index d69a206..a1a2f6e 100644 --- a/lib/src/utils/recursive_replace.dart +++ b/lib/src/utils/recursive_replace.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/utils/replace_data.dart b/lib/src/utils/replace_data.dart index 75aebf9..354214f 100644 --- a/lib/src/utils/replace_data.dart +++ b/lib/src/utils/replace_data.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/utils/replace_patterns.dart b/lib/src/utils/replace_patterns.dart index 51405e3..ad4aa65 100644 --- a/lib/src/utils/replace_patterns.dart +++ b/lib/src/utils/replace_patterns.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ @@ -27,9 +27,8 @@ String replacePatterns( final e1 = parts.elementAtOrNull(1); final key = (e1 ?? e0)!; final defaultValue = e0 ?? key; - final data1 = settings.caseSensitive - ? data - : data.map((k, v) => MapEntry(k.toString().toLowerCase(), v)); + final data1 = + settings.caseSensitive ? data : data.map((k, v) => MapEntry(k.toString().toLowerCase(), v)); final key1 = settings.caseSensitive ? key : key.toLowerCase(); final suggestedReplacementValue = data1[key1]; final replacementValue = diff --git a/lib/src/utils/src_to_data.dart b/lib/src/utils/src_to_data.dart index 4a2b2cd..948db4d 100644 --- a/lib/src/utils/src_to_data.dart +++ b/lib/src/utils/src_to_data.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ diff --git a/lib/src/utils/translation_file_reader.dart b/lib/src/utils/translation_file_reader.dart index 950e472..1824f3f 100644 --- a/lib/src/utils/translation_file_reader.dart +++ b/lib/src/utils/translation_file_reader.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~ @@ -48,14 +48,14 @@ class TranslationFileReader { String? fileName, }) async { final filePath = p.joinAll([ - ...this.translationsDirPath, - fileName ?? '$localeCode.${this.fileType.extension}', + ...translationsDirPath, + fileName ?? '$localeCode.${fileType.extension}', ]); final fileConfig = FileConfig( ref: ConfigFileRef( ref: localeCode, - type: this.fileType, - read: () => this.fileReader(filePath), + type: fileType, + read: () => fileReader(filePath), ), settings: const ReplacePatternsSettings(caseSensitive: false), ); diff --git a/pubspec.yaml b/pubspec.yaml index 3e65935..8d58320 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,27 +1,36 @@ ##.title ## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ## -## Dart/Flutter (DF) Packages by DevCetra.com & contributors. See LICENSE file -## in root directory. +## Dart/Flutter (DF) Packages by DevCetra.com & contributors. Use of this +## source code is governed by an MIT-style license that can be found in the +## LICENSE file. ## ## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ##.title~ name: df_config description: A package that provides methods to load configuration data and access it at runtime. -version: 0.1.2 +version: 0.2.0 repository: https://github.com/robmllze/df_config +funding: + - https://www.buymeacoffee.com/robmllze +topics: + - cache + - json + - localization + - parser + - utils ## ----------------------------------------------------------------------------- environment: - sdk: ">=3.0.0 < 4.0.0" + sdk: ">=3.5.0 <4.0.0" ## ----------------------------------------------------------------------------- dependencies: - df_collection: ">=0.1.3 <1.0.0" - df_type: ">=0.1.3 <1.0.0" + df_collection: ^0.3.0 + df_type: ^0.2.3 yaml: ^3.1.2 meta: ^1.15.0 equatable: ^2.0.5 diff --git a/test/test1.dart b/test/test1.dart index 8adf60d..81e7c15 100644 --- a/test/test1.dart +++ b/test/test1.dart @@ -2,7 +2,7 @@ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // Dart/Flutter (DF) Packages by DevCetra.com & contributors. SSee MIT LICENSE -// file in the root directory. +// file in root directory. // // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ //.title~