https://github.com/flarebyte/text_copperframe
The versatile text field for every design
https://github.com/flarebyte/text_copperframe
Last synced: over 1 year ago
JSON representation
The versatile text field for every design
- Host: GitHub
- URL: https://github.com/flarebyte/text_copperframe
- Owner: flarebyte
- License: mit
- Created: 2024-08-06T20:40:38.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-03T19:38:41.000Z (over 1 year ago)
- Last Synced: 2025-01-04T10:23:28.816Z (over 1 year ago)
- Language: Dart
- Size: 112 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# text_copperframe

> The versatile text field for every design
Validate a text field and produce a user-friendly message.

Highlights:
* Validate a text field based on character size
* Validate a text field based on word size
* Validate a URL text field
* Produce meaningful messages that can be understood by the user
* Can produce multiple messages for success or failure
A few examples:
Create a message:
```dart
final tooSmallMessage = CopperframeMessage(label: 'Too small',level: CopperframeMessageLevel.error, category: 'length');
```
Create a rule:
```dart
final minRule = CopperframeFieldRule(name: 'chars more than',options: {'text#minChars': '1'}, successMessages: [], failureMessages: [tooSmallMessage]);
```
Create a field event:
```dart
final event = CopperframeFieldEvent(name: 'OnCharChange', rules: [minRule]);
```
Create a text field event builder:
```dart
final builder = TextFieldEventBuilder(fieldEvent: event, metricStoreHolder: metricStoreHolder, optionsInventory: optionsInventory, widgetOptions: {'pageRow': 'row123'}, pageOptions: {'page': 'page789'});
```
Build a text field event using the builder:
```dart
final textRule = builder.build();
```
Validate the text field:
```dart
textRule.validate('some text');
```
## Documentation and links
* [Code Maintenance :wrench:](MAINTENANCE.md)
* [Code Of Conduct](CODE_OF_CONDUCT.md)
* [Contributing :busts_in_silhouette: :construction:](CONTRIBUTING.md)
* [Architectural Decision Records :memo:](DECISIONS.md)
* [Contributors :busts_in_silhouette:](https://github.com/flarebyte/text_copperframe/graphs/contributors)
* [Dependencies](https://github.com/flarebyte/text_copperframe/network/dependencies)
* [Glossary :book:](https://github.com/flarebyte/overview/blob/main/GLOSSARY.md)
* [Software engineering principles :gem:](https://github.com/flarebyte/overview/blob/main/PRINCIPLES.md)
* [Overview of Flarebyte.com ecosystem :factory:](https://github.com/flarebyte/overview)
* [Dart dependencies](DEPENDENCIES.md)
* [Usage](USAGE.md)
* [Example](example/example.dart)
## Related
* [form_validator](https://pub.dev/packages/form_validator)