Skip to content

Fixed DateTime bug #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion example/lib/wrapper.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:simple_json_example/test.dart';
import 'package:simple_json_mapper/simple_json_mapper.dart';

// @JObj()
class Wrapper<T> {
Expand Down
75 changes: 42 additions & 33 deletions simple_json/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "18.0.0"
version: "22.0.0"
analyzer:
dependency: "direct main"
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.7.1"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.1"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.7.0"
boolean_selector:
dependency: transitive
description:
Expand All @@ -42,63 +42,63 @@ packages:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.2"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.7"
version: "1.0.0"
build_daemon:
dependency: transitive
description:
name: build_daemon
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.10"
version: "3.0.0"
build_resolvers:
dependency: "direct main"
description:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.3"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.12.2"
version: "2.0.4"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.12"
version: "7.0.0"
built_collection:
dependency: transitive
description:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
version: "5.1.0"
built_value:
dependency: transitive
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "8.0.3"
version: "8.0.6"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
checked_yaml:
dependency: transitive
description:
Expand All @@ -119,7 +119,7 @@ packages:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "3.7.0"
version: "4.0.0"
collection:
dependency: "direct main"
description:
Expand All @@ -140,56 +140,63 @@ packages:
name: coverage
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
version: "1.0.3"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.0.1"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.0"
version: "6.1.2"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
glob:
dependency: "direct main"
description:
name: glob
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
graphs:
dependency: transitive
description:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "2.0.0"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.0.1"
http_parser:
dependency: transitive
description:
Expand Down Expand Up @@ -224,7 +231,7 @@ packages:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.0.1"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -252,7 +259,7 @@ packages:
name: node_preamble
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
package_config:
dependency: transitive
description:
Expand Down Expand Up @@ -301,7 +308,7 @@ packages:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.4"
shelf_packages_handler:
dependency: transitive
description:
Expand All @@ -326,17 +333,19 @@ packages:
simple_json_mapper:
dependency: "direct main"
description:
name: simple_json_mapper
url: "https://pub.dartlang.org"
source: hosted
path: simple_json_mapper
ref: HEAD
resolved-ref: "49290a87e64c385ef71a972755614e3d9388f9c3"
url: "git://github.com/cocoatech/simple_json"
source: git
version: "2.1.0"
source_gen:
dependency: "direct main"
description:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.0.2"
source_map_stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -399,21 +408,21 @@ packages:
name: test
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.8"
version: "1.17.8"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.4.1"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.19"
version: "0.3.28"
timing:
dependency: transitive
description:
Expand All @@ -434,7 +443,7 @@ packages:
name: vm_service
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.0+1"
version: "7.1.0"
watcher:
dependency: transitive
description:
Expand All @@ -448,7 +457,7 @@ packages:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
webkit_inspection_protocol:
dependency: transitive
description:
Expand Down
21 changes: 13 additions & 8 deletions simple_json/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ homepage: https://github.com/FlutterDevTools/simple_json/tree/master/simple_json
environment:
sdk: '>=2.12.0 <3.0.0'

publish_to: none

dependencies:
simple_json_mapper: ^2.1.0
build_resolvers: ^2.0.0
analyzer: ^1.2.0
build: ^2.0.0
source_gen: ^1.0.0
simple_json_mapper:
git:
url: git://github.com/cocoatech/simple_json
path: simple_json_mapper
build_resolvers: ^2.0.3
analyzer: ^1.7.1
build: ^2.0.2
source_gen: ^1.0.2
path: ^1.8.0
glob: ^2.0.0
glob: ^2.0.1
collection: ^1.15.0

dev_dependencies:
test: ^1.16.8
build_runner: ^1.12.2
test: ^1.17.8
build_runner: ^2.0.4
4 changes: 2 additions & 2 deletions simple_json_mapper/lib/src/annotations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class JProp extends JsonProperty {
const JProp({
bool? ignore,
String? name,
dynamic? defaultValue,
dynamic defaultValue,
}) : super(
ignore: ignore,
name: name,
Expand All @@ -26,7 +26,7 @@ class JsonProperty {
});
final bool? ignore;
final String? name;
final dynamic? defaultValue;
final dynamic defaultValue;
}

enum SerializationType {
Expand Down
4 changes: 3 additions & 1 deletion simple_json_mapper/lib/src/json_mapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class CustomJsonMapper {
final _toTypeConverterMap = <String, JsonConverter>{
(DateTime).toString(): const DefaultISO8601DateConverter(),
(Duration).toString(): const DefaultDurationConverter(),
'DateTime?': const DefaultISO8601DateConverter(),
'Duration?': const DefaultDurationConverter(),
};

bool isMapperRegistered<T>() {
Expand Down Expand Up @@ -207,7 +209,7 @@ class CustomJsonMapper {
: value;
}

dynamic? applyDynamicFromInstanceConverter<TTo>(TTo value,
dynamic applyDynamicFromInstanceConverter<TTo>(TTo value,
[JsonConverter<dynamic, TTo>? converter]) {
return applyFromInstanceConverter(value, converter);
}
Expand Down
Loading