buildTitle method
Implementation
Widget buildTitle(BuildContext context) {
var notificationContent = widget.message['notification_content'];
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
return Stack(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (notificationContent['icon'] != null) buildNotificationIcon(),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 8.0, bottom: 13.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
notificationContent['title'].toString(),
style: TextStyle(
color: isDarkMode
? widget.themeConfig?.darkText ?? Colors.white
: widget.themeConfig?.lightText ?? Colors.black,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
SizedBox(height: 4),
Text(
notificationContent['body'].toString(),
style: TextStyle(
color: isDarkMode
? widget.themeConfig?.darkText ?? Colors.white
: widget.themeConfig?.lightText ?? Colors.black,
height: 1.5,
fontWeight: FontWeight.normal,
fontSize: 12,
),
),
SizedBox(height: 8),
if (notificationContent['buttons'] != null)
buildButtonRow(),
Row(
children: [
Text(
GetTimeAgo.parse(
DateTime.fromMillisecondsSinceEpoch(
widget.message['status'][0]['timestamp']),
),
style: TextStyle(
color: isDarkMode
? widget.themeConfig?.darkText ?? Colors.white
: widget.themeConfig?.lightText ?? Colors.black,
fontSize: 10,
fontWeight: !widget.message['isRead']
? FontWeight.bold
: FontWeight.normal,
),
),
],
),
],
),
),
),
if (notificationContent['attachments'] != null &&
notificationContent['attachments']['attachment'] != null)
buildAttachment(),
],
),
buildBottomSheetButton(!widget.message['isRead'], widget.message),
],
);
}