From d66a51b1588db4df9a05729a8836cd20288435da Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Oct 2025 08:35:00 +0000 Subject: [PATCH 1/5] Initial plan From 065f1955b56f2449f3837e26dee0eff8068c0c89 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Oct 2025 08:40:50 +0000 Subject: [PATCH 2/5] Update repository references from YoungMayor/mayr_dart_validator to MayR-Labs/dart_validator Co-authored-by: YoungMayor <47315212+YoungMayor@users.noreply.github.com> --- .github/copilot-instructions.md | 165 ++++++++++++++++++ CHANGELOG.md | 2 +- CONTRIBUTING.md | 14 +- IMPLEMENTATION_SUMMARY.md | 6 +- LICENSE | 2 +- README.md | 24 +-- example/flutter_example/README.md | 2 +- example/flutter_example/main.dart | 2 +- .../flutter_example/setup_validations.dart | 2 +- example/mayr_validator_example.dart | 4 +- example/setup_validations.dart | 2 +- lib/mayr_validator.dart | 2 +- pubspec.yaml | 10 +- test/mayr_validator_test.dart | 2 +- 14 files changed, 202 insertions(+), 37 deletions(-) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..eb8b391 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,165 @@ +# GitHub Copilot Instructions for dart_validator + +## Project Overview +This is a Flutter/Dart validation package called **dart_validator** (formerly mayr_validator), providing a fluent API for building validations inspired by Laravel's validator syntax. + +## Package Information +- **Organization**: MayR Labs (https://github.com/MayR-Labs) +- **Website**: https://mayrlabs.com +- **Repository**: https://github.com/MayR-Labs/dart_validator +- **Package Name**: dart_validator +- **License**: MIT License, Copyright (c) 2025 MayR Labs + +## Development Guidelines + +### Code Style +- Follow the [Dart Style Guide](https://dart.dev/guides/language/effective-dart/style) +- Use `dart format` to format all Dart code +- Run `dart analyze` or `flutter analyze` to check for issues before committing +- Maintain consistency with existing code patterns + +### Architecture +- **Core Singleton Pattern**: `MayrValidationCore` handles global configuration +- **Fluent API**: `MayrValidator` provides chainable validation methods +- **Extension Methods**: Enable elegant syntax like `value.mayrValidator()` +- **Separation of Concerns**: Keep validators, core logic, and extensions separate + +### Testing +- Write comprehensive tests for all validation rules +- Use descriptive test names that explain what is being tested +- Follow the existing test structure with `group()` and `test()` blocks +- Aim for high test coverage +- Run tests with `flutter test` or `dart test` + +### Adding New Validators +When adding a new validation rule: + +1. **Add the method to `MayrValidator` class** in `lib/src/validators/` +2. **Include dartdoc comments** explaining the validator's purpose and parameters +3. **Add comprehensive tests** covering valid and invalid cases +4. **Update documentation**: + - Add to README.md in the appropriate category + - Update API.md if it exists + - Add entry to CHANGELOG.md +5. **Support message templating** with placeholders like `{min}`, `{max}`, `{value}` + +### Flutter Integration +- Ensure validators work seamlessly with `TextFormField` +- Support both pure Dart and Flutter contexts +- Test validators in Flutter example app when adding UI-related validation + +### Error Messages +- Provide clear, user-friendly error messages +- Support message customization through parameters +- Use global message configuration when available +- Include placeholders for dynamic values + +### Custom Rules and Groups +- Support custom rule registration via `MayrValidationCore().registerRule()` +- Support validation groups via `MayrValidationCore().registerGroup()` +- Handle environment-aware behavior (dev vs production) + +### Dependencies +- Keep dependencies minimal +- Avoid adding unnecessary external packages +- Only use well-maintained packages with good pub.dev scores +- Update dependencies carefully and test thoroughly + +### Documentation +- Write clear dartdoc comments for all public APIs +- Include code examples in documentation +- Keep README.md up to date with new features +- Maintain CHANGELOG.md following semantic versioning +- Update CONTRIBUTING.md when changing development workflows + +### Commit Messages +- Use clear, descriptive commit messages +- Follow conventional commit format when possible +- Reference issue numbers when applicable + +### Pull Requests +- Ensure all tests pass before submitting +- Run formatter and analyzer +- Update documentation as needed +- Provide clear description of changes +- Link to related issues + +### CI/CD +- All PRs must pass CI checks (tests, formatting, analysis) +- CI runs on GitHub Actions +- Workflow file: `.github/workflows/ci.yaml` + +## Common Patterns + +### Validator Method Template +```dart +/// [Description of what this validates] +/// +/// [Optional: Additional details, examples, or constraints] +/// +/// Example: +/// ```dart +/// MayrValidator('value').ruleName().run(); +/// ``` +MayrValidator ruleName([String? customMessage]) { + _rules.add(() { + if (value == null) return null; + + // Validation logic + if (/* validation fails */) { + return customMessage ?? + _core.getMessage('ruleName') ?? + 'Default error message'; + } + return null; + }); + return this; +} +``` + +### Test Template +```dart +group('ruleName', () { + test('should return null for valid values', () { + expect(MayrValidator('valid').ruleName().run(), isNull); + }); + + test('should return error message for invalid values', () { + final error = MayrValidator('invalid').ruleName().run(); + expect(error, isNotNull); + expect(error, contains('expected text')); + }); + + test('should accept custom error message', () { + const customMessage = 'Custom error'; + final error = MayrValidator('invalid').ruleName(customMessage).run(); + expect(error, equals(customMessage)); + }); +}); +``` + +## Package Structure +``` +dart_validator/ +├── lib/ +│ ├── src/ +│ │ ├── core/ # MayrValidationCore singleton +│ │ ├── validators/ # MayrValidator class +│ │ └── extensions/ # Extension methods +│ └── mayr_validator.dart # Main library export +├── test/ # Test files +├── example/ +│ ├── mayr_validator_example.dart +│ └── flutter_example/ # Flutter example app +├── .github/ +│ └── workflows/ # CI/CD workflows +└── docs/ # Additional documentation +``` + +## Important Notes +- Always maintain backward compatibility when possible +- Follow semantic versioning for releases +- Keep the API fluent and chainable +- Ensure validators work in both Dart and Flutter contexts +- Support null safety throughout the codebase +- Test validators with various input types (null, empty, edge cases) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4dc82f..5769a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,5 +37,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ⚡ **Debounce Support** - Control when validations run - 🧍‍♂️ **Standalone or Flutter-ready** - Works in pure Dart and Flutter -[1.0.0]: https://github.com/YoungMayor/mayr_dart_validator/releases/tag/v1.0.0 +[1.0.0]: https://github.com/MayR-Labs/dart_validator/releases/tag/v1.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e699042..68731a1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ Thank you for your interest in contributing to MayrValidations! We welcome contr If you find a bug or have a feature request: -1. Check if the issue already exists in [GitHub Issues](https://github.com/YoungMayor/mayr_dart_validator/issues) +1. Check if the issue already exists in [GitHub Issues](https://github.com/MayR-Labs/dart_validator/issues) 2. If not, create a new issue with: - Clear title and description - Steps to reproduce (for bugs) @@ -22,8 +22,8 @@ We love pull requests! Here's how to contribute code: 1. **Fork the repository** ```bash - git clone https://github.com/YOUR_USERNAME/mayr_dart_validator.git - cd mayr_dart_validator + git clone https://github.com/YOUR_USERNAME/dart_validator.git + cd dart_validator ``` 2. **Create a feature branch** @@ -101,7 +101,7 @@ group('Feature Name', () { ## 🏗️ Project Structure ``` -mayr_dart_validator/ +dart_validator/ ├── lib/ │ ├── src/ │ │ ├── core/ # Core singleton and configuration @@ -183,9 +183,9 @@ By contributing, you agree that your contributions will be licensed under the MI If you have questions: -- Open a [GitHub Discussion](https://github.com/YoungMayor/mayr_dart_validator/discussions) -- Check existing [Issues](https://github.com/YoungMayor/mayr_dart_validator/issues) -- Read the [Documentation](https://github.com/YoungMayor/mayr_dart_validator) +- Open a [GitHub Discussion](https://github.com/MayR-Labs/dart_validator/discussions) +- Check existing [Issues](https://github.com/MayR-Labs/dart_validator/issues) +- Read the [Documentation](https://github.com/MayR-Labs/dart_validator) ## 👥 Code of Conduct diff --git a/IMPLEMENTATION_SUMMARY.md b/IMPLEMENTATION_SUMMARY.md index d0e4999..67c33be 100644 --- a/IMPLEMENTATION_SUMMARY.md +++ b/IMPLEMENTATION_SUMMARY.md @@ -290,10 +290,10 @@ MayrValidationCore().registerGroup('username', (validator, params) { ## 📦 Package Metadata -- **Name**: mayr_validator +- **Name**: dart_validator - **Version**: 1.0.0 - **Description**: A powerful yet elegant validation library for Dart and Flutter -- **Author**: Meyoron Aghogho (MayR Labs) +- **Organization**: MayR Labs (https://github.com/MayR-Labs) - **License**: MIT - **SDK**: Dart ^3.9.2 - **Dependencies**: None (pure Dart) @@ -305,7 +305,7 @@ MayrValidationCore().registerGroup('username', (validator, params) { 1. **Install the package** ```bash - dart pub add mayr_validator + dart pub add dart_validator ``` 2. **Import and use** diff --git a/LICENSE b/LICENSE index b930618..2604b86 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Meyoron Aghogho +Copyright (c) 2025 MayR Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 78c2e34..9fb10b6 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ ![License](https://img.shields.io/badge/license-MIT-blue.svg?label=Licence) ![Platform](https://img.shields.io/badge/Platform-Flutter-blue.svg) -![Pub Version](https://img.shields.io/pub/v/mayr_validator?style=plastic&label=Version) -![Pub.dev Score](https://img.shields.io/pub/points/mayr_validator?label=Score&style=plastic) -![Pub Likes](https://img.shields.io/pub/likes/mayr_validator?label=Likes&style=plastic) -![Pub.dev Publisher](https://img.shields.io/pub/publisher/mayr_validator?label=Publisher&style=plastic) -![Downloads](https://img.shields.io/pub/dm/mayr_validator.svg?label=Downloads&style=plastic) +![Pub Version](https://img.shields.io/pub/v/dart_validator?style=plastic&label=Version) +![Pub.dev Score](https://img.shields.io/pub/points/dart_validator?label=Score&style=plastic) +![Pub Likes](https://img.shields.io/pub/likes/dart_validator?label=Likes&style=plastic) +![Pub.dev Publisher](https://img.shields.io/pub/publisher/dart_validator?label=Publisher&style=plastic) +![Downloads](https://img.shields.io/pub/dm/dart_validator.svg?label=Downloads&style=plastic) -![Build Status](https://img.shields.io/github/actions/workflow/status/YoungMayor/mayr_dart_validator/ci.yaml?label=Build) -![Issues](https://img.shields.io/github/issues/YoungMayor/mayr_dart_validator.svg?label=Issues) -![Last Commit](https://img.shields.io/github/last-commit/YoungMayor/mayr_dart_validator.svg?label=Latest%20Commit) -![Contributors](https://img.shields.io/github/contributors/YoungMayor/mayr_dart_validator.svg?label=Contributors) +![Build Status](https://img.shields.io/github/actions/workflow/status/MayR-Labs/dart_validator/ci.yaml?label=Build) +![Issues](https://img.shields.io/github/issues/MayR-Labs/dart_validator.svg?label=Issues) +![Last Commit](https://img.shields.io/github/last-commit/MayR-Labs/dart_validator.svg?label=Latest%20Commit) +![Contributors](https://img.shields.io/github/contributors/MayR-Labs/dart_validator.svg?label=Contributors) # 🧠 MayrValidations @@ -36,14 +36,14 @@ It provides a fluent API to build validations that are **expressive**, **chainab Add to your project: ```bash -dart pub add mayr_validations +dart pub add dart_validator ``` Or in `pubspec.yaml`: ```yaml dependencies: - mayr_validations: ^1.0.0 + dart_validator: ^1.0.0 ``` --- @@ -526,7 +526,7 @@ This package is licensed under the MIT License — which means you are free to u > See the [LICENSE](LICENSE) file for more details. -MIT © 2025 [MayR Labs](https://github.com/mayrlabs) +MIT © 2025 [MayR Labs](https://github.com/MayR-Labs) --- diff --git a/example/flutter_example/README.md b/example/flutter_example/README.md index 4c204c5..410855e 100644 --- a/example/flutter_example/README.md +++ b/example/flutter_example/README.md @@ -23,7 +23,7 @@ Since this is a Flutter-specific example, you'll need to: dependencies: flutter: sdk: flutter - mayr_validator: ^1.0.0 + dart_validator: ^1.0.0 ``` 3. **Copy the example:** diff --git a/example/flutter_example/main.dart b/example/flutter_example/main.dart index 2a24514..d464637 100644 --- a/example/flutter_example/main.dart +++ b/example/flutter_example/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:mayr_validator/mayr_validator.dart'; +import 'package:dart_validator/mayr_validator.dart'; import 'setup_validations.dart'; /// Flutter Example for MayrValidator diff --git a/example/flutter_example/setup_validations.dart b/example/flutter_example/setup_validations.dart index 33457bc..f53bb77 100644 --- a/example/flutter_example/setup_validations.dart +++ b/example/flutter_example/setup_validations.dart @@ -1,4 +1,4 @@ -import 'package:mayr_validator/mayr_validator.dart'; +import 'package:dart_validator/mayr_validator.dart'; /// Setup global validation configuration and register custom rules/groups. /// diff --git a/example/mayr_validator_example.dart b/example/mayr_validator_example.dart index d6fc35c..49b2418 100644 --- a/example/mayr_validator_example.dart +++ b/example/mayr_validator_example.dart @@ -1,4 +1,4 @@ -import 'package:mayr_validator/mayr_validator.dart'; +import 'package:dart_validator/mayr_validator.dart'; import 'setup_validations.dart'; void main() { @@ -146,7 +146,7 @@ void extensionMethod() { /// /// ```dart /// import 'package:flutter/material.dart'; -/// import 'package:mayr_validator/mayr_validator.dart'; +/// import 'package:dart_validator/mayr_validator.dart'; /// /// class MyForm extends StatefulWidget { /// @override diff --git a/example/setup_validations.dart b/example/setup_validations.dart index 3003dca..c391a8c 100644 --- a/example/setup_validations.dart +++ b/example/setup_validations.dart @@ -1,4 +1,4 @@ -import 'package:mayr_validator/mayr_validator.dart'; +import 'package:dart_validator/mayr_validator.dart'; /// Setup global validation configuration and register custom rules/groups. /// diff --git a/lib/mayr_validator.dart b/lib/mayr_validator.dart index 1b61ad7..6d6a90d 100644 --- a/lib/mayr_validator.dart +++ b/lib/mayr_validator.dart @@ -5,7 +5,7 @@ /// /// Example: /// ```dart -/// import 'package:mayr_validator/mayr_validator.dart'; +/// import 'package:dart_validator/mayr_validator.dart'; /// /// // Basic usage /// final error = MayrValidator('test@example.com') diff --git a/pubspec.yaml b/pubspec.yaml index 162b799..22e76ce 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,10 +1,10 @@ -name: mayr_validator +name: dart_validator description: A powerful yet elegant validation library for Dart and Flutter, inspired by Laravel's validator syntax and philosophy. version: 1.0.0 -homepage: https://github.com/YoungMayor/mayr_dart_validator -repository: https://github.com/YoungMayor/mayr_dart_validator -issue_tracker: https://github.com/YoungMayor/mayr_dart_validator/issues -documentation: https://github.com/YoungMayor/mayr_dart_validator/wiki +homepage: https://github.com/MayR-Labs/dart_validator +repository: https://github.com/MayR-Labs/dart_validator +issue_tracker: https://github.com/MayR-Labs/dart_validator/issues +documentation: https://github.com/MayR-Labs/dart_validator/wiki LICENSE: MIT environment: diff --git a/test/mayr_validator_test.dart b/test/mayr_validator_test.dart index b93ee39..618d106 100644 --- a/test/mayr_validator_test.dart +++ b/test/mayr_validator_test.dart @@ -1,4 +1,4 @@ -import 'package:mayr_validator/mayr_validator.dart'; +import 'package:dart_validator/mayr_validator.dart'; import 'package:test/test.dart'; void main() { From 3739344ab95fffad460bc2b402837921453621e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Oct 2025 08:43:05 +0000 Subject: [PATCH 3/5] Update all package import references in documentation files Co-authored-by: YoungMayor <47315212+YoungMayor@users.noreply.github.com> --- API.md | 2 +- IMPLEMENTATION_SUMMARY.md | 2 +- README.md | 4 ++-- example/README.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/API.md b/API.md index 76b93e7..5360cf9 100644 --- a/API.md +++ b/API.md @@ -594,7 +594,7 @@ final error = nullString.mayrValidator().required().run(); ## Complete Example ```dart -import 'package:mayr_validator/mayr_validator.dart'; +import 'package:dart_validator/mayr_validator.dart'; void main() { // Setup global configuration diff --git a/IMPLEMENTATION_SUMMARY.md b/IMPLEMENTATION_SUMMARY.md index 67c33be..e2726f3 100644 --- a/IMPLEMENTATION_SUMMARY.md +++ b/IMPLEMENTATION_SUMMARY.md @@ -310,7 +310,7 @@ MayrValidationCore().registerGroup('username', (validator, params) { 2. **Import and use** ```dart - import 'package:mayr_validator/mayr_validator.dart'; + import 'package:dart_validator/mayr_validator.dart'; ``` 3. **Setup global configuration** (optional) diff --git a/README.md b/README.md index 9fb10b6..5d7d657 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ dependencies: ### 🧠 Basic Usage in Dart ```dart -import 'package:mayr_validator/mayr_validator.dart'; +import 'package:dart_validator/mayr_validator.dart'; void main() { // Basic validation @@ -70,7 +70,7 @@ void main() { ```dart import 'package:flutter/material.dart'; -import 'package:mayr_validator/mayr_validator.dart'; +import 'package:dart_validator/mayr_validator.dart'; TextFormField( decoration: InputDecoration(labelText: 'Email'), diff --git a/example/README.md b/example/README.md index f68439d..39e2d9e 100644 --- a/example/README.md +++ b/example/README.md @@ -36,7 +36,7 @@ Complete Flutter application examples demonstrating: ### Basic Validation ```dart -import 'package:mayr_validator/mayr_validator.dart'; +import 'package:dart_validator/mayr_validator.dart'; void main() { // Simple validation From 9b4b831bce00ea04b82351471d6cc48afea97ed5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 18 Oct 2025 08:54:05 +0000 Subject: [PATCH 4/5] Revert package name to mayr_validator, keep repository as dart_validator Co-authored-by: YoungMayor <47315212+YoungMayor@users.noreply.github.com> --- .github/copilot-instructions.md | 4 ++-- API.md | 2 +- IMPLEMENTATION_SUMMARY.md | 6 +++--- README.md | 18 +++++++++--------- example/README.md | 2 +- example/flutter_example/README.md | 2 +- example/flutter_example/main.dart | 2 +- example/flutter_example/setup_validations.dart | 2 +- example/mayr_validator_example.dart | 4 ++-- example/setup_validations.dart | 2 +- lib/mayr_validator.dart | 2 +- pubspec.yaml | 2 +- test/mayr_validator_test.dart | 2 +- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index eb8b391..f836f0d 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,13 +1,13 @@ # GitHub Copilot Instructions for dart_validator ## Project Overview -This is a Flutter/Dart validation package called **dart_validator** (formerly mayr_validator), providing a fluent API for building validations inspired by Laravel's validator syntax. +This is a Flutter/Dart validation package called **mayr_validator**, providing a fluent API for building validations inspired by Laravel's validator syntax. ## Package Information - **Organization**: MayR Labs (https://github.com/MayR-Labs) - **Website**: https://mayrlabs.com - **Repository**: https://github.com/MayR-Labs/dart_validator -- **Package Name**: dart_validator +- **Package Name**: mayr_validator - **License**: MIT License, Copyright (c) 2025 MayR Labs ## Development Guidelines diff --git a/API.md b/API.md index 5360cf9..76b93e7 100644 --- a/API.md +++ b/API.md @@ -594,7 +594,7 @@ final error = nullString.mayrValidator().required().run(); ## Complete Example ```dart -import 'package:dart_validator/mayr_validator.dart'; +import 'package:mayr_validator/mayr_validator.dart'; void main() { // Setup global configuration diff --git a/IMPLEMENTATION_SUMMARY.md b/IMPLEMENTATION_SUMMARY.md index e2726f3..095ec71 100644 --- a/IMPLEMENTATION_SUMMARY.md +++ b/IMPLEMENTATION_SUMMARY.md @@ -290,7 +290,7 @@ MayrValidationCore().registerGroup('username', (validator, params) { ## 📦 Package Metadata -- **Name**: dart_validator +- **Name**: mayr_validator - **Version**: 1.0.0 - **Description**: A powerful yet elegant validation library for Dart and Flutter - **Organization**: MayR Labs (https://github.com/MayR-Labs) @@ -305,12 +305,12 @@ MayrValidationCore().registerGroup('username', (validator, params) { 1. **Install the package** ```bash - dart pub add dart_validator + dart pub add mayr_validator ``` 2. **Import and use** ```dart - import 'package:dart_validator/mayr_validator.dart'; + import 'package:mayr_validator/mayr_validator.dart'; ``` 3. **Setup global configuration** (optional) diff --git a/README.md b/README.md index 5d7d657..3c1214e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ ![License](https://img.shields.io/badge/license-MIT-blue.svg?label=Licence) ![Platform](https://img.shields.io/badge/Platform-Flutter-blue.svg) -![Pub Version](https://img.shields.io/pub/v/dart_validator?style=plastic&label=Version) -![Pub.dev Score](https://img.shields.io/pub/points/dart_validator?label=Score&style=plastic) -![Pub Likes](https://img.shields.io/pub/likes/dart_validator?label=Likes&style=plastic) -![Pub.dev Publisher](https://img.shields.io/pub/publisher/dart_validator?label=Publisher&style=plastic) -![Downloads](https://img.shields.io/pub/dm/dart_validator.svg?label=Downloads&style=plastic) +![Pub Version](https://img.shields.io/pub/v/mayr_validator?style=plastic&label=Version) +![Pub.dev Score](https://img.shields.io/pub/points/mayr_validator?label=Score&style=plastic) +![Pub Likes](https://img.shields.io/pub/likes/mayr_validator?label=Likes&style=plastic) +![Pub.dev Publisher](https://img.shields.io/pub/publisher/mayr_validator?label=Publisher&style=plastic) +![Downloads](https://img.shields.io/pub/dm/mayr_validator.svg?label=Downloads&style=plastic) ![Build Status](https://img.shields.io/github/actions/workflow/status/MayR-Labs/dart_validator/ci.yaml?label=Build) ![Issues](https://img.shields.io/github/issues/MayR-Labs/dart_validator.svg?label=Issues) @@ -36,14 +36,14 @@ It provides a fluent API to build validations that are **expressive**, **chainab Add to your project: ```bash -dart pub add dart_validator +dart pub add mayr_validator ``` Or in `pubspec.yaml`: ```yaml dependencies: - dart_validator: ^1.0.0 + mayr_validator: ^1.0.0 ``` --- @@ -53,7 +53,7 @@ dependencies: ### 🧠 Basic Usage in Dart ```dart -import 'package:dart_validator/mayr_validator.dart'; +import 'package:mayr_validator/mayr_validator.dart'; void main() { // Basic validation @@ -70,7 +70,7 @@ void main() { ```dart import 'package:flutter/material.dart'; -import 'package:dart_validator/mayr_validator.dart'; +import 'package:mayr_validator/mayr_validator.dart'; TextFormField( decoration: InputDecoration(labelText: 'Email'), diff --git a/example/README.md b/example/README.md index 39e2d9e..f68439d 100644 --- a/example/README.md +++ b/example/README.md @@ -36,7 +36,7 @@ Complete Flutter application examples demonstrating: ### Basic Validation ```dart -import 'package:dart_validator/mayr_validator.dart'; +import 'package:mayr_validator/mayr_validator.dart'; void main() { // Simple validation diff --git a/example/flutter_example/README.md b/example/flutter_example/README.md index 410855e..4c204c5 100644 --- a/example/flutter_example/README.md +++ b/example/flutter_example/README.md @@ -23,7 +23,7 @@ Since this is a Flutter-specific example, you'll need to: dependencies: flutter: sdk: flutter - dart_validator: ^1.0.0 + mayr_validator: ^1.0.0 ``` 3. **Copy the example:** diff --git a/example/flutter_example/main.dart b/example/flutter_example/main.dart index d464637..2a24514 100644 --- a/example/flutter_example/main.dart +++ b/example/flutter_example/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:dart_validator/mayr_validator.dart'; +import 'package:mayr_validator/mayr_validator.dart'; import 'setup_validations.dart'; /// Flutter Example for MayrValidator diff --git a/example/flutter_example/setup_validations.dart b/example/flutter_example/setup_validations.dart index f53bb77..33457bc 100644 --- a/example/flutter_example/setup_validations.dart +++ b/example/flutter_example/setup_validations.dart @@ -1,4 +1,4 @@ -import 'package:dart_validator/mayr_validator.dart'; +import 'package:mayr_validator/mayr_validator.dart'; /// Setup global validation configuration and register custom rules/groups. /// diff --git a/example/mayr_validator_example.dart b/example/mayr_validator_example.dart index 49b2418..d6fc35c 100644 --- a/example/mayr_validator_example.dart +++ b/example/mayr_validator_example.dart @@ -1,4 +1,4 @@ -import 'package:dart_validator/mayr_validator.dart'; +import 'package:mayr_validator/mayr_validator.dart'; import 'setup_validations.dart'; void main() { @@ -146,7 +146,7 @@ void extensionMethod() { /// /// ```dart /// import 'package:flutter/material.dart'; -/// import 'package:dart_validator/mayr_validator.dart'; +/// import 'package:mayr_validator/mayr_validator.dart'; /// /// class MyForm extends StatefulWidget { /// @override diff --git a/example/setup_validations.dart b/example/setup_validations.dart index c391a8c..3003dca 100644 --- a/example/setup_validations.dart +++ b/example/setup_validations.dart @@ -1,4 +1,4 @@ -import 'package:dart_validator/mayr_validator.dart'; +import 'package:mayr_validator/mayr_validator.dart'; /// Setup global validation configuration and register custom rules/groups. /// diff --git a/lib/mayr_validator.dart b/lib/mayr_validator.dart index 6d6a90d..1b61ad7 100644 --- a/lib/mayr_validator.dart +++ b/lib/mayr_validator.dart @@ -5,7 +5,7 @@ /// /// Example: /// ```dart -/// import 'package:dart_validator/mayr_validator.dart'; +/// import 'package:mayr_validator/mayr_validator.dart'; /// /// // Basic usage /// final error = MayrValidator('test@example.com') diff --git a/pubspec.yaml b/pubspec.yaml index 22e76ce..23a66e6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: dart_validator +name: mayr_validator description: A powerful yet elegant validation library for Dart and Flutter, inspired by Laravel's validator syntax and philosophy. version: 1.0.0 homepage: https://github.com/MayR-Labs/dart_validator diff --git a/test/mayr_validator_test.dart b/test/mayr_validator_test.dart index 618d106..b93ee39 100644 --- a/test/mayr_validator_test.dart +++ b/test/mayr_validator_test.dart @@ -1,4 +1,4 @@ -import 'package:dart_validator/mayr_validator.dart'; +import 'package:mayr_validator/mayr_validator.dart'; import 'package:test/test.dart'; void main() { From 4073002a2ebbd4c6ba29ac3c5efdf00d95842f52 Mon Sep 17 00:00:00 2001 From: Meyoron Aghogho Date: Sat, 18 Oct 2025 10:01:46 +0100 Subject: [PATCH 5/5] Add website link to copyright notice Updated copyright notice to include website link. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2604b86..7b4a18f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 MayR Labs +Copyright (c) 2025 MayR Labs (https://mayrlabs.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal