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

m_toast 封面
插件详情v0.2.4

m_toast

用于 flutter 的自定义 Toast,只需一行代码即可轻松创建 Toast。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
120
喜欢数
40
Pub 分数
140

安装插件

flutter pub add m_toast

插件介绍

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

m_toast 是一个轻量级的 Flutter 包,可让开发者用最少的代码显示可自定义的提示消息。设计简洁,只需一行代码即可显示提示,非常适合在应用中快速反馈。支持 Android、iOS、Web、macOS、Windows 和 Linux 多个平台。该包提供对外观、持续时间和位置的轻松自定义,提升用户体验而不增加复杂性。特别适用于表单提交或按钮点击等操作的即时通知。

适合场景

  • 在用户操作后显示快速反馈
  • 显示成功或错误消息
  • 通过细微的通知提升用户体验
  • 跨平台简化吐司实现
  • 提供非侵入式警报

主要特点

  • 一行式 toast 创建
  • 可自定义的外观和时序
  • 跨平台支持
  • 最小化样板代码
  • 与现有 Flutter 项目的轻松集成
  • 可配置的位置和动画

适合对象

  • 初学者 Flutter 开发者
  • 需要简单通知系统的应用
  • 需要一致吐司样式的项目
  • 寻求快速实现的开发者
  • 面向用户界面的应用程序

使用建议

  • 有限的高级自定义选项
  • 可能需要额外的样式设置以实现复杂设计
  • 不适用于持久通知
  • 依赖外部依赖管理
  • 仅适用于短暂、简短的消息

原始 README

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

MToast

pub package pub package

Toast Library for Flutter

Supported Platforms

  • Android
  • IOS
  • Android
  • Linux
  • MacOS
  • Windows

Features

  • Add toast with custom icons, color and message
  • Add toast with custom images, color and message

Getting Started

In order to add m_toast to your project add this line to your pubspec.yaml file

# add this line to your dependencies
m_toast: ^0.2.4
import 'package:m_toast/m_toast.dart';
To call the toast

ShowMToast toast = ShowMToast(context);

toast.successToast(message: "
Hello
"
);
toast.errorToast(message: "
Hello
"
);

Preview Images

Toast with custom images

MToast have default style, and you also can custom style or other behavior.

name type need desc
message String required Toast message
textColor Color optional Color of text(toast message)
backgroundColor Color optional backgroundColor
alignment ToastPosition required
iconColor Color optional If Color is not given the icon will adapt the default color
icon IconData optional Icon in Toast
image AssetImage optional Image instead of Icon
duration int optional Duration should be given in milliseconds(for eg duration: 1500)
elevation double optional Elevation(0.0)
width double optional width

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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。