搜尋套件、儲存庫與 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),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。