Skip to content

Commit 669b659

Browse files
committed
refactor: Rename data to rootData in Model
1 parent 1583e89 commit 669b659

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [0.6.6]
4+
5+
- Released @ 10/2024 (UTC)
6+
- refactor: Rename data to rootData in Model
7+
38
## [0.6.5]
49

510
- Released @ 10/2024 (UTC)

lib/src/models/model.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ class Model extends BaseModel {
1919
//
2020
//
2121

22-
final Map<String, dynamic> _data;
23-
Map<String, dynamic> get data => _data;
22+
final Map<String, dynamic> _rootData;
23+
Map<String, dynamic> get rootData => Map.unmodifiable(_rootData);
2424

2525
//
2626
//
2727
//
2828

29-
const Model([this._data = const {}]);
29+
const Model([this._rootData = const {}]);
3030

3131
const Model.fromJson([
3232
Map<String, dynamic>? otherData,
33-
]) : _data = otherData ?? const {};
33+
]) : _rootData = otherData ?? const {};
3434

3535
factory Model.from(BaseModel? other) {
3636
return Model(other?.toJson() ?? {});
@@ -88,7 +88,7 @@ class Model extends BaseModel {
8888
Map<String, dynamic> toJson({
8989
bool includeNulls = false,
9090
}) {
91-
return includeNulls ? _data : _data.nonNulls;
91+
return includeNulls ? _rootData : _rootData.nonNulls;
9292
}
9393

9494
//

pubspec.yaml

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

1313
name: df_generate_dart_models_core
1414
description: A package that provides core dependencies for models generated with df_generate_dart_models.
15-
version: 0.6.5
15+
version: 0.6.6
1616
repository: https://github.com/robmllze/df_generate_dart_models_core
1717
funding:
1818
- https://www.buymeacoffee.com/robmllze
@@ -31,9 +31,9 @@ environment:
3131
## -----------------------------------------------------------------------------
3232

3333
dependencies:
34-
df_collection: ^0.6.0
34+
df_collection: ^0.6.1
3535
df_string: ^0.2.2
36-
df_type: ^0.6.1
36+
df_type: ^0.6.2
3737

3838
## -----------------------------------------------------------------------------
3939

0 commit comments

Comments
 (0)