搜尋套件、儲存庫與 APP 分類

emoji_alert 封面
套件詳情v1.1.0

emoji_alert

Flutter Emoji Alert,讓您能夠建立美觀又簡單的警告對話方塊與底部表單模態框

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
150
喜歡數
23
Pub 分數
150

安裝套件

flutter pub add emoji_alert

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Emoji Alert 是一個 Flutter 套件,可讓開發者建立視覺上吸引人且簡單的警示對話方塊與底部彈出式模態,支援表情符號。它透過在標準 UI 元件中加入富有表現力、色彩豐富的元素來提升使用者體驗。適用於希望提供友善、互動式回饋之應用程式,可在 Android、iOS、Web、macOS、Windows 與 Linux 等所有主要平台運作。此套件輕量且易於整合,僅需一條指令即可透過 pub 加入。其設計著重於簡潔與美學,同時不犧牲功能性。

適用情境

  • 顯示用戶通知
  • 顯示應用狀態更新
  • 提升入職體驗
  • 在操作後提供反饋
  • 建立有趣的錯誤訊息

主要特色

  • 內建表情符號支援
  • 可自訂的警示樣式
  • 跨平台相容性
  • 與 Flutter 的簡單整合
  • 對底部彈出視窗模態的支援
  • 輕量且快速

適合對象

  • 行動與Web應用程式
  • 針對年輕受眾的應用
  • 引導流程
  • 基於反饋的介面
  • 簡單的通知系統

使用建議

  • 僅限基本的警示與底部彈出式選單類型
  • 可能需要自訂樣式以滿足進階使用案例
  • 依賴外部 GitHub 倉庫以取得更新
  • 不適合複雜的對話工作流程

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Flutter Emoji Alert

enter image description here

A new Stylish Emoji Alert with a wide variety of emojis, simple to implement and full customizable.

Features

  • Single line basic alert with default emoji

  • Add dynamic widgets not only text any widget you want

  • Add buttons with their onPress handlers

  • Choose the alert display behavior : Normal Alert or Bottom Sheet dialog

  • Choose an emoji from a variety of emojis

  • Animations when displaying the alert popup


Getting Started

To add emoji_alert to your project add this line to your pubspec.yaml


dependencies:
	emoji_alert:  1.1.0

Or you can reference the github repository directly

	dependencies:
		emoji_alert:
			git: https://github.com/koukibadr/Emoji_Alert.git

Parameters

Attribute Type Default Required Description
description Widget N/A True The alert body content
alertTitle Widget N/A False The alert top content
enableMainButton bool False False Display or not the popup's main button
enableSecondaryButton bool False False Whether display or not the secondary button
onSecondaryButtonPressed Function null False The function that will be invoked on pressing the secondary button
onMainButtonPressed Function null False The function that will be invoked on pressing the main button
onMainButtonPressed Function null False The function that will be invoked on pressing the main button
emojiType EMOJI_TYPE HAPPY False the emoji that will be displayed possible values: [ANGRY, CONFUSED, COOL, HAPPY, JOYFUL, LAUGHING, SAD, SCARED, SHOCKED, SMILE, WINK]
height double 200 False the height of the popup
emojiSize double 80 False the size of the emoji
background Color White False the popup background color
mainButtonColor Color Blue False The main button background color
secondaryButtonColor Color Blue False the secondary button color, PS: an opacity value will be added to this color
mainButtonText Text Text("Confirm") False the main button text
secondaryButtonText Text Text("Cancel") False the secondary button text
buttonSize double 200 False buttons width size
cancelButtonColorOpacity double 0.2 False an opacity will be added to the secondary button background color
cancelable bool True False Whether the popup can be dismissed on pressing outside it or not
cornerRadiusType CORNER_RADIUS_TYPES BOTTOM_ONLY False the border radius type, possible values: [BOTTOM_ONLY, TOP_ONLY, ALL_CORNERS, NONE]
width double null False the popup width by default it's null
animationType ANIMATION_TYPE ANIMATION_TYPE.NONE False the animation type that will be applied on the emoji [NONE, FADEIN, TRANSITION, ROTATION]

Examples

Simple alert with just a text in the body content


EmojiAlert(

description:  Column(

children: [

Text("Simple Example of the popup"),

Text("with minumum attributes"),

],

)).displayAlert(context);

first_example_alert.png

Example with custom widget in the popup content body


EmojiAlert(
	alertTitle:  Text("Joyful Alert", style:  TextStyle(fontWeight:  FontWeight.bold)),
	description:  Column(
		children: [
		Text("You can add also any widget"),
		Container(
			width:  200,
			child:  TextField(
				decoration:  InputDecoration(hintText:  "Input field example"),
			)),
	]
	),
	cancelable:  true,
	emojiType:  EMOJI_TYPE.JOYFUL,
	height:  300,
).displayAlert(context);

second_example_alert.png


EmojiAlert(
	alertTitle:  Text("Angry Alert", style:  TextStyle(fontWeight:  FontWeight.bold)),
	description:  Column(
		children: [
			Text("You can add a main button"),
		],
	),
	enableMainButton:  true,
	mainButtonColor:  Colors.red,
	onMainButtonPressed: () {
		print("Hello");
		Navigator.pop(context);
	},
	cancelable:  false,
	emojiType:  EMOJI_TYPE.ANGRY,
	height:  300,
).displayAlert(context);

third_example_alert.png

Bottom Sheet Modal

to display it as bottom sheet modal you need to use displayBottomSheet function

And you can display it as a bottom sheet modal, the code below is an example


EmojiAlert(
	alertTitle:  Text("Bottom Sheet Modal",
	style:  TextStyle(fontWeight:  FontWeight.bold)),
	description:  Column(
		children: [
			Text("And this is a bottom sheet modal with different Radius",
				style:  TextStyle(color:  Colors.blue),
				textAlign:  TextAlign.center,
			),
		],
	),
	enableMainButton:  true,
	cornerRadiusType:  CORNER_RADIUS_TYPES.TOP_ONLY,
	mainButtonColor:  Colors.green,
	mainButtonText:  Text("Save"),
	onMainButtonPressed: () {
		Navigator.pop(context);
	},
	cancelable:  true,
	emojiType:  EMOJI_TYPE.SMILE,
	width:  300,
	height:  300,
).displayBottomSheet(context);

fifth_example_alert.png

With Animation

in this example we used TRANSITION animation but you can choose any other built-in animations (see attributes description above)

EmojiAlert(
	description:  Column(
		children: [
			Text("Simple Example with animation"),
			Text("This is a transition animation"),
		],
	),
	animationType:  ANIMATION_TYPE.TRANSITION
).displayAlert(context);

the result:

animation_example.gif

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.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。