搜索插件、代码仓与 APP 分类

blurry 封面
插件详情v1.4.2

blurry

带有模糊效果和内置主题的新 Flutter 对话框显示。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
114
喜欢数
49
Pub 分数
150

安装插件

flutter pub add blurry

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Blurry 是一个 Flutter 包,提供具有模糊效果的视觉上吸引人的对话框小部件,灵感来自玻璃拟态设计。它带有内置主题,可轻松自定义外观,非常适合现代 UI。该对话框支持 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台,确保在各种设备上保持一致的性能。通过 `flutter pub add blurry` 进行最少设置,开发者可以快速将美观、半透明的对话框集成到应用中。该包通过微妙的视觉深度和优雅提升了用户体验。

适合场景

  • 创建现代应用程序对话框
  • 实现玻璃拟态UI元素
  • 添加半透明叠加层
  • 提升移动和桌面应用程序的美学
  • 设计沉浸式用户界面

主要特点

  • 对话内容的模糊效果
  • 内置可自定义主题
  • 跨平台兼容性
  • 与 Flutter 的轻松集成
  • 对多种操作系统的支持

适合对象

  • 寻求现代美学的UI设计师
  • 开发玻璃拟态界面的开发者
  • 需要优雅覆盖对话框的应用程序
  • 针对多个平台的项目
  • 专注于视觉美化

使用建议

  • 对低端设备的性能影响
  • 超出所提供主题的定制选项有限
  • 高模糊强度可能导致可读性问题
  • 需要仔细规划色彩对比
  • 可能不适合所有应用设计风格

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Blurry Dialog

Features

  • Display simple blurry dialog popup
  • Offer built-in themes
  • Possibility to create you custom dialog
  • Button click handler callbacks
  • Customizable text
  • Customizable barrier color and behavior
  • Customize popup size
  • Customizable layout LTR, RTL, Center
  • Support arabic language
  • Input popup option with keyboard type
  • Customizable input style and input text style
  • Password popup type with eye icon to view password
  • Single item selector type

Getting started

To use the blurry dialog package you need to add it in pubspec.yaml file

dependencies:
	blurry: ^1.4.2

Usage

Parameters
///the dialog popup title, required in all blurry class constructors
final String title;

///the dialog description text
///required in all blurry class constructors
final String description;

///the cancel button text, by default it's 'Cancel'
final String cancelButtonText;

///the confirm button (primary button) text string
final String confirmButtonText;

///the dialog theme color
///will be applied on buttons and icon
///not available in default types constructors (info, error, warning, success)
late Color? themeColor;

///function invoked when the primary button is pressed
///required in all constructors
final Function onConfirmButtonPressed;

///the callback that will be invoked when pressing on cancel button
final Function? onCancelButtonPressed;

///the icon that will be rendered in the dialog
///required only when using the default constructor
late IconData? icon;

///title text style, by default it's null
final TextStyle? titleTextStyle;

///description text style, by default it's null
final TextStyle? descriptionTextStyle;

///button text style, by default it's null
final TextStyle? buttonTextStyle;

///the blurry dialog popup height
final double? popupHeight;

///indicate whether the cancel button will be rendered or not
///by default the cancel button is displayed
final bool displayCancelButton;

///indicates whether the popup dialog is dismissable or not
///by default [dismissable = true]
final bool dismissable;

///the color of the barrier of the burry dialog
///if it's null the barrier color will be the default color [Colors.black54]
final Color? barrierColor;

///the layout rendering type, LTR, RTL or center
///possible values
/// - ltr
/// - rtl
/// - center
/// by default is [LAYOUT_TYPE.ltr]
final LAYOUT_TYPE layoutType;

/// the input label string, required when using the input constructor
late String? inputLabel;

/// the input text field text controller
/// required when using the input constructor
late TextEditingController? inputTextController;

/// the input text style by default it's just black text
late TextStyle inputTextStyle;

/// the input label style by default it's just black text
late TextStyle inputLabelStyle;

/// text input type applied on input field
/// available only when using the input constructor
late TextInputType textInputType;

/// the design type of the popup, available when using input constructor
/// availabele options
/// {
/// info,
/// success,
/// error,
/// warning
/// }
/// ```
late BLURRY_TYPE? type;


/// indicate whether display visibility eye icon on password fields
/// available only when using `Blurry.password` constructor
/// by default it's 'true'
bool withVisibilityEye =  true;


///list items that will be rendered in the single selector blurry popup type
///available only when using `singleChoiceSelector` constructor (should be not null and not empty)
late  List<Widget>?  items;


///invoked when pressing on item from the list
///available only when using `singleChoiceSelector`
///by default pressing an element from the list will close the popup
late  Function(int)?  onItemSelected;
Examples

Info style blurry package


Blurry.info(
	title:  'Info blurry',
	description:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididuntut labore et dolore magna aliqua. Ut enim ad minim veniam',
	confirmButtonText:  'Confirm',
	titleTextStyle:  const TextStyle(fontFamily:  'Zen'),
	popupHeight:  300,
	buttonTextStyle:  const TextStyle(
		decoration: TextDecoration.underline,
		fontFamily:  'Zen'
	),
	descriptionTextStyle:  const TextStyle(fontFamily:  'Zen'),
	onConfirmButtonPressed: () {})
.show(context);

Success style blurry package

Blurry.success(
	title:  'Success blurry',
	description:
	'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam',
	confirmButtonText:  'Confirm',
	onConfirmButtonPressed: () {},
	barrierColor: Colors.white.withOpacity(0.7),
	dismissable:  false,
).show(context);

Error style blurry package

Blurry.error(
	title:  'Error blurry',
	description:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididun',
	confirmButtonText:  'Confirm',
	onConfirmButtonPressed: () {
		print('hello world');
	})
.show(context);

Warning style blurry package

Blurry.warning(
	title:  'Warning blurry',
	description:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididun',
	confirmButtonText:  'Confirm',
	onConfirmButtonPressed: () {
		print('hello world');
	})
.show(context);

Custom style blurry package


Blurry(
	icon: Icons.verified_user,
	themeColor: Colors.purple,
	title:  'Custom blurry',
	description:  'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
	confirmButtonText:  'Confirm',
	onConfirmButtonPressed: () {})
.show(context);

Arabic Blurry Popup with RTL layout

Blurry.info(
	layoutType: LAYOUT_TYPE.rtl,
	title:  'المعلومات ضبابية',
	description:'اربك تكست هو اول موقع يسمح لزواره الكرام بتحويل الكتابة العربي الى كتابة مفهومة',
	confirmButtonText:  'يتأكد',
	cancelButtonText:  'يلغي',
	titleTextStyle:  const TextStyle(fontFamily:  'Zen'),
	popupHeight:  300,
	buttonTextStyle:  const TextStyle(
		decoration: TextDecoration.underline,
		fontFamily:  'Zen'
	),
	descriptionTextStyle:  const TextStyle(fontFamily:  'Zen'),
	onConfirmButtonPressed: () {},
).show(context);

Input Type Example


Blurry.input(
	title:  'Blurry Input',
	description:'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
	confirmButtonText:  'Confirm',
	onConfirmButtonPressed: () {},
	inputLabel:  'Email',
	themeColor: Colors.red,
	icon: Icons.reduce_capacity_outlined,
	inputTextController: TextEditingController(),
).show(context);

Number Input Example

Blurry.input(
	title:  'Blurry Code Input',
	description:'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
	confirmButtonText:  'Confirm',
	onConfirmButtonPressed: () {},
	inputLabel:  'Code',
	type: BLURRY_TYPE.info,
	inputTextController: TextEditingController(),
	textInputType: TextInputType.number,
).show(context);

Password Input Example

Blurry.password(
	title:  'Blurry Code Input',
	description:'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
	confirmButtonText:  'Confirm',
	onConfirmButtonPressed: () {},
	inputLabel:  'Password',
	type: BLURRY_TYPE.info,
	inputTextController: TextEditingController(),
).show(context);

Single selector Example

Blurry.singleChoiceSelector(
	items:  List.generate(
		5,
		(index) =>  Padding(
			padding:  const  EdgeInsets.symmetric(
				horizontal:  5
			),
			child:  ListTile(
				title:  Text('Name: User $index'),
				subtitle:  Text('Age : ${index * 20}'),
			)
		),
	),
	title:  'Blurry Single selector',
	description:'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
	themeColor:  Colors.pink,
	icon:  Icons.account_circle_outlined,
	popupHeight:  300,
).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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。