Skip to content

Commit c1c64df

Browse files
committed
created mapper annotation
1 parent 07acd47 commit c1c64df

File tree

7 files changed

+57
-0
lines changed

7 files changed

+57
-0
lines changed

core/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.0
2+
3+
- Initial version

core/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# dartstruct_core
2+
3+
See [dartstruct.dart](https://github.com/KernelPanic92/dartstruct)

core/analysis_options.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Defines a default set of lint rules enforced for
2+
# projects at Google. For details and rationale,
3+
# see https://github.com/dart-lang/pedantic#enabled-lints.
4+
include: package:pedantic/analysis_options.yaml
5+
6+
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
7+
# Uncomment to specify additional rules.
8+
# linter:
9+
# rules:
10+
# - camel_case_types
11+
12+
analyzer:
13+
# exclude:
14+
# - path/to/excluded/files/**

core/example/dartstruct_example.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import 'package:dartstruct/dartstruct.dart';
2+
3+
class Model {
4+
String field;
5+
}
6+
7+
class Dto {
8+
String field;
9+
}
10+
11+
@Mapper()
12+
abstract class PostMapper {
13+
Dto modelToDto(Model post);
14+
}

core/lib/dartstruct.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
library dartstruct;
2+
3+
export 'src/annotations/mapper.dart';

core/lib/src/annotations/mapper.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import 'package:meta/meta.dart';
2+
3+
@immutable
4+
class Mapper {
5+
const Mapper();
6+
}

core/pubspec.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: dartstruct
2+
description: dartstruct is an annotation processor generator using source_gen and inspired by Java MapStruct.
3+
version: 0.0.0
4+
5+
environment:
6+
sdk: '>=2.7.0 <3.0.0'
7+
8+
dependencies:
9+
path: ^1.6.0
10+
meta: ^1.1.8
11+
12+
dev_dependencies:
13+
pedantic: ^1.8.0
14+
test: ^1.6.0

0 commit comments

Comments
 (0)