-
Notifications
You must be signed in to change notification settings - Fork 57
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
Feature request: Date and/or Time #30
Comments
Try this one! return ListView.builder(
reverse: true,
padding: const EdgeInsets.only(left: 5, right: 5, top: 5, bottom: 10),
itemCount: history!.messages.length,
itemBuilder: (context, index) {
Message message = history!.messages[index];
bool sent = widget.me == message.user;
DateTime date = message.timestamp!.toLocal();
int msgLength = message.msg.length;
int limit = 35;
return Bubble(
style: sent ? styleMe : styleSomebody,
child: Container(
constraints: BoxConstraints(
maxWidth: mediaQueryData.size.width * 0.7,
),
child: Stack(
children: [
Padding(
padding: EdgeInsets.only(bottom: msgLength <= limit ? 0 : 18),
child: Text(
message.msg + (msgLength <= limit ? ' ' : ''),
style: DefaultTextStyle.of(context).style
),
),
Positioned(
bottom: 0,
right: 0,
child: Text(
dateFormatToday.format(date),
textAlign: TextAlign.end,
style: DefaultTextStyle.of(context).style.copyWith(fontSize: 12, color: Colors.grey.shade400)
),
)
],
),
),
);
}
); |
hi @rafaelsetragni thanks for your example code it is working great, but i am also using images inside. here is my code:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi any chance that you can add a field where i can provide the Date or/and Time....
i tried to insert a Column Widget with a second row, but positioning and styling looks pretty ugly
best regards
harald
The text was updated successfully, but these errors were encountered: