How to remove the date but still keep the time?
Here is the date and time code:
ChatScreen.dart
void initState() {
super.initState();
ConversationModel objConversation = ConversationModel(
date: conversation!.date,
);
}
@override
Widget build(BuildContext context) {
...
subtitle: Text(
conversation!.date!,
style: TextStyle(color: Colors.white.withOpacity(.7), fontSize: 12),),
...
}
ConversationModel.dart
class ConversationModel {
String? date;
ConversationModel(
{
this.date,
});
ConversationModel.fromJson(Map<String, dynamic> json) {
date = json['date'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['date'] = this.date;
return data;
}
And the output:
Any solutions?
