flutter_notification_center/lib/src/models/notification_theme.dart

60 lines
1.8 KiB
Dart
Raw Normal View History

2024-04-03 14:38:40 +02:00
import 'package:flutter/material.dart';
2024-04-09 09:59:58 +02:00
/// Defines the appearance customization for notifications.
2024-04-03 14:38:40 +02:00
class NotificationStyle {
2024-04-09 09:59:58 +02:00
/// The text style for the title of the notification.
2024-04-03 14:38:40 +02:00
final TextStyle? titleTextStyle;
2024-04-09 09:59:58 +02:00
/// The text style for the subtitle of the notification.
2024-04-03 14:38:40 +02:00
final TextStyle? subtitleTextStyle;
2024-04-09 09:59:58 +02:00
/// The background color of the notification.
2024-04-03 14:38:40 +02:00
final Color? backgroundColor;
2024-04-09 09:59:58 +02:00
/// The color of the leading icon (if any) in the notification.
2024-04-03 14:38:40 +02:00
final Color? leadingIconColor;
2024-04-09 09:59:58 +02:00
/// The color of the trailing icon (if any) in the notification.
2024-04-03 14:38:40 +02:00
final Color? trailingIconColor;
2024-04-09 09:59:58 +02:00
/// The padding around the content of the notification.
2024-04-03 14:38:40 +02:00
final EdgeInsets? contentPadding;
2024-04-09 09:59:58 +02:00
/// The alignment of the title text within the notification.
2024-04-03 14:38:40 +02:00
final TextAlign? titleTextAlign;
2024-04-09 09:59:58 +02:00
/// The alignment of the subtitle text within the notification.
2024-04-03 14:38:40 +02:00
final TextAlign? subtitleTextAlign;
2024-04-09 09:59:58 +02:00
/// Whether the notification should be dense or not.
2024-04-03 14:38:40 +02:00
final bool? dense;
2024-04-09 09:59:58 +02:00
/// The decoration to apply to the tile of the notification.
final BoxDecoration? tileDecoration;
2024-04-09 09:59:58 +02:00
/// A builder function to display when there are no notifications.
final Widget Function()? emptyNotificationsBuilder;
2024-04-09 09:59:58 +02:00
/// The text style for the application title.
final TextStyle? appTitleTextStyle;
2024-04-03 14:38:40 +02:00
2024-04-09 09:59:58 +02:00
/// Creates a new [NotificationStyle] instance.
///
/// Each parameter is optional and allows customizing various aspects
/// of the notification appearance.
2024-04-03 14:38:40 +02:00
const NotificationStyle({
this.titleTextStyle,
this.subtitleTextStyle,
this.backgroundColor,
this.leadingIconColor,
this.trailingIconColor,
this.contentPadding,
this.titleTextAlign,
this.subtitleTextAlign,
this.dense,
this.tileDecoration,
this.emptyNotificationsBuilder,
this.appTitleTextStyle,
2024-04-03 14:38:40 +02:00
});
}