Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adds or updates dart_mappable data models in lib/src/models/content with format validation, code regeneration, and tests.
Use this skill ↓14% 45%+32 ptsof test cases passed
Passed 10 of 22 test cases with the skill, and 3 of 22 without it.
3 of 3 safety checks passed
Not used yet
Add or update a typed content model in this project. Follow the established conventions below as much as possible.
All data models live in the lib/src/models/content directory and
should roughly follow this general structure:
import 'package:dart_mappable/dart_mappable.dart';
import 'content_validation.dart';
part '<filename>.mapper.dart';
/// Doc comment: What this model represents and where it's loaded from.
///
/// Expected data format:
/// - `field_name`: Description and constraints of the expected value.
@MappableClass()
class ModelName with ModelNameMappable {
ModelName({
required this.fieldOne,
required this.fieldTwo,
this.optionalField,
}) {
// Validate all fields beyond their Dart type.
checkFormat(isNotBlank(fieldOne), 'field_one must be a non-empty string.');
// For optional fields, only validate when present:
Next to this one in the catalogue, plus more from the same author.