Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the fill data straightly way #65

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions example/lib/complete/complete.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions example/lib/constructor/constructor.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions example/lib/dog_mapping/dog_mapping.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'package:smartstruct/smartstruct.dart';
part 'dog_mapping.mapper.g.dart';

// TARGET

class Dog {
final String name;
final String breed;
final int age;

Dog(this.name, this.breed, this.age);
}

// SOURCE

class DogModel {
final String dogName;
final String breed;

DogModel(
this.dogName,
this.breed,
);
}

/// Mapper showcasing explicit fieldmapping in case fields do not match their respective fieldnames
@Mapper()
abstract class DogMapper {
@Mapping(source: 'dogName', target: 'name')
@Mapping(source: 'age', target: 'age', isStraight: true)
smotastic marked this conversation as resolved.
Show resolved Hide resolved
Dog fromDogModel(DogModel model, int age);
}
24 changes: 24 additions & 0 deletions example/lib/dog_mapping/dog_mapping.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion example/lib/field_mapping/field_mapping.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions example/lib/freezed/freezed_mapper.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions example/lib/function_mapping/function_mapping.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion example/lib/inheritance/inheritance.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions example/lib/injection/service_locator.config.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions example/lib/list/list.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions example/lib/mapper_inheritance/mapper_inheritance.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions example/lib/multiple_sources/multiple_sources.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions example/lib/nested/nested_mapping.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions example/lib/static_mapping/static_mapping.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion example/lib/static_mapping/static_proxy.mapper.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading