shape_of_view 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 88

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.0.1 #

  • TODO: Describe initial release.

example/README.md

flutter_shape_of_view_example #

Demonstrates how to use the flutter_shape_of_view plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

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

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  shape_of_view: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:shape_of_view/shape_of_view.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
76
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
88
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test