搜索插件、代码仓与 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

所属分类

源码仓库

使用此插件的项目