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

speech_balloon 封面
插件详情v0.0.4

speech_balloon

这是一个生成简单气泡对话框的 Flutter 小部件。该小部件可以显示简单的气泡对话框,并可呈现带有边框的气泡对话框。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
6060
喜欢数
43
Pub 分数
155

安装插件

flutter pub add speech_balloon

插件介绍

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

一个 Flutter 小部件,可创建简单且可自定义的气泡对话框,支持可选边框。非常适合聊天界面、工具提示或通知弹窗,支持 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台。该小部件轻量且易于集成,开发者只需少量配置即可以经典气泡格式显示文本。特别适用于社交媒体应用或需要对话元素的 UI。

适合场景

  • 聊天界面
  • 工具提示和提示
  • 通知弹窗
  • 社交媒体用户界面
  • 用户反馈气泡

主要特点

  • 简单的对话气泡设计
  • 可选边框支持
  • 跨平台兼容性
  • 轻松集成
  • 可自定义外观
  • 轻量级实现

适合对象

  • UI设计师
  • 聊天应用开发者
  • 移动和网页应用开发者
  • 教育类应用程序开发者
  • 原型设计工具

使用建议

  • 超出基本自定义之外的样式选项有限
  • 不适用于复杂动画
  • 最适合静态文本显示
  • 需要手动定位
  • 无内置箭头方向控制

原始 README

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

speech_balloon

A flutter widget that emulates a speech balloon.

This widget is a copy of https://pub.dev/packages/speech_balloon

I created this because the previous creator doesn't seem to have updated it.

Changes from speech_balloon include the ability to display a border.

Installing

Dart Pub: https://pub.dartlang.org/packages/speech_balloon#-installing-tab-

  1. Depend on it

    Add this to your package's pubspec.yaml file:

  speech_balloon: ^0.0.4
  1. Install it

    You can install packages from the command line:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

  1. Import it

Now in your Dart code, you can use:

import 'package:speech_balloon/speech_balloon.dart';

Usage

Creates a widget that emulates a speech balloon. Could be used for a tooltip, or as a pop-up notification, etc.

Example Project

Example Code

import 'package:flutter/material.dart';
import 'package:speech_balloon/speech_balloon.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('example'),
        ),
        body: Center(
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: [
              Column(
                children: [
                  SizedBox(height: 50),
                  SpeechBalloon(
                    nipLocation: NipLocation.bottom,
                    borderColor: Colors.red,
                    color: Colors.white,
                    child: Icon(
                      Icons.favorite,
                      color: Colors.red,
                    ),
                  ),
                  SizedBox(height: 50),
                  SpeechBalloon(
                    nipLocation: NipLocation.right,
                    color: Colors.red,
                    child: Icon(
                      Icons.favorite,
                      color: Colors.white,
                    ),
                  ),
                  SizedBox(height: 50),
                  SpeechBalloon(
                    nipLocation: NipLocation.left,
                    color: Colors.green,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Icon(
                          Icons.people,
                          color: Colors.white,
                        ),
                        Text(
                          '11',
                          style: TextStyle(color: Colors.white),
                        ),
                      ],
                    ),
                  ),
                  SizedBox(height: 50),
                  SpeechBalloon(
                    nipLocation: NipLocation.top,
                    borderColor: Colors.green,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Icon(
                          Icons.people,
                          color: Colors.green,
                        ),
                        Text(
                          '11',
                          style: TextStyle(color: Colors.green),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
              Column(
                children: [
                  SizedBox(height: 50),
                  SpeechBalloon(
                    nipLocation: NipLocation.bottomLeft,
                    borderColor: Colors.red,
                    color: Colors.white,
                    borderWidth: 3,
                    child: Icon(
                      Icons.favorite,
                      color: Colors.red,
                    ),
                  ),
                  SizedBox(height: 50),
                  SpeechBalloon(
                    nipLocation: NipLocation.bottomRight,
                    color: Colors.red,
                    child: Icon(
                      Icons.favorite,
                      color: Colors.white,
                    ),
                  ),
                  SizedBox(height: 50),
                  SpeechBalloon(
                    nipLocation: NipLocation.topLeft,
                    color: Colors.green,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Icon(
                          Icons.people,
                          color: Colors.white,
                        ),
                        Text(
                          '11',
                          style: TextStyle(color: Colors.white),
                        ),
                      ],
                    ),
                  ),
                  SizedBox(height: 50),
                  SpeechBalloon(
                    nipLocation: NipLocation.bottom,
                    borderColor: Colors.green,
                    height: 60,
                    width: 60,
                    borderRadius: 40,
                    offset: Offset(0, -1),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Icon(
                          Icons.people,
                          color: Colors.green,
                        ),
                        Text(
                          '11',
                          style: TextStyle(color: Colors.green),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

所属分类

源码仓库

使用此插件的项目

暂无相关数据。