Skip to content

Commit cb68ce6

Browse files
Merge pull request #537 from appwrite/feat-fix-flutter-realtime-model
fix realtime timestamp data type
2 parents f8b423e + d679b50 commit cb68ce6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

templates/dart/lib/src/models/model.dart.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model
3535
Map<String, dynamic> toMap() {
3636
return {
3737
{% for property in definition.properties %}
38-
"{{ property.name | escapeDollarSign }}": {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword}}.map((p) => p.toMap()){% else %}{{property.name | escapeKeyword}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword }}{% endif %},
38+
"{{ property.name | escapeDollarSign }}": {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword}}.map((p) => p.toMap()).toList(){% else %}{{property.name | escapeKeyword}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword }}{% endif %},
3939
{% endfor %}
4040
{% if definition.additionalProperties %}
4141
"data": data,

templates/flutter/lib/src/realtime_message.dart.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class RealtimeMessage {
55
final List<String> events;
66
final Map<String, dynamic> payload;
77
final List<String> channels;
8-
final int timestamp;
8+
final String timestamp;
99
RealtimeMessage({
1010
required this.events,
1111
required this.payload,
@@ -17,7 +17,7 @@ class RealtimeMessage {
1717
List<String>? events,
1818
Map<String, dynamic>? payload,
1919
List<String>? channels,
20-
int? timestamp,
20+
String? timestamp,
2121
}) {
2222
return RealtimeMessage(
2323
events: events ?? this.events,

0 commit comments

Comments
 (0)