パッケージ、リポジトリ、アプリカテゴリを検索

dotted_border のカバー
パッケージ詳細v3.1.0

dotted_border

任意のウィジェットに点線ボーダーを簡単に追加できるFlutterパッケージです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
92.4万
いいね数
1650
Pub ポイント
160

パッケージをインストール

flutter pub add dotted_border

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

dotted_border パッケージは、Flutter の任意のウィジェットにドット付きボーダーを追加する簡単な方法を提供します。色、ストローク幅、ダッシュ長さ、ギャップ長さなどのオプションを使用して、ボーダーの外観をカスタマイズできます。このパッケージは、入力フィールド、ボタン、コンテナなど、点線または破線のアウトラインが必要な視覚的に魅力的なUI要素を作成するのに最適です。Android、iOS、Web、macOS、Windows、Linux といったすべての主要プラットフォームをサポートしており、デバイス間で一貫したスタイルを確保します。

用途

  • 入力フィールドに点線のアウトラインを追加する
  • スタイル化されたコンテナの境界を作成する
  • インタラクティブなボタンのハイライトを設計する
  • フォーム要素の視覚フィードバックの向上
  • 破線のボーダーを使用してカスタムUIコンポーネントを構築する

主な機能

  • カスタマイズ可能なドットサイズと間隔
  • 複数の境界線側面のサポート
  • 既存のウィジェットとの簡単な統合
  • クロスプラットフォーム互換性
  • 柔軟な色とストローク幅の設定

適している対象

  • 装飾的な枠を求めるUIデザイナー
  • フォームインターフェースを構築している開発者
  • フォーカス状態での視覚的フィードバックを必要とするアプリ
  • 複数のプラットフォーム間で一貫した点線スタイルが必要なプロジェクト
  • マルチプラットフォームアプリ用にFlutterを使用するチーム

注意事項

  • 多くのネストされたボーダーがあるとパフォーマンスに影響する可能性があります
  • 縁の装飾のみに制限される(コンテンツのクリッピングは不可)
  • 他の装飾品との境界の重なりを手動で処理する必要があります
  • 基本的な長方形を超える複雑な形状の境界には適していません
  • スムーズなレンダリングを維持するために、軽量のウィジェットと併用することをお勧めします

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Dotted Border

pub package

A flutter package to easily add dotted borders around widgets.

Installing

To use this package, add dotted_border as a dependency in your pubspec.yaml file.

Usage

Wrap DottedBorder widget around the child widget

DottedBorder(
  child: Text(
    'Rectangular Border',
    style: TextStyle(
      fontWeight: FontWeight.bold,
    ),
  ),
)
BorderTypes

This package supports the following border options

  • CustomPath
  • RoundedRect
  • Rect
  • Circular
  • Oval
Example
DottedBorder(
  options: RectDottedBorderOptions(
    dashPattern: [10, 5],
    strokeWidth: 2,
    padding: EdgeInsets.all(16),
  ),
  child: Text(
    'Rectangular Border',
    style: TextStyle(
      fontWeight: FontWeight.bold,
    ),
  ),
)
Dash Pattern

You can also specify the Dash Sequence by passing in an Array of Doubles

Example
RectDottedBorderOptions(
  dashPattern: [10, 5],
  strokeWidth: 2,
  padding: EdgeInsets.all(16),
)

The above code block will render a dashed border with the following pattern:

  • 10 pixel wide dash
  • 5 pixel wide space
Custom Path Border

You can also specify a customPath property and it will draw it for you using the provided dash pattern.

Example
DottedBorder(
  options: CustomPathDottedBorderOptions(
    padding: const EdgeInsets.all(8),
    color: Colors.purple,
    strokeWidth: 2,
    dashPattern: [10, 5],
    customPath: (size) => Path()
      ..moveTo(0, size.height)
      ..relativeLineTo(size.width, 0),
  ),
  child: const Text(
    'Custom Path Border',
    style: TextStyle(
      color: Colors.purple,
      fontWeight: FontWeight.bold,
    ),
  ),
)
Output

Flutter dotted border image

Credits

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

ランキング