패키지, 저장소 및 앱 카테고리 검색

blobs 표지
패키지 상세v2.0.0

blobs

아름다운 블롭 생성 - 고정/임의의 블롭 생성, 애니메이션, svgs 등

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2.3천
좋아요
363
Pub 점수
140

패키지 설치

flutter pub add blobs

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Blobs는 여러 플랫폼에서 시각적으로 매력적이고 사용자 정의 가능한 블롭(유기적이고 유동적인 형태)을 생성할 수 있도록 해주는 Flutter 패키지입니다. 고정 및 무작위 블롭 생성, 부드러운 애니메이션, 디자인에 사용하기 위한 SVG 내보내기를 지원합니다. 배경, 일러스트 또는 장식 요소에 적합하며, 앱에 동적이고 예술적인 형태를 쉽게 통합할 수 있게 해줍니다. 이 패키지는 가볍고 Android, iOS, Web, macOS, Windows, Linux에서 원활하게 작동합니다.

사용 사례

  • 앱 배경 디자인
  • 애니메이션 UI 요소
  • 장식적인 일러스트레이션
  • SVG 기반 그래픽
  • 인터랙티브 예술 컴포넌트
  • 모바일 및 웹 앱 시각 요소

주요 기능

  • 고정 및 랜덤 블롭 생성
  • 부드러운 애니메이션
  • SVG 내보내기 지원
  • 크로스 플랫폼 호환성
  • 사용자 정의 가능한 모양 매개변수
  • Flutter 위젯과의 간편한 통합

적합한 대상

  • 창의적인 요소를 찾는 UI 디자이너
  • 예술적 인터페이스를 구축하는 개발자
  • 유기적 형태가 필요한 프로젝트
  • 시각적으로 집약적인 레이아웃을 가진 앱
  • 인터랙티브 디자인 프로토타이핑
  • 크로스플랫폼 앱 개발

고려 사항

  • 많은 애니메이션 블롭으로 인한 성능 영향
  • 정밀 기하학에 대한 제어가 제한됨
  • 기능적 사용보다는 장식적인 사용에 적합
  • 저사양 기기에서 최적의 렌더링을 위해 조정이 필요할 수 있습니다
  • 복잡한 벡터 연산에 적합하지 않음

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.


Blobs

Create beautiful blob shapes with minimal code.

Features
  • Generate blob in any size

  • Control the randomness and complexity

  • Animate the blob

  • Set ID for a fixed blob

  • Shuffle between the fixed blobs

  • Loop animation

  • Blob clipper

  • Get SVG path

  • Debug, Child widget, controller and few more

 

 

Contents

 

Widgets

There are four widgets,

  • Blob.random() - Generate random blobs

  • Blob.animatedRandom() - Generate blobs and animate the shape change

  • Blob.fromID() - Use one or more ID's for fixed blobs

  • Blob.animatedFromID() - Animate the shape change

     

basic_blobs

 

⚙️ Blob Size

Size of the blob (mandatory).


Blob.random(size:200),

 

⚙️ Customise shape

edgesCount is the nodes count. More the value, more the complexity. Minimum is 3 and max is 300. But for cool shapes you can stick between 3-20. Default is 7

minGrowth is the minimum size of the blob. Smaller the value, more the randomness. Value should be an interger between 2-9. Default is 4.


Blob.random(
 size:200,
 edgesCount:5,
 minGrowth:4,
),

 

⚙️ Controller

You can use BlobController, if you want to change the shape programatically. As o now it has only one method called change(). When you call this, the shape will be changed and returns some useful info of the blob (BlobData).


BlobController blobCtrl =  BlobController();


Blob.random(
 size:200,
 edgesCount:5,
 minGrowth:4,
 controller: blobCtrl,
),


BlobData blobData = blobCtrl.change();

 

⚙️ Fixed shapes

In most scenarios you wanted a same blob to be rendered every time. This can be achieved using ID. It is just a plain string contains the shape data.

You can get the ID from the blobData from the controller's change() method. Or you can also generate blobs and get ID from https://blobs.app/

ID looks like 5-6-43178

id option accepts one or multiple id's. If it has only one id, then it will be a fixed blob.


Blob.fromID(
 size:200,
 id:['X-Y-ZZZZ'],
 controller: blobCtrl,
),

If you provide multiple id's, then it will show each one in order on changing.


Blob.fromID(
 size:200,
 id:['X-Y-ZZZZ','X-Y-ZZZZ','X-Y-ZZZZ'],
 controller: blobCtrl
),

 

⚙️ Styles

You can change the color, add gradient, make outlined using BlobStyles()


Blob.random(
 size:200,
 styles:  BlobStyles(
   color:  Colors.green,
   fillType:  BlobFillType.stroke,
   gradient:  LinearGradient(),
   strokeWidth:3,
 ),
),

Gradient can be Linear or Radial. LinearGradient will look like this,


LinearGradient(colors: [Colors.red, Colors.green])
.createShader(Rect.fromLTRB(0, 0, 300, 300))

style_gradient style_custom_color style_outline

 

⚙️ Child Widget

You can use child property to display a child which looks like the blob as background.


Blob.random(
 size:200,
 child:  Text('I am a child!'),
),

blobs_with_child

 

⚙️ Animating the blobs

Whenever the blobs are changing, this widget will animate the shape change.


Blob.animatedRandom(
 size:200,
 edgesCount:5,
 minGrowth:4,
 duration:  Duration(milliseconds:500),
),

duration is optional. Default is 500 milliseconds.

animated_basic

 

⚙️ Change shapes automatically

When you want to change the shapes automatically you can set loop property to true.


Blob.animatedRandom(
 size:200,
 edgesCount:5,
 minGrowth:4,
 loop:  true,
),

 

⚙️ Animate Fixed shapes

If you use loop in Blob.fromAnimatedID() widget, it will change shapes within the provided blobs.


Blob.animatedFromID(
 size:200,
 id:['X-Y-ZZZZ','X-Y-ZZZZ','X-Y-ZZZZ'],
 loop:  true,
),

animated_fixed_blobs

 

⚙️ Debug

When you set debug to true, it will show you circles and lines that connect the blob points.


Blob.random(
 size:200,
 debug:  true,
),

debug_blob

 

Clipper

Sometime you might want to clip the widget by blob shape. In such cases you can use BlobClipper(). You can either provide id or edgesCount and minGrowth options.


Container(
 child:  ClipPath(
  clipper: BlobClipper(<OPTIONS>),
  child: Image.network("https://bit.ly/2nirIxg"),
 ),
)

clipper

 

Service

Blobs shape are created by BlobGenerator(). Both widgets and clipper uses this internally to create the shape and then it is painted to canvas. This will return BlobData.


BlobData blobData =  BlobGenerator(
 edgesCount:  7,
 minGrowth:  4,
 size:  Size(30, 30),
 id:  null,
).generate();

 

ℹ️ BlobData

It is the raw data, which contains the path definitions, coordinates and other basic info about the blob.


BlobData(
 dots,
 innerRad,
 svgPath,
 coords,
 id,
 edgesCount,
 minGrowth,
 size,
 originalSize,
)

 

📐SVG

BlobData contains svgPath info. It is just a path string which will look like this,

M326.0,251.5Q282.0,303.0,226.5,315.0Q171.0,327.0,118.5,296.0Q66.0,265.0,90.0,211.5Q114.0,158.0,145.0,126.0Q176.0,94.0,228.5,96.0Q281.0,98.0,325.5,149.0Q370.0,200.0,326.0,251.5Z

from this you can easily create SVG like


<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
 <path fill="#474787" d="M326.0,251.5Q282.0,303.0,226.5,315.0Q171.0,327.0,118.5,296.0Q66.0,265.0,90.0,211.5Q114.0,158.0,145.0,126.0Q176.0,94.0,228.5,96.0Q281.0,98.0,325.5,149.0Q370.0,200.0,326.0,251.5Z" />
</svg>

Inspirations

We can create cool visual elements with blobs. Here's a few things that came to my mind.

ins#1 ins#2 #ins3

License

This project is licensed under MIT.

Contribution and issue

Any kind of contributions are welcome :)

For any issues and suggestions please create a issue card in Github repository

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.