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

mobkit_dashed_border 封面
套件詳情v0.0.8

mobkit_dashed_border

虛線和曲線邊框的自定義邊框實現。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2.5萬
喜歡數
68
Pub 分數
150

安裝套件

flutter pub add mobkit_dashed_border

套件介紹

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

一個 Flutter 套件,支援自訂虛線邊框,並支援曲線與平滑過渡。它擴展了 Flutter 的裝飾系統,讓開發者能精確控制虛線長度、間隔大小與邊框曲率,為組件套用虛線輪廓。非常適合需要風格化邊框的 UI 元件,例如卡片、按鈕或具有現代美學的容器。此套件相容於所有主要平台,包含 Android、iOS、Web、macOS、Windows 與 Linux。

適用情境

  • 使用虛線輪廓進行樣式化卡片
  • 創建裝飾性按鈕邊框
  • 設計自定義容器框架
  • 透過視覺層次增強使用者介面
  • 構建響應式佈局組件

主要特色

  • 對曲線虛線邊框的支援
  • 可自訂的虛線與間距長度
  • 所有平台上的平滑渲染
  • 擴展 Flutter 的 BoxDecoration
  • 透過 pub add 輕鬆整合

適合對象

  • 尋求視覺魅力的UI設計師
  • 開發跨平台應用的開發者
  • 需要獨特邊框樣式的專案
  • 具有現代或極簡設計的應用程式
  • 原型設計互動式介面

使用建議

  • 可能影響複雜形狀的效能
  • 需要仔細調整以獲得最佳外觀
  • 僅限邊框裝飾
  • 不適合高頻率動畫
  • 最佳搭配輕量級組件使用

原始 README

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

Mobkit Dashed Border

The Mobkit Dashed Border is a border that provide dashed lines. Same time that package provides use different properties with rounded corner unlike border class.

Getting started

Import the following package.
flutter pub add -d mobkit_dashed_border
import 'package:mobkit_dashed_border/mobkit_dashed_border.dart';

Usage

You can use this package like border class. Below you can see the different types of codes and their outputs.

This sample shows border that has same color ,width and non radius corner

Sample code:

Container(
    height: 75,
    decoration: const BoxDecoration(
        border:
            DashedBorder.fromBorderSide(dashLength: 10, side: BorderSide(color: Colors.black, width: 1),
        ),
    ),
    child: const Center(
        child: Text(
            'Same color and width',
        ),
    ),
),

Output of this code:

selectionScroll
This sample shows border that has same color ,width and radius corner

Sample code:

Container(
    height: 75,
    decoration: const BoxDecoration(
        border: DashedBorder.fromBorderSide(
            dashLength: 15, side: BorderSide(color: Colors.black, width: 2)),
        borderRadius: BorderRadius.all(Radius.circular(10))),
    child: const Center(
        child: Text(
            'Rounded same color and width',
        ),
    ),
),

Output of this code:

selectionScroll
This sample shows border that has different color ,width and radius corner

Sample code:

Container(
    height: 75,
    decoration: const BoxDecoration(
    border: DashedBorder(
        dashLength: 15,
        left: BorderSide(color: Colors.black, width: 2),
        top: BorderSide(color: Colors.red, width: 2),
        right: BorderSide(color: Colors.orange, width: 2),
        bottom: BorderSide(color: Colors.blue, width: 2),
    ),
    borderRadius: BorderRadius.only(
        topLeft: Radius.circular(0),
        topRight: Radius.circular(20),
        bottomLeft: Radius.circular(20),
        bottomRight: Radius.circular(0),
    ),
    ),
    child: const Center(
        child: Text(
            'Different rounded and color',
        ),
    ),
),

Output of this code:

selectionScroll
This sample shows a border drawn only on the corners.

Sample code:

   Container(
    height: 90,
    decoration: BoxDecoration(
    border: DashedBorder.all(
        color: Colors.black,
        dashLength: 40,
        width: 2,
        isOnlyCorner: true,
        strokeAlign: BorderSide.strokeAlignInside,
        strokeCap: StrokeCap.round,
    ),
    borderRadius: BorderRadius.circular(20),
    ),
    child: const Center(
        child: Text(
        'Is only corner',
        ),
    ),
),

Output of this code:

selectionScroll

所屬分類

原始碼儲存庫

使用此套件的專案