11//.title
22// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
33//
4- // Dart/Flutter (DF) Packages by dev-cetera.com & contributors. The use of this
5- // source code is governed by an MIT-style license described in the LICENSE
6- // file located in this project's root directory.
4+ // Copyright © dev-cetera.com & contributors.
5+ //
6+ // The use of this source code is governed by an MIT-style license described in
7+ // the LICENSE file located in this project's root directory.
78//
89// See: https://opensource.org/license/mit
910//
@@ -42,9 +43,10 @@ void main(List<String> args) {
4243 ),
4344 );
4445 }
45- contents = '# Changelog\n\n ${(sections .toList ()..sort ((a , b ) {
46- return compareVersions (b .version , a .version );
47- })).map ((e ) => e .toString ()).join ('\n ' )}' ;
46+ contents =
47+ '# Changelog\n\n ${(sections .toList ()..sort ((a , b ) {
48+ return compareVersions (b .version , a .version );
49+ })).map ((e ) => e .toString ()).join ('\n ' )}' ;
4850
4951 file.writeAsStringSync (contents);
5052 print ('Changelog updated with version $version .' );
@@ -61,8 +63,9 @@ Set<_VersionSection> extractSections(String contents) {
6163 final end = i + 1 < allVersionMatches.length ? allVersionMatches[i + 1 ].start : contents.length;
6264 final sectionContents = contents.substring (start, end).trim ();
6365 final lines = sectionContents.split ('\n ' ).where ((line) => line.isNotEmpty).toList ();
64- final version =
65- allVersionMatches[i].group (0 )! .substring (4 , allVersionMatches[i].group (0 )! .length - 1 );
66+ final version = allVersionMatches[i]
67+ .group (0 )!
68+ .substring (4 , allVersionMatches[i].group (0 )! .length - 1 );
6669 var releasedAt = DateTime .now ().toUtc ();
6770 final updates = < String > {};
6871 final old = lines
@@ -78,13 +81,7 @@ Set<_VersionSection> extractSections(String contents) {
7881 updates.add (line);
7982 }
8083 }
81- results.add (
82- _VersionSection (
83- version: version,
84- releasedAt: releasedAt,
85- updates: updates,
86- ),
87- );
84+ results.add (_VersionSection (version: version, releasedAt: releasedAt, updates: updates));
8885 }
8986
9087 return results;
@@ -105,11 +102,8 @@ class _VersionSection {
105102 //
106103 //
107104
108- _VersionSection ({
109- required this .version,
110- required this .releasedAt,
111- Set <String >? updates,
112- }) : updates = updates ?? {};
105+ _VersionSection ({required this .version, required this .releasedAt, Set <String >? updates})
106+ : updates = updates ?? {};
113107
114108 //
115109 //
0 commit comments