notification static method

FlintBox notification({
  1. required String message,
  2. NotificationType type = NotificationType.info,
  3. String? actionText,
  4. String? actionUrl,
})

Create a notification banner

Implementation

static FlintBox notification({
  required String message,
  NotificationType type = NotificationType.info,
  String? actionText,
  String? actionUrl,
}) {
  final colors = _getNotificationColors(type);

  return FlintBox(
    children: [
      FlintRichText(
        children: [
          FlintTextSpan(_getNotificationIcon(type),
              style: TextStyle(fontSize: 16)),
          FlintTextSpan(' $message'),
          if (actionText != null && actionUrl != null) ...[
            FlintTextSpan(' '),
            FlintTextSpan(
              actionText,
              style: FlintTextStyles.link.copyWith(color: colors.textColor),
              onTap: actionUrl,
            ),
          ],
        ],
      ),
    ],
    padding: EdgeInsets.all(12),
    backgroundColor: colors.backgroundColor,
    border: BoxBorder(width: 1, color: colors.borderColor),
    borderRadius: BorderRadius.circular(4),
  );
}