Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 74667ee

Browse files
authored
rename MethodModifier constant names (#68)
1 parent 56a913a commit 74667ee

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.0.0-beta+2
2+
3+
- BREAKING CHANGE: `MethodModifier.async`, `MethodModifier.asyncStar` and
4+
`MethodModifier.syncStar` are now `MethodModifier.asAsync`,
5+
`MethodModifier.asAsyncStar` and `MethodModifier.asSyncStar`
6+
17
## 1.0.0-beta+1
28

39
- Add support for `switch` statements

lib/src/builders/method.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ ConstructorBuilder constructorNamed(
3434

3535
/// Various types of modifiers for methods.
3636
class MethodModifier implements ValidMethodMember {
37-
static const MethodModifier async = const MethodModifier._('async', false);
38-
static const MethodModifier asyncStar = const MethodModifier._('async', true);
39-
static const MethodModifier syncStar = const MethodModifier._('sync', true);
37+
static const MethodModifier asAsync = const MethodModifier._('async', false);
38+
static const MethodModifier asAsyncStar =
39+
const MethodModifier._('async', true);
40+
static const MethodModifier asSyncStar = const MethodModifier._('sync', true);
4041

4142
final String _keyword;
4243

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: code_builder
2-
version: 1.0.0-beta+1
2+
version: 1.0.0-beta+2
33
description: A fluent API for generating Dart code
44
author: Dart Team <[email protected]>
55
homepage: https://github.com/dart-lang/code_builder

test/builders/method_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void main() {
172172

173173
test('should emit an async method', () {
174174
expect(
175-
method('fetch', [MethodModifier.async]),
175+
method('fetch', [MethodModifier.asAsync]),
176176
equalsSource(r'''
177177
fetch() async {}
178178
'''),
@@ -181,7 +181,7 @@ void main() {
181181

182182
test('should emit an async* method', () {
183183
expect(
184-
method('fetch', [MethodModifier.asyncStar]),
184+
method('fetch', [MethodModifier.asAsyncStar]),
185185
equalsSource(r'''
186186
fetch() async* {}
187187
'''),
@@ -190,7 +190,7 @@ void main() {
190190

191191
test('should emit an sync* method', () {
192192
expect(
193-
method('fetch', [MethodModifier.syncStar]),
193+
method('fetch', [MethodModifier.asSyncStar]),
194194
equalsSource(r'''
195195
fetch() sync* {}
196196
'''),

0 commit comments

Comments
 (0)