Skip to content

Commit 159f50f

Browse files
committed
update
1 parent 47f56d5 commit 159f50f

23 files changed

+165
-189
lines changed

.github/scripts/update_changelog.dart

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
//

.github/scripts/update_readme.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
//

.github/workflows/deploy-example.yml_REMOVE_TO_ENABLE

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
##

.github/workflows/process-package.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
##

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
##

analysis_options.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
##
@@ -57,3 +58,6 @@ analyzer:
5758
unnecessary_new: error
5859
unrelated_type_equality_checks: error
5960
use_key_in_widget_constructors: error
61+
62+
formatter:
63+
trailing_commas: preserve

lib/df_generate_dart_models_core.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
//

lib/df_generate_dart_models_core_utils.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
//

lib/src/_utils/dart_field.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
//
@@ -108,8 +109,7 @@ final class DartField extends Field {
108109
].any((e) => e == true);
109110
}
110111

111-
bool? get _isFieldNameNullable =>
112-
super.fieldPath?.any((e) => e.contains('?'));
112+
bool? get _isFieldNameNullable => super.fieldPath?.any((e) => e.contains('?'));
113113

114114
bool? get _isFieldTypeNullable => super.fieldType?.endsWith('?') == true;
115115

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
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
//
@@ -32,9 +33,7 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
3233
/// Returns `fieldName` property from [dartObj] if it matches the structure of
3334
/// [TFieldRecord] or `null`.
3435
List<String>? fieldPathFromRecord() {
35-
return _rawFieldPathFromRecord()
36-
?.map((e) => e.replaceAll('?', ''))
37-
.toList();
36+
return _rawFieldPathFromRecord()?.map((e) => e.replaceAll('?', '')).toList();
3837
}
3938

4039
List<String>? _rawFieldPathFromRecord() {
@@ -50,30 +49,20 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
5049
String? fieldTypeFromRecord() {
5150
final raw = _rawFieldTypeFromRecord();
5251
if (raw != null) {
53-
return raw.endsWith('?') || raw.endsWith('*')
54-
? raw.substring(0, raw.length - 1)
55-
: raw;
52+
return raw.endsWith('?') || raw.endsWith('*') ? raw.substring(0, raw.length - 1) : raw;
5653
}
5754
return null;
5855
}
5956

6057
String? _rawFieldTypeFromRecord() {
6158
final a = dartObj.getField('\$2')?.toStringValue() as String?;
6259
final b =
63-
dartObj
64-
.getField('\$2')
65-
?.toTypeValue()
66-
?.getDisplayString(withNullability: true)
67-
as String?;
68-
final c =
69-
dartObj.getField(FieldModelFieldNames.fieldType)?.toStringValue()
70-
as String?;
71-
final d =
72-
dartObj
73-
.getField(FieldModelFieldNames.fieldType)
74-
?.toTypeValue()
75-
?.getDisplayString(withNullability: true)
76-
as String?;
60+
dartObj.getField('\$2')?.toTypeValue()?.getDisplayString(withNullability: true) as String?;
61+
final c = dartObj.getField(FieldModelFieldNames.fieldType)?.toStringValue() as String?;
62+
final d = dartObj
63+
.getField(FieldModelFieldNames.fieldType)
64+
?.toTypeValue()
65+
?.getDisplayString(withNullability: true) as String?;
7766
return a ?? b ?? c ?? d;
7867
}
7968

@@ -84,8 +73,7 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
8473
return false;
8574
}
8675

87-
final a =
88-
dartObj.getField(FieldModelFieldNames.nullable)?.toBoolValue() as bool?;
76+
final a = dartObj.getField(FieldModelFieldNames.nullable)?.toBoolValue() as bool?;
8977
final b = dartObj.getField('\$3')?.toBoolValue() as bool?;
9078
final c = _rawFieldPathFromRecord()?.any((e) => e.contains('?'));
9179
final d = _rawFieldTypeFromRecord()?.endsWith('?');
@@ -95,32 +83,25 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
9583
/// Returns the `children` property from [dartObj] if it matches the structure of
9684
/// [TFieldRecord] or `null`.
9785
List<Map<String, dynamic>>? childrenFromRecord() {
98-
final a =
99-
dartObj
100-
.getField(FieldModelFieldNames.children)
101-
?.toListValue()
102-
?.map(
103-
(e) => e.toMapValue()!.map(
104-
(k, v) => MapEntry(k!.toStringValue()!, dartObjToObject(v)),
105-
),
106-
)
107-
as Iterable?;
86+
final a = dartObj.getField(FieldModelFieldNames.children)?.toListValue()?.map(
87+
(e) => e.toMapValue()!.map(
88+
(k, v) => MapEntry(k!.toStringValue()!, dartObjToObject(v)),
89+
),
90+
) as Iterable?;
10891
final b = a?.map((e) => (e as Map).cast<String, dynamic>()).toList();
10992
return b;
11093
}
11194

11295
/// Returns the `primaryKey` property from [dartObj] if it matches the structure
11396
/// of [TFieldRecord] or `null`.
11497
bool? primaryKeyFromRecord() {
115-
return dartObj.getField(FieldModelFieldNames.primaryKey)?.toBoolValue()
116-
as bool?;
98+
return dartObj.getField(FieldModelFieldNames.primaryKey)?.toBoolValue() as bool?;
11799
}
118100

119101
/// Returns the `foreignKey` property from [dartObj] if it matches the
120102
/// structure of [TFieldRecord] or `null`.
121103
bool? foreignKeyFromRecord() {
122-
return dartObj.getField(FieldModelFieldNames.foreignKey)?.toBoolValue()
123-
as bool?;
104+
return dartObj.getField(FieldModelFieldNames.foreignKey)?.toBoolValue() as bool?;
124105
}
125106

126107
/// Retrieves the `fallback` property from this `DartObject` if it matches
@@ -133,7 +114,6 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
133114
/// Returns the `description` property from [dartObj] record if it matches the
134115
/// structure of [TFieldRecord] or `null`.
135116
String? descriptionFromRecord() {
136-
return dartObj.getField(FieldModelFieldNames.description)?.toStringValue()
137-
as String?;
117+
return dartObj.getField(FieldModelFieldNames.description)?.toStringValue() as String?;
138118
}
139119
}

0 commit comments

Comments
 (0)