Skip to content

Commit 6e99bb0

Browse files
committed
+Refactor for simplicity
1 parent 91cccb8 commit 6e99bb0

13 files changed

+45
-41
lines changed

.github/scripts/update_changelog.dart

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ void main(List<String> args) {
2828
final sections = extractSections(contents);
2929
final versionExist = sections.where((e) => e.version == version).isNotEmpty;
3030
if (versionExist) {
31-
sections.where((e) => e.version == version).forEach((e) {
32-
e.addUpdate(comitMesssage);
33-
});
31+
for (final versionSection in sections.where((e) => e.version == version)) {
32+
if (comitMesssage.isNotEmpty) {
33+
versionSection.addUpdate(comitMesssage);
34+
}
35+
}
3436
} else {
3537
sections.add(
3638
_VersionSection(
@@ -76,11 +78,13 @@ Set<_VersionSection> extractSections(String contents) {
7678
updates.add(line);
7779
}
7880
}
79-
results.add(_VersionSection(
80-
version: version,
81-
releasedAt: releasedAt,
82-
updates: updates,
83-
));
81+
results.add(
82+
_VersionSection(
83+
version: version,
84+
releasedAt: releasedAt,
85+
updates: updates,
86+
),
87+
);
8488
}
8589

8690
return results;
@@ -105,7 +109,7 @@ class _VersionSection {
105109
required this.version,
106110
required this.releasedAt,
107111
Set<String>? updates,
108-
}) : this.updates = updates ?? {};
112+
}) : updates = updates ?? {};
109113

110114
//
111115
//

.github/workflows/deploy-examplet.yml_REMOVE_TO_ENABLE renamed to .github/workflows/deploy-example.yml_REMOVE_TO_ENABLE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
# Build the web app in /hosted_example/
5050
- name: Build web app in /hosted_example/
51-
run: flutter build web --release --base-href "/${{ github.event.repository.name }}/"
51+
run: flutter build web --release --wasm --base-href "/${{ github.event.repository.name }}/"
5252
working-directory: ./hosted_example
5353

5454
# Necessary

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Dart & Flutter Packages by dev-cetera.com & contributors.
1313

1414
Annotations for the the [df_safer_dart_lints](https://pub.dev/packages/df_safer_dart_lints) package.
1515

16-
1716
<!-- END _README_CONTENT -->
1817

1918
---
@@ -48,3 +47,4 @@ If you're enjoying this package and find it valuable, consider showing your appr
4847
## 🧑‍⚖️ License
4948

5049
This project is released under the [MIT License](https://raw.githubusercontent.com/dev-cetera/df_safer_dart_annotations/main/LICENSE). See [LICENSE](https://raw.githubusercontent.com/dev-cetera/df_safer_dart_annotations/main/LICENSE) for more information.
50+

_README_CONTENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Annotations for the the [df_safer_dart_lints](https://pub.dev/packages/df_safer_dart_lints) package.
1+
Annotations for the the [df_safer_dart_lints](https://pub.dev/packages/df_safer_dart_lints) package.

lib/src/_src.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//.title~
99

1010
export './annotations/must_be_anonymous_annotation.dart';
11-
export './annotations/no_futures_allowed_annotation.dart';
11+
export 'annotations/no_futures_annotation.dart';
1212
export './annotations/experimental_annotations.dart';
1313
export './annotations/must_be_strong_ref_annotation.dart';
1414
export './annotations/must_await_all_futures_annotation.dart';

lib/src/annotations/experimental_annotations.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212

1313
const experimental1 = ExperimentalAnnotation1();
1414

15-
/// The class that enables the `@experimental1` annotation.
15+
/// The class that enables the @[experimental1] annotation.
1616
final class ExperimentalAnnotation1 {
1717
const ExperimentalAnnotation1();
1818
}
1919

2020
const experimental2 = ExperimentalAnnotation2();
2121

22-
/// The class that enables the `@experimental2` annotation.
22+
/// The class that enables the @[experimental2] annotation.
2323
final class ExperimentalAnnotation2 {
2424
const ExperimentalAnnotation2();
2525
}
2626

2727
const experimental3 = ExperimentalAnnotation3();
2828

29-
/// The class that enables the `@experimental3` annotation.
29+
/// The class that enables the @[experimental3] annotation.
3030
final class ExperimentalAnnotation3 {
3131
const ExperimentalAnnotation3();
3232
}

lib/src/annotations/must_await_all_futures_annotation.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
const mustAwaitAllFuturesOrError = MustAwaitAllFuturesOrErrorAnnotation();
1414

15-
/// The class that enables the `@mustAwaitAllFuturesOrError` annotation.
15+
/// The class that enables the @[mustAwaitAllFuturesOrError] annotation.
1616
final class MustAwaitAllFuturesOrErrorAnnotation {
1717
const MustAwaitAllFuturesOrErrorAnnotation();
1818
}
1919

2020
const mustAwaitAllFutures = MustAwaitAllFuturesAnnotation();
2121

22-
/// The class that enables the `@mustAwaitAllFutures` annotation.
22+
/// The class that enables the @[mustAwaitAllFutures] annotation.
2323
final class MustAwaitAllFuturesAnnotation {
2424
const MustAwaitAllFuturesAnnotation();
2525
}

lib/src/annotations/must_be_anonymous_annotation.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
1111
//.title~
1212

13-
const mustBeAnonymous = MustBeAnonymousAnnotation();
14-
15-
/// The class that enables the `@mustBeAnonymous` annotation.
16-
final class MustBeAnonymousAnnotation {
17-
const MustBeAnonymousAnnotation();
18-
}
19-
2013
const mustBeAnonymousOrError = MustBeAnonymousOrErrorAnnotation();
2114

22-
/// The class that enables the `@mustBeAnonymousOrError` annotation.
15+
/// The class that enables the @[mustBeAnonymousOrError] annotation.
2316
final class MustBeAnonymousOrErrorAnnotation {
2417
const MustBeAnonymousOrErrorAnnotation();
2518
}
19+
20+
const mustBeAnonymous = MustBeAnonymousAnnotation();
21+
22+
/// The class that enables the @[mustBeAnonymous] annotation.
23+
final class MustBeAnonymousAnnotation {
24+
const MustBeAnonymousAnnotation();
25+
}

lib/src/annotations/must_be_strong_ref_annotation.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
const mustBeStrongRefOrError = MustBeStrongRefOrErrorAnnotation();
1414

15-
/// The class that enables the `@MustBeStrongRefOrError` annotation.
15+
/// The class that enables the @[mustBeStrongRefOrError] annotation.
1616
final class MustBeStrongRefOrErrorAnnotation {
1717
const MustBeStrongRefOrErrorAnnotation();
1818
}
1919

2020
const mustBeStrongRef = MustBeStrongRefAnnotation();
2121

22-
/// The class that enables the `@MustBeStrongRef` annotation.
22+
/// The class that enables the @[mustBeStrongRef] annotation.
2323
final class MustBeStrongRefAnnotation {
2424
const MustBeStrongRefAnnotation();
2525
}

lib/src/annotations/must_handle_return_annotation.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
const mustHandleReturnOrError = MustHandleReturnAnnotation();
1414

15-
/// The class that enables the `@mustHandleReturnOrError` annotation.
15+
/// The class that enables the @[mustHandleReturnOrError] annotation.
1616
final class MustHandleReturnOrErrorAnnotation {
1717
const MustHandleReturnOrErrorAnnotation();
1818
}
1919

2020
const mustHandleReturn = MustHandleReturnAnnotation();
2121

22-
/// The class that enables the `@mustHandleReturn` annotation.
22+
/// The class that enables the @[mustHandleReturn] annotation.
2323
final class MustHandleReturnAnnotation {
2424
const MustHandleReturnAnnotation();
2525
}

0 commit comments

Comments
 (0)