Skip to content

Commit

Permalink
📝 Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyash-simform committed Jun 13, 2024
1 parent 41eb180 commit 31f6e79
Showing 1 changed file with 147 additions and 0 deletions.
147 changes: 147 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,153 @@ ChatView(
),
```

Updated `ChatUser`, `Message` and `ReplyMessage` Data Model's `fromJson` and `toJson` methods:

in `ChatUser.fromJson`:

Before:
```dart
ChatUser.fromJson(
{
...
'imageType': ImageType.asset,
...
},
),
```

After:
```dart
ChatUser.fromJson(
{
...
'imageType': 'asset',
...
},
),
```

in `ChatUser.toJson`:

Before:
```dart
{
...
imageType: ImageType.asset,
...
}
```

After:
```dart
{
...
imageType: asset,
...
}
```

in `Message.fromJson`:

Before:
```dart
Message.fromJson(
{
...
'createdAt': DateTime.now(),
'message_type': MessageType.text,
'voice_message_duration': Duration(seconds: 5),
...
}
)
```

After:
```dart
Message.fromJson(
{
...
'createdAt': '2024-06-13T17:32:19.586412',
'message_type': 'text',
'voice_message_duration': '5000000',
...
}
)
```

in `Message.toJson`:

Before:
```dart
{
...
createdAt: 2024-06-13 17:23:19.454789,
message_type: MessageType.text,
voice_message_duration: 0:00:05.000000,
...
}
```

After:
```dart
{
...
createdAt: 2024-06-13T17:32:19.586412,
message_type: text,
voice_message_duration: 5000000,
...
}
```

in `ReplyMessage.fromJson`:

Before:
```dart
ReplyMessage.fromJson(
{
...
'message_type': MessageType.text,
'voiceMessageDuration': Duration(seconds: 5),
...
}
)
```

After:
```dart
ReplyMessage.fromJson(
{
...
'message_type': 'text',
'voiceMessageDuration': '5000000',
...
}
)
```

in `ReplyMessage.toJson`:

Before:
```dart
{
...
message_type: MessageType.text,
voiceMessageDuration: 0:00:05.000000,
...
}
```

After:
```dart
{
...
message_type: text,
voiceMessageDuration: 5000000,
...
}
```


## Installing

1. Add dependency to `pubspec.yaml`
Expand Down

0 comments on commit 31f6e79

Please sign in to comment.