@@ -77,14 +77,14 @@ The required steps are detailed below:
77
77
To limit the number of files scanned for annotationed classes during
78
78
the build process one can use a ` generate_for` statement in the builder configuration.
79
79
80
- 4. Build the project by running the command:
80
+ 4. Build the project by navigating to the project root directory and running the command:
81
81
` ` ` Console
82
- $ pub run build_runner build --delete-conflicting-outputs
82
+ $ dart run build_runner build --delete-conflicting-outputs
83
83
` ` `
84
84
5. For the example presented here, the build process will generate the file ` dpi_resolution.g.dart` .
85
85
< details> < summary> Click to show file content. < /summary>
86
86
87
- ` ` ` Dart
87
+ ` ` ` Dart
88
88
// GENERATED CODE - DO NOT MODIFY BY HAND
89
89
90
90
part of ' dpi_resolution.dart' ;
@@ -95,24 +95,24 @@ The required steps are detailed below:
95
95
96
96
/// Extension on ` DpiResolution` providing value-getters.
97
97
extension DpiResolutionValue on DpiResolution {
98
- /// Returns value of type < double> mapped to
99
- /// an instance of ` DpiResolution` .
98
+ /// Returns a map of type ` Map < double, DpiResolution > ` mapping
99
+ /// each declared enum value to an instance of ` DpiResolution` .
100
100
double get value => const < DpiResolution, double> {
101
- DpiResolution.low : 90.0,
101
+ DpiResolution.low: 90.0,
102
102
DpiResolution.medium: 300.0,
103
103
DpiResolution.high: 600.0,
104
104
}[this]! ;
105
105
106
106
/// Returns the String identifier of an instance of ` DpiResolution` .
107
107
String get stringValue => const < DpiResolution, String> {
108
- DpiResolution.low : ' low ' ,
108
+ DpiResolution.low: ' low' ,
109
109
DpiResolution.medium: ' medium' ,
110
110
DpiResolution.high: ' high' ,
111
111
}[this]! ;
112
112
113
113
/// Returns a mapping of instance name to enum instance.
114
114
Map< String, DpiResolution> get valueMap => const < String, DpiResolution> {
115
- ' low ' : DpiResolution.low ,
115
+ ' low' : DpiResolution.low,
116
116
' medium' : DpiResolution.medium,
117
117
' high' : DpiResolution.high,
118
118
};
@@ -151,7 +151,7 @@ The required steps are detailed below:
151
151
/// Converts ` this` to a json encoded ` String` .
152
152
String get jsonEncoded => ' {"index":${DpiResolution.values.indexOf(this)}}' ;
153
153
}
154
- ` ` `
154
+ ` ` `
155
155
< /details>
156
156
157
157
# # Enum - Value Mapping
0 commit comments