@arrirpc/codegen-dart 0.80.3 → 0.81.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -693,7 +693,7 @@ function dartBoolFromSchema(schema, context) {
693
693
  function dartDateTimeFromSchema(schema, context) {
694
694
  const isNullable = outputIsNullable(schema, context);
695
695
  const typeName = isNullable ? "DateTime?" : "DateTime";
696
- const defaultValue = isNullable ? "null" : "DateTime.now()";
696
+ const defaultValue = isNullable ? "null" : "DateTime(0)";
697
697
  return {
698
698
  typeName,
699
699
  isNullable,
@@ -702,7 +702,7 @@ function dartDateTimeFromSchema(schema, context) {
702
702
  if (isNullable) {
703
703
  return `nullableDateTimeFromDynamic(${input})`;
704
704
  }
705
- return `dateTimeFromDynamic(${input}, DateTime.now())`;
705
+ return `dateTimeFromDynamic(${input}, DateTime(0))`;
706
706
  },
707
707
  toJson(input, _target, _key) {
708
708
  if (context.isOptional) {
package/dist/index.mjs CHANGED
@@ -686,7 +686,7 @@ function dartBoolFromSchema(schema, context) {
686
686
  function dartDateTimeFromSchema(schema, context) {
687
687
  const isNullable = outputIsNullable(schema, context);
688
688
  const typeName = isNullable ? "DateTime?" : "DateTime";
689
- const defaultValue = isNullable ? "null" : "DateTime.now()";
689
+ const defaultValue = isNullable ? "null" : "DateTime(0)";
690
690
  return {
691
691
  typeName,
692
692
  isNullable,
@@ -695,7 +695,7 @@ function dartDateTimeFromSchema(schema, context) {
695
695
  if (isNullable) {
696
696
  return `nullableDateTimeFromDynamic(${input})`;
697
697
  }
698
- return `dateTimeFromDynamic(${input}, DateTime.now())`;
698
+ return `dateTimeFromDynamic(${input}, DateTime(0))`;
699
699
  },
700
700
  toJson(input, _target, _key) {
701
701
  if (context.isOptional) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrirpc/codegen-dart",
3
- "version": "0.80.3",
3
+ "version": "0.81.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -23,6 +23,6 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "pathe": "^2.0.3",
26
- "@arrirpc/codegen-utils": "0.80.3"
26
+ "@arrirpc/codegen-utils": "0.81.1"
27
27
  }
28
28
  }