• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

florent37/Flutter-ShapeOfView: Give a custom shape to any flutter widget, Materi ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

florent37/Flutter-ShapeOfView

开源软件地址(OpenSource Url):

https://github.com/florent37/Flutter-ShapeOfView

开源编程语言(OpenSource Language):

Dart 90.0%

开源软件介绍(OpenSource Introduction):

flutter_shape_of_view

Give a custom shape to any flutter widget, Material Design 2 ready

Download

https://pub.dev/packages/shape_of_view

dependencies:
  shape_of_view: 

Give a custom shape to any android view Useful for Material Design 2

screen screen screen

ShapeOfView(
  shape: YOUR_SHAPE,
  elevation: 4,
  height: 300, //height & width are optional
  child: ...
),

Use implemented shapes

ShapeOfView came with pre-created shapes :

Circle

screen

ShapeOfView(
  shape: CircleShape(
    borderColor: Colors.white, //optional
    borderWidth: 2, //optional
  ),
  child: ...

RoundRect

screen

ShapeOfView(
  shape: RoundRectShape(
     borderRadius: BorderRadius.circular(12),
     borderColor: Colors.white, //optional
     borderWidth: 2, //optional
  ),
  child: ...

ClipCorner

screen

ShapeOfView(
  shape: CutCornerShape(
     borderRadius: BorderRadius.circular(12);
  ),
  child: ...

Arc

screen

ShapeOfView(
  shape: ArcShape(
    direction: ArcDirection.Outside,
    height: 20,
    position: ArcPosition.Bottom
  ),
  child: ...
)

Diagonal

screen

ShapeOfView(
  elevation: 4,
  height: 300,
  shape: DiagonalShape(
    position: DiagonalPosition.Bottom,
    direction: DiagonalDirection.Right,
    angle: DiagonalAngle.deg(angle: 10)
  ),
  child: ...
)

Triangle

screen

ShapeOfView(
  shape: TriangleShape(
    percentBottom: 0.5,
    percentLeft: 0,
    percentRight: 0
  ),
  child: ...,
)

Bubble

screen

ShapeOfView(
  shape: BubbleShape(
    position: BubblePosition.Bottom,
    arrowPositionPercent: 0.5,
    borderRadius: 20,
    arrowHeight: 10,
    arrowWidth: 10
  ),
  child: ...,
)

Star

screen screen

ShapeOfView(
  shape: StarShape(
    noOfPoints: 5
  ),
  child: ...,
)

Polygon

screen

ShapeOfView(
  shape: PolygonShape(
    numberOfSides: 9
  ),
  child: ...,
)

Use a custom Shape

ShapeOfView(
  shape: CustomShape(
    builder: (rect) => Path()
        ..moveTo(0, 0)
        ..close()
  ),
  child: ...,
)

or extend Shape

class MyShape extends Shape {

  @override
  Path build({Rect rect, double scale}) {
    return Path()
       ..moveTo(0, 0)
       ..close();
  }

}

then

ShapeOfView(
  shape: MyShape(),
  child: ...,
)

Getting Started with Flutter

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

License

Copyright 2019 florent37, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
ChinaLHR/JianDou: 豆瓣Material Design风格的Android客户端发布时间:2022-08-18
下一篇:
cjus/epmd: Electron Preact Material Design发布时间:2022-08-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap