Skip to content

Commit b0d2cd7

Browse files
committed
v4.0.0 Release
- Update codelessly_json_serializable to v4.9.0. - Require Dart SDK v3.5 or higher.
1 parent 0c0f338 commit b0d2cd7

File tree

5 files changed

+25
-32
lines changed

5 files changed

+25
-32
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 4.0.0
2+
3+
- Update codelessly_json_serializable to v4.9.0.
4+
- Require Dart SDK v3.5 or higher.
5+
16
## 3.0.0
27

38
- Owner field & admin Role migration.

lib/src/api/models/condition.dart

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:codelessly_json_annotation/codelessly_json_annotation.dart';
22
import 'package:equatable/equatable.dart';
33

4-
import '../converters.dart';
54
import '../mixins.dart';
65
import 'models.dart';
76

lib/src/api/nodes/canvas_node.dart

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:codelessly_json_annotation/codelessly_json_annotation.dart';
22
import 'package:equatable/equatable.dart';
33

4-
import '../converters.dart';
54
import '../mixins.dart';
65
import '../models/models.dart';
76
import 'nodes.dart';

lib/src/api/typed_value.dart

+18-28
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import 'dart:convert';
22

3-
import 'package:collection/collection.dart';
4-
53
import '../../codelessly_api.dart';
64

75
/// Declares extensions on [Object].
@@ -297,64 +295,56 @@ extension ConversionExt on Object? {
297295
if (set == null) return null;
298296

299297
if (R == Set<int>) {
300-
return set
301-
.map<int?>((e) => e?.toInt())
302-
.whereNotNull()
303-
.toSet()
304-
.tryCast<R>();
298+
return set.map<int?>((e) => e?.toInt()).nonNulls.toSet().tryCast<R>();
305299
}
306300
if (R == Set<int?>) {
307-
return set.map<int?>((e) => e?.toInt()).toSet().tryCast<R>();
301+
return set.map<int?>((e) => e?.toInt()).nonNulls.toSet().tryCast<R>();
308302
}
309303
if (R == Set<double>) {
310304
return set
311305
.map<double?>((e) => e?.toDouble())
312-
.whereNotNull()
306+
.nonNulls
313307
.toSet()
314308
.tryCast<R>();
315309
}
316310
if (R == Set<double?>) {
317-
return set.map<double?>((e) => e?.toDouble()).toSet().tryCast<R>();
318-
}
319-
if (R == Set<num>) {
320311
return set
321-
.map<num?>((e) => e?.toNum())
322-
.whereNotNull()
312+
.map<double?>((e) => e?.toDouble())
313+
.nonNulls
323314
.toSet()
324315
.tryCast<R>();
325316
}
317+
if (R == Set<num>) {
318+
return set.map<num?>((e) => e?.toNum()).nonNulls.toSet().tryCast<R>();
319+
}
326320
if (R == Set<num?>) {
327-
return set.map<num?>((e) => e?.toNum()).toSet().tryCast<R>();
321+
return set.map<num?>((e) => e?.toNum()).nonNulls.toSet().tryCast<R>();
328322
}
329323
if (R == Set<bool>) {
330-
return set
331-
.map<bool?>((e) => e?.toBool())
332-
.whereNotNull()
333-
.toSet()
334-
.tryCast<R>();
324+
return set.map<bool?>((e) => e?.toBool()).nonNulls.toSet().tryCast<R>();
335325
}
336326
if (R == Set<bool?>) {
337-
return set.map<bool?>((e) => e?.toBool()).toSet().tryCast<R>();
327+
return set.map<bool?>((e) => e?.toBool()).nonNulls.toSet().tryCast<R>();
338328
}
339329
if (R == Set<String>) {
340330
return set
341331
.map<String?>((e) => e?.toString())
342-
.whereNotNull()
332+
.nonNulls
343333
.toSet()
344334
.tryCast<R>();
345335
}
346336
if (R == Set<String?>) {
347-
return set.map<String?>((e) => e?.toString()).toSet().tryCast<R>();
348-
}
349-
if (R == Set<Map>) {
350337
return set
351-
.map<Map?>((e) => e?.toMap())
352-
.whereNotNull()
338+
.map<String?>((e) => e?.toString())
339+
.nonNulls
353340
.toSet()
354341
.tryCast<R>();
355342
}
343+
if (R == Set<Map>) {
344+
return set.map<Map?>((e) => e?.toMap()).nonNulls.toSet().tryCast<R>();
345+
}
356346
if (R == Set<Map?>) {
357-
return set.map<Map?>((e) => e?.toMap()).toSet().tryCast<R>();
347+
return set.map<Map?>((e) => e?.toMap()).nonNulls.toSet().tryCast<R>();
358348
}
359349

360350
return set.tryCast<R>();

pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: codelessly_api
22
description: Flutter's layouts and widgets represented as models and JSON data. This API is used by the Codelessly Editor and CloudUI SDK to render Flutter Widgets.
3-
version: 3.0.0
3+
version: 4.0.0
44
homepage: https://codelessly.com/
55
repository: https://github.com/Codelessly/CodelesslyAPI
66

77
environment:
8-
sdk: ">=3.0.0 <4.0.0"
8+
sdk: ">=3.5.0 <4.0.0"
99

1010
dependencies:
1111
codelessly_json_annotation: 4.9.0+2

0 commit comments

Comments
 (0)