FlutterToastifyContent class

Bu kod, bir bildirim içeriği gösteren Flutter Toastify uyarılarını oluşturan FlutterToastifyContent adlı bir widget sınıfını tanımlar. Bu widget, bildirimlerin içeriğini oluşturmak için kullanılır ve şu özelliklere sahiptir:

  • title: Bildirim başlığını içeren bir Widget (isteğe bağlı).
  • description: Bildirim açıklamasını içeren bir Widget (zorunlu).
  • icon: Bildirimde gösterilecek simgeyi içeren bir Widget (isteğe bağlı).
  • iconSize: Simge boyutunu piksel cinsinden belirten bir değer (varsayılan olarak 20).
  • notificationType: Bildirim türünü belirleyen NotificationType enum değeri (SUCCESS, ERROR, INFO, CUSTOM).
  • onCloseButtonPressed: Kapatma düğmesine basıldığında çağrılacak fonksiyon.
  • displayCloseButton: Kapatma düğmesini gösterme veya gizleme durumunu belirleyen bir boolean değer.
  • closeButton: Kapatma düğmesi için özel olarak belirtilen bir Widget (isteğe bağlı).
  • action: Tıklanabilir mürekkep ile render edilen bir eylem bileşeni (isteğe bağlı).
  • onActionPressed: action bileşeni için tetikleyici fonksiyon (action != null olduğunda boş olmamalıdır). FlutterToastifyContent widget'ı, bildirim içeriğini düzenlemek için bir Row içinde birkaç alt bileşeni düzenler. Bildirim türüne göre, simge alanı doğru simgeyle değiştirilir ve bildirim içeriği görsel olarak oluşturulur. Aynı zamanda kapatma düğmesi ve opsiyonel eylem bileşeni de bu içeriğe eklenir. Genel olarak, bu kod, kullanıcı dostu bildirim içeriklerini oluşturmak için kullanılabilir ve bildirimlerin içeriğini düzenleme sürecini kolaylaştırır. This code defines a Flutter widget called FlutterToastifyContent, which is used to create the content of Flutter Toastify notifications. The widget is responsible for building the visual representation of the notification content and has the following properties:
  • title: A Widget that contains the title of the notification (optional).
  • description: A Widget that contains the description of the notification (required).
  • icon: A Widget that represents the icon to be displayed in the notification (optional).
  • iconSize: A value that determines the size of the icon in pixels (default is 20).
  • notificationType: A NotificationType enum value that specifies the type of the notification (SUCCESS, ERROR, INFO, CUSTOM).
  • onCloseButtonPressed: A function that will be called when the close button is pressed.
  • displayCloseButton: A boolean value that determines whether to display the close button or not.
  • closeButton: A custom Widget specifically provided for the close button (optional).
  • action: A clickable ink renderable action component (optional).
  • onActionPressed: A trigger function for the action component (should not be empty when action != null). The FlutterToastifyContent widget organizes the notification content within a Row with several sub-components. Depending on the notification type, the icon area is replaced with the appropriate icon, and the visual representation of the notification content is built. Additionally, the close button and optional action component are also included in this content. In conclusion, this code can be used to create user-friendly notification contents and simplifies the process of composing the content for notifications.
Inheritance

Constructors

FlutterToastifyContent({Key? key, Widget? title, required Widget description, required NotificationType notificationType, required bool displayCloseButton, required void onCloseButtonPressed(), Widget closeButton(void dismissNotification())?, Widget? icon, double iconSize = 20, Widget? action, dynamic onActionPressed()?})
const

Properties

action Widget?
Tıklanabilir mürekkep ile render edilen eylem bileşeni varsayılan olarak action == null
final
closeButton Widget Function(void dismissNotification())?
Kapatma düğmesi bileşeni, varsayılan olarak action == null
final
description Widget
Bildirim açıklaması
final
displayCloseButton bool
Kapatma düğmesi bileşenini gösterme veya gizleme
final
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
Bildirim simgesi
final
iconSize double
Simge boyutu (piksel cinsinden)
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
notificationType NotificationType
Bildirim tipi, her bir yapılandırmada otomatik olarak ayarlanacaktır Mümkün değerler:
final
onActionPressed → dynamic Function()?
action bileşenine basıldığında çağrılacak fonksiyon action != null olduğunda boş olmamalıdır
final
onCloseButtonPressed → void Function()
Kapatma düğmesine basıldığında çağrılacak fonksiyon
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title Widget?
Eğer varsa, bildirim başlığı
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited