Skip to content

Commit 4b6ea95

Browse files
committed
Amended generated file source code.
1 parent 5cd1203 commit 4b6ea95

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ The required steps are detailed below:
7777
To limit the number of files scanned for annotationed classes during
7878
the build process one can use a `generate_for` statement in the builder configuration.
7979

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:
8181
```Console
82-
$ pub run build_runner build --delete-conflicting-outputs
82+
$ dart run build_runner build --delete-conflicting-outputs
8383
```
8484
5. For the example presented here, the build process will generate the file `dpi_resolution.g.dart`.
8585
<details> <summary> Click to show file content. </summary>
8686

87-
```Dart
87+
```Dart
8888
// GENERATED CODE - DO NOT MODIFY BY HAND
8989
9090
part of 'dpi_resolution.dart';
@@ -95,24 +95,24 @@ The required steps are detailed below:
9595
9696
/// Extension on `DpiResolution` providing value-getters.
9797
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`.
100100
double get value => const <DpiResolution, double>{
101-
DpiResolution.low : 90.0,
101+
DpiResolution.low: 90.0,
102102
DpiResolution.medium: 300.0,
103103
DpiResolution.high: 600.0,
104104
}[this]!;
105105
106106
/// Returns the String identifier of an instance of `DpiResolution`.
107107
String get stringValue => const <DpiResolution, String>{
108-
DpiResolution.low : 'low ',
108+
DpiResolution.low: 'low',
109109
DpiResolution.medium: 'medium',
110110
DpiResolution.high: 'high',
111111
}[this]!;
112112
113113
/// Returns a mapping of instance name to enum instance.
114114
Map<String, DpiResolution> get valueMap => const <String, DpiResolution>{
115-
'low ': DpiResolution.low ,
115+
'low': DpiResolution.low,
116116
'medium': DpiResolution.medium,
117117
'high': DpiResolution.high,
118118
};
@@ -151,7 +151,7 @@ The required steps are detailed below:
151151
/// Converts `this` to a json encoded `String`.
152152
String get jsonEncoded => '{"index":${DpiResolution.values.indexOf(this)}}';
153153
}
154-
```
154+
```
155155
</details>
156156
157157
## Enum - Value Mapping

generic_enum/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ The required steps are detailed below:
7777
To limit the number of files scanned for annotationed classes during
7878
the build process one can use a `generate_for` statement in the builder configuration.
7979

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:
8181
```Console
82-
$ pub run build_runner build --delete-conflicting-outputs
82+
$ dart run build_runner build --delete-conflicting-outputs
8383
```
8484
5. For the example presented here, the build process will generate the file `dpi_resolution.g.dart`.
8585
<details> <summary> Click to show file content. </summary>
8686

87-
```Dart
87+
```Dart
8888
// GENERATED CODE - DO NOT MODIFY BY HAND
8989
9090
part of 'dpi_resolution.dart';
@@ -95,24 +95,24 @@ The required steps are detailed below:
9595
9696
/// Extension on `DpiResolution` providing value-getters.
9797
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`.
100100
double get value => const <DpiResolution, double>{
101-
DpiResolution.low : 90.0,
101+
DpiResolution.low: 90.0,
102102
DpiResolution.medium: 300.0,
103103
DpiResolution.high: 600.0,
104104
}[this]!;
105105
106106
/// Returns the String identifier of an instance of `DpiResolution`.
107107
String get stringValue => const <DpiResolution, String>{
108-
DpiResolution.low : 'low ',
108+
DpiResolution.low: 'low',
109109
DpiResolution.medium: 'medium',
110110
DpiResolution.high: 'high',
111111
}[this]!;
112112
113113
/// Returns a mapping of instance name to enum instance.
114114
Map<String, DpiResolution> get valueMap => const <String, DpiResolution>{
115-
'low ': DpiResolution.low ,
115+
'low': DpiResolution.low,
116116
'medium': DpiResolution.medium,
117117
'high': DpiResolution.high,
118118
};
@@ -151,7 +151,7 @@ The required steps are detailed below:
151151
/// Converts `this` to a json encoded `String`.
152152
String get jsonEncoded => '{"index":${DpiResolution.values.indexOf(this)}}';
153153
}
154-
```
154+
```
155155
</details>
156156
157157
## Enum - Value Mapping

0 commit comments

Comments
 (0)