FLUTTER ECOSYSTEM

ajilo297/Flutter-Dotted-Border

위젯 주변에 쉽게 점선 테두리를 추가할 수 있는 Flutter 패키지

Flutter-점선 테두리 프로젝트 이미지
Stars
305
Forks
67
최근 푸시(UTC)
2025. 6. 29.
프로젝트 상태
활성
Ajil Oommen GitHub avatar
GITHUB User

Ajil Oommen ↗

Transport Exchange GroupKochi, Kerala
언어Dart

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

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