-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathcomplete.dart
More file actions
107 lines (85 loc) · 2.66 KB
/
complete.dart
File metadata and controls
107 lines (85 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import 'package:injectable/injectable.dart';
import 'package:smartstruct/smartstruct.dart';
part 'complete.mapper.g.dart';
class FooSourceTheSecond {
String? secondText;
final String secondTextOther;
FooSourceTheSecond(this.secondTextOther);
}
abstract class SuperFooSource {
final String superText;
String get superGet;
String? _superPropertySet;
String? get superPropertySet => _superPropertySet;
set superPropertySet(String? superPropertySet) {
_superPropertySet = superPropertySet;
}
SuperFooSource(this.superText);
}
class FooSource extends SuperFooSource {
final num number;
final String text;
final bool truthy;
final String named;
final String namedTwo;
String property;
String propertyTwo;
num? setterNumber;
String? setterText;
late FooNestedSource nested;
final List<FooNestedSource> list;
@override
final String superGet;
FooSource(this.number, this.text, this.truthy, this.named, this.setterNumber, this.property, this.propertyTwo,
this.namedTwo, this.list, this.superGet, String superText)
: super(superText);
}
class FooNestedSource {
late String text;
final num number;
FooNestedSource(this.number);
}
class BarTarget {
final num numberDiff;
final String text;
final bool truthy;
String named;
String namedTwoDiff;
String? property;
String? propertyTwoDiff;
num? _setterNumber;
String? _setterTextDiff;
late BarNestedTarget nested;
final List<BarNestedTarget> list;
final String superText;
String? superPropertySet;
String? secondText;
final String secondTextOther;
String? get setterTextDiff => _setterTextDiff;
set setterTextDiff(String? setterTextDiff) {
_setterTextDiff = setterTextDiff;
}
num? get setterNumber => _setterNumber;
set setterNumber(num? setterNumber) {
_setterNumber = setterNumber;
}
BarTarget(this.numberDiff, this.text, this.truthy, this.superText,
{required this.named, required this.namedTwoDiff, required this.list, required this.secondTextOther});
}
class BarNestedTarget {
final String text;
final num number;
BarNestedTarget(this.text, this.number);
}
/// Mapper showcasing every feature,
/// such as explicit fieldmapping, injection and mapping nested classes
@Mapper(useInjection: true)
abstract class ExampleMapper {
static ExampleMapper get instance => ExampleMapperImpl();
@Mapping(source: 'number', target: 'numberDiff')
@Mapping(source: 'namedTwo', target: 'namedTwoDiff')
@Mapping(source: 'setterText', target: 'setterTextDiff')
@Mapping(source: 'propertyTwo', target: 'propertyTwoDiff')
BarTarget fromFoo(FooSource source, FooSourceTheSecond second);
BarNestedTarget fromFooSub(FooNestedSource source);
}