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

bubble_box 封面
套件詳情v0.5.3

bubble_box

一個功能強大的氣泡框,實現了基本氣泡、邊框、虛線、漸變色、角度、自適應寬高、氣泡方向、偏移等特性。

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

安裝套件

flutter pub add bubble_box

套件介紹

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

Bubble Box 是一個 Flutter 套件,讓開發者能夠建立視覺上吸引人的氣泡形狀容器,具備可自訂的功能,例如邊框、點線、漸層、角度、適應性大小以及方向偏移。它支援多個平台,包含 Android、iOS、Web、macOS、Windows 和 Linux。此套件簡化了動態且時尚的 UI 元素實作,非常適合用於提示工具、徽章或互動式設計元件。透過直觀的設定選項,它能在不需複雜自訂繪圖的情況下提升使用者介面美學。

適用情境

  • 建立動畫提示
  • 設計聊天氣泡
  • 建構互動式徽章
  • 透過漸變效果增強使用者介面
  • 實現響應式氣泡佈局

主要特色

  • 可自訂氣泡方向
  • 自適應寬度和高度
  • 漸層顏色支援
  • 虛線邊框
  • 角度與偏移調整
  • 平台跨相容性

適合對象

  • 尋求視覺魅力的UI設計師
  • 開發聊天介面的開發者
  • 需要動態徽章組件的應用程式
  • 注重視覺效果的專案
  • 跨平台行動與網頁應用程式

使用建議

  • 過度使用可能影響效能
  • 需要仔細的版面管理
  • 除了基本範例之外,文件內容有限
  • 不適合簡單的矩形形狀

原始 README

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

pub package

English 中文

bubble_box

A powerful bubble box, which implements basic bubble, border, dotted line, gradient color, angle, adaptive width and height, bubble direction, offset, etc.

This project was wrote with pure dart code,which means it's support both iOS As well as Android, web, windows, linux, etc.

Modified a lot of APIs, please pay attention to upgrade

Screenshot

Basic Components

BubbleBox(
    maxWidth: MediaQuery.of(context).size.width * 0.8,
    child: Text('I am a basic component application example'),
)

Customize the border color, width, and component background color

BubbleBox(
    maxWidth: MediaQuery.of(context).size.width * 0.8,
    shape: BubbleShapeBorder(
      border: BubbleBoxBorder(
        color: Colors.blue,
        width: 3,
      ),
      position: const BubblePosition.center(0),
      direction: BubbleDirection.right,
    ),
    backgroundColor: Colors.green.withOpacity(0.8),
    child: Text('I can customize the color and width of the border, the background color of the component, the position of the sharp corner of the bubble and the offset of the sharp corner'),
  )

Define the border as a dashed line and the border color gradient

BubbleBox(
    maxWidth: MediaQuery.of(context).size.width * 0.8,
    gradient: LinearGradient(
      colors: [
        Colors.pink,
        Colors.orange[700],
      ],
    ),
    blendMode: BlendMode.srcATop,
    shape: BubbleShapeBorder(
      border: BubbleBoxBorder(
        gradient: LinearGradient(
          colors: [
            Colors.pink,
            Colors.orange[700],
          ],
        ),
        width: 3,
        style: BubbleBoxBorderStyle.dashed,
      ),
      direction: BubbleDirection.left,
      position: const BubblePosition.start(12),
    ),
    margin: EdgeInsets.all(4),
    elevation: 5,
    shadowColor: Colors.redAccent,
    child: Text(
        'However, I can not only customize the border and sharp corners of the bubble. I can also define the border as a dashed line and a gradient of border color. \nI am adaptive to the content, there is no need to set the width and height. Of course, you can limit the maximum width and height of the component. \nMy content can also be faded. \nIn addition, you may need some shadows, and the shadows may also need some of their own colors.'),
  )

background color gradient

BubbleBox(
    maxWidth: MediaQuery.of(context).size.width * 0.85,
    elevation: 5,
    gradient: LinearGradient(colors: [
      Colors.red,
      Colors.orange[700],
      Colors.orange[500],
    ]),
    shape: BubbleShapeBorder(
      border: BubbleBoxBorder(
        gradient: LinearGradient(
          colors: [
            Colors.pink,
            Colors.orange[700],
          ],
        ),
        color: Colors.blue,
        width: 3,
        style: BubbleBoxBorderStyle.dashed,
      ),
      direction: BubbleDirection.none,
      position: const BubblePosition.start(12),
    ),
    margin: EdgeInsets.all(4),
    child: Text(
      'my background can actually fade',
    ),
  ),

obtuse angle

BubbleBox(
    maxWidth: MediaQuery.of(context).size.width * 0.85,
    shape: BubbleShapeBorder(
      direction: BubbleDirection.left,
      position: const BubblePosition.start(12),
      arrowQuadraticBezierLength: 2,
    ),
    backgroundColor: Color(0xff98E165),
    margin: EdgeInsets.all(4),
    child: Text(
      'We added new obtuse angles so that the triangles are no longer so sharp',
    ),
  ),

enhanced radius

BubbleBox(
    maxWidth: MediaQuery.of(context).size.width * 0.85,
    backgroundColor: Color(0xff98E165),
    margin: EdgeInsets.all(4),
    shape: BubbleShapeBorder(
      radius: BorderRadius.only(
          topRight: Radius.elliptical(30, 15),
          bottomLeft: Radius.elliptical(30, 15)),
    ),
    child: Text(
      'We have made some modifications to the border radius to make it more free',
    ),
  ),

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。