패키지, 저장소 및 앱 카테고리 검색

cherry_toast 표지
패키지 상세v1.13.0

cherry_toast

아름다운 디자인과 애니메이션을 갖춘 플러터에서 토스트를 표시하는 새로운 방법

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
4.3천
좋아요
259
Pub 점수
150

패키지 설치

flutter pub add cherry_toast

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Cherry Toast는 부드러운 애니메이션과 사용자 정의 가능한 디자인을 갖춘 현대적이고 시각적으로 매력적인 토스트를 표시하는 데 사용할 수 있는 플러터 패키지입니다. 표준 플러터 토스트의 우아한 대안을 찾는 개발자를 위해 제작되었으며, 미묘하지만 세련된 피드백을 통해 사용자 경험을 향상시킵니다. 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스 등 다양한 플랫폼을 지원하여 기기 간 일관된 동작을 보장합니다. 직관적인 API와 미학에 중점을 두어, Cherry Toast는 플러터 애플리케이션에 매력적인 알림을 쉽게 통합할 수 있도록 합니다.

사용 사례

  • 작업 후 사용자 피드백 표시
  • 성공 또는 오류 메시지 표시
  • 애니메이션 알림으로 UI 개선
  • 경량 상태 업데이트 제공
  • 시각적 매력으로 앱의 완성도 향상

주요 기능

  • 아름다운 현대적인 디자인
  • 부드러운 애니메이션
  • 크로스 플랫폼 지원
  • 사용자 정의 가능한 외관
  • 간단한 API 통합
  • 다양한 토스트 유형을 지원합니다

적합한 대상

  • UI 미학을 우선시하는 플러터 개발자
  • 정교한 사용자 피드백이 필요한 앱
  • 현대적인 알림 스타일을 목표로 하는 프로젝트
  • 사용하기 쉬운 토스트 솔루션을 원하는 개발자
  • 사용자 경험 향상에 집중하는 팀

고려 사항

  • 다크 모드용 추가 스타일링이 필요할 수 있습니다
  • 기능이 풍부한 알림 시스템과 비교해 사용자 맞춤 설정이 제한됨
  • 외부 애니메이션 라이브러리에 의존합니다
  • 복잡한 알림 워크플로에 적합하지 않음
  • 간단하고 짧은 메시지에 가장 적합

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Cherry Toast


A new way to display toasts in Flutter in an elegant design and animations

info_cherry_toast.gif error_cherry_toast.gif bottom_cherry_toast.gif
warning_cherry_toast.gif success_cherry_toast.gif right_layout_cherry_toast.gif

Cherry Toast

  • Support all platforms
  • Top and Bottom display position
  • Customizable background color
  • Support RTL layout rendering (for arabic text)
  • Multiple built-in themes
  • Built-in animations
  • Support null safety
  • Elegant design
  • Full customizable
  • Heartbeat animation on icons
  • Customizable icon size and color and display
  • Dismissable notification
  • Customizable toast constraints, height and width

Installation

To add cherry toast to your project add this line to your pubspec.yaml file

dependencies:
  cherry_toast: ^1.13.0

Parameters

/// Text widget displayed as a title in the toast
  /// required parameter for all toast types
  final Text? title;

  /// Text widget displayed as a description in the toast
  final Text? description;

  /// The action button displayed below description
  final Text? action;

  /// The toast icon, it's required when using the default constructor
  late IconData icon;

  /// The Icon color
  /// this parameter is only available on the default constructor
  /// for the built-in themes the color  will be set automatically
  late Color iconColor;

  /// Background color of container
  final Color backgroundColor;

  /// Box shadow color of container
  final Color shadowColor;

  /// Custom widget displayed at the place of the predefined icons
  final Widget? iconWidget;

  /// The icon size
  /// this parameter is available in default constructor
  late double iconSize;

  /// The toast display postion, possible values
  /// ```dart
  /// {
  /// top,
  /// bottom
  /// }
  /// ```
  final Position toastPosition;

  /// The color that will be applied on the circle behind the icon
  /// for better rendering the action button must have the same color
  late Color themeColor;

  /// The function invoked when clicking on the action button
  final Function? actionHandler;

  /// The duration of the animation by default it's 1.5 seconds
  final Duration animationDuration;

  /// The animation curve by default it's set to `Curves.ease`.
  final Cubic animationCurve;

  /// The animation type applied on the toast
  /// ```dart
  /// {
  /// fromTop,
  /// fromLeft,
  /// fromRight
  /// }
  /// ```
  final AnimationType animationType;

  /// Indicates whether the toast will be hidden automatically or not.
  final bool autoDismiss;

  /// The duration of the toast if [autoDismiss] is true
  final Duration toastDuration;

  /// The layout of the toast
  /// ```dart
  /// {
  /// ltr,
  /// rtl
  /// }
  /// ```
  final TextDirection textDirection;

  /// Display / Hide the close button icon
  final bool displayCloseButton;

  /// Define the border radius applied on the toast
  final double borderRadius;

  /// Define whether the icon will be  rendered or not
  final bool displayIcon;

  /// Define wether the animation on the icon will be rendered or not
  final bool enableIconAnimation;

  /// The attribute  is declaring a final variable named "width" of type double with a nullable value.
  /// width attribute define the toast width
  final double? width;

  /// The attribute is declaring a final variable named "height" of type double with a nullable type
  /// modifier.
  /// height attribute define the toast height
  final double? height;

  /// Enable taost constraints customization (by default it's null)
  final BoxConstraints? constraints;

  /// Indicate whether the toast animation is enabled or not
  /// by default the toast animation is enabled
  final bool disableToastAnimation;

  /// Indicate toast should inherit theme colors sheme, to apply in background
  /// and shadow color.
  final bool inheritThemeColors;

  /// Callback invoked when toast get dismissed (closed by button or dismissed automtically)
  final Function()? onToastClosed;

  /// Horizontal alignment display of the toast content
  final CrossAxisAlignment horizontalAlignment;

  /// The space rendered between the title and description widgets.
  final double titleDescriptionMargin;

  /// The space rendered between the description and actions widgets.
  final double descriptionActionMargin;

Usage

  • Simple cherry toast with only title

CherryToast.success(

title:  Text("The simplest cherry toast", style: TextStyle(color: Colors.black))

).show(context);



  • Simple cherry toast with action button

CherryToast.info(

title:  Text("User added", style: TextStyle(color: Colors.black)),

action: Text("Display information", style: TextStyle(color: Colors.black)),

actionHandler: (){

print("Action button pressed");

},

).show(context);




A new way to display toasts in Flutter in an elegant design and animations

  • Toast with description without title

CherryToast.warning(

description:  Text("All information may be deleted after this action", style: TextStyle(color: Colors.black)),

animationType:  AnimationType.fromLeft,

action:  Text("Backup data", style: TextStyle(color: Colors.black)),

actionHandler: (){

print("Hello World!!");

},

).show(context);



  • Toast with nothing but description with different animation type and auto dismiss

CherryToast.error(

description:  Text("Invalid account information", style: TextStyle(color: Colors.black)),

animationType:  AnimationType.fromRight,

animationDuration:  Duration(milliseconds:  1000),

autoDismiss:  true

).show(context);



  • Bottom displayed cherry toast

CherryToast(

icon:  Icons.alarm_add,

themeColor:  Colors.pink,

description:  Text("A bottom cherry toast example", style:  TextStyle(color:  Colors.black)),

toastPosition:  Position.bottom,

animationDuration:  Duration(milliseconds:  1000),

autoDismiss:  true

).show(context);


  • Right layout rendered cherry toast

CherryToast(

icon:  Icons.car_repair,

themeColor:  Colors.green,

description: const Text("هذا مثال تصميم من اليمين",  style:  TextStyle(color:  Colors.black)),

toastPosition:  Position.bottom,

layout:  ToastLayout.rtl,

animationType:  AnimationType.fromRight,

action: const Text("انقر هنا", style:  TextStyle(color:  Colors.green)),


animationDuration: const Duration(milliseconds:  1000),

autoDismiss:  true)

.show(context);



Contribution

Of course the project is open source, and you can contribute to it repository link

  • If you found a bug, open an issue.

  • If you have a feature request, open an issue.

  • If you want to contribute, submit a pull request.

Contributors

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.