v1.0.2
polygon_clipper
一個將 Widget 裁剪為多邊形形狀的外掛程式。適用於任何類型的 Widget。
67喜歡 43近 30 天下載30Pub 分數
平台暫無資料
使用多邊形形狀的 Flutter 自定義裁剪器
{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
A Flutter plugin to create views using regular polygon shapes (e.g. Pentagons and Hexagons).
Based on the polygon_clipper package by leonardocaldas.
Example1 Example2
Add this to your package's pubspec.yaml file:
dependencies:
flutter_polygon: ^0.2.0
Use the ClipPolygon widget to clip a child widget.
import 'package:flutter_polygon/flutter_polygon.dart';
ClipPolygon(
sides: 6,
borderRadius: 5.0, // Defaults to 0.0 degrees
rotate: 90.0, // Defaults to 0.0 degrees
boxShadows: [
PolygonBoxShadow(color: Colors.black, elevation: 1.0),
PolygonBoxShadow(color: Colors.grey, elevation: 5.0)
],
child: Container(color: Colors.black),
);
Use the PolygonBorder shape with your favorites widgets!
import 'package:flutter_polygon/flutter_polygon.dart';
FloatingActionButton(
shape: PolygonBorder(
sides: 6,
borderRadius: 5.0, // Defaults to 0.0 degrees
rotate: 30.0, // Defaults to 0.0 degrees
border: BorderSide(color: Colors.red, width: 2.0), // Defaults to BorderSide.none
),
onPressed: () {},
child: Icon(Icons.star),
),
Other widgets:
TextButton, ElevatedButton, ...ContainerChipIf you find an issue with this package, please open an issue on github.
If you wish to contribute to this project, I encourage you to open a pull request.
Based on the polygon_clipper package by leonardocaldas.