-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Ignore Attribute in Mapping * Add missing Annotation
- Loading branch information
Showing
9 changed files
with
123 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:smartstruct/smartstruct.dart'; | ||
part 'ignore.mapper.g.dart'; | ||
|
||
class IgnoreSource { | ||
final String ignoreMe; | ||
final String doNotIgnoreMe; | ||
|
||
IgnoreSource(this.ignoreMe, this.doNotIgnoreMe); | ||
} | ||
|
||
class IgnoreTarget { | ||
String? ignoreMe; | ||
final String doNotIgnoreMe; | ||
|
||
IgnoreTarget(this.doNotIgnoreMe); | ||
} | ||
|
||
@Mapper() | ||
abstract class IgnoreMapper { | ||
@Mapping(target: 'ignoreMe', ignore: true) | ||
IgnoreTarget fromIgnore(IgnoreSource source); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
part of 'mapper_test_input.dart'; | ||
|
||
class IgnoreSource { | ||
final String ignoreMe; | ||
final String doNotIgnoreMe; | ||
|
||
IgnoreSource(this.ignoreMe, this.doNotIgnoreMe); | ||
} | ||
|
||
class IgnoreTarget { | ||
String? ignoreMe; | ||
final String doNotIgnoreMe; | ||
|
||
IgnoreTarget(this.doNotIgnoreMe); | ||
} | ||
|
||
@Mapper() | ||
@ShouldGenerate(r''' | ||
class IgnoreMapperImpl extends IgnoreMapper { | ||
IgnoreMapperImpl() : super(); | ||
@override | ||
IgnoreTarget fromIgnore(IgnoreSource source) { | ||
final ignoretarget = IgnoreTarget(source.doNotIgnoreMe); | ||
return ignoretarget; | ||
} | ||
} | ||
''') | ||
abstract class IgnoreMapper { | ||
@Mapping(target: 'ignoreMe', ignore: true) | ||
IgnoreTarget fromIgnore(IgnoreSource source); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters