showInAppNotification function

void showInAppNotification(
  1. BuildContext context,
  2. InAppNotification notification
)

Show an in-app notification as a banner on top of the screen

Implementation

void showInAppNotification(
  BuildContext context,
  InAppNotification notification,
) {
  showSimpleNotification(
    context: context,
    Text(notification.title),
    subtitle: Text(notification.subtitle),
    background: context.colorScheme.primary,
    foreground: context.colorScheme.onPrimary,
    contentPadding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 24.0),
    duration: const Duration(seconds: 5),
    slideDismissDirection: DismissDirection.up,
  );
}