superellipse_shape 0.1.5

Superellipse Shape #

Superellipses in flutter!

A package for creating superellipse shapes in flutter.

class SuperellipseDemo extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    
    return Material(
      color: Colors.blueAccent[400],
      shape: SuperellipseShape(
        borderRadius: BorderRadius.circular(28),
      ), // SuperellipseShape
      child: Container(
        width: 100.0,
        height: 100.0,
      ), // Container
    ); // Material

  }

}

Changelog #

0.1.4 - 2019-01-08 #

Added #

  • Added details to example and readme code examples.
  • Added small example to superellipse_shape.dart class documentation.

Changed #

  • Changed the way the border-radius of the shape is controlled. The class now uses BorderRadiusGeometry which also allows for control over individual corners.
  • Changed all examples and tests to be up-to-date with the new usage with borderRadius.

Fixed #

  • Fixed testing on old n property.

0.1.3 - 2019-01-07 #

Changed #

  • Changed the way the superellipse is calculated in in order to look more even on shapes that aren't completely square.
  • Edited the examples to reflect changes in how the shape is calculated.
  • Changed the name of the property n to the more meaningful superRadius.

0.1.0 - 2019-01-03 #

Added #

  • Proper example of how this package can be used.

Changed #

  • Package description.

example/main.dart

import 'package:flutter/material.dart';
import 'package:superellipse_shape/superellipse_shape.dart';

void main() => runApp(ExampleApp());

class ExampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: SuperellipseCard(
            child: Padding(
              padding: EdgeInsets.all(18.0),
              child: Text('This is a nice, rounded card.'),
            ), // Padding
          ), // SuperellipseCard
        ), // Center
      ), // Scaffold
    ); // MaterialApp
  }
}

class SuperellipseCard extends StatelessWidget {
  SuperellipseCard({
    this.color,
    this.child,
    this.elevation,
  });

  final Color color;
  final Widget child;
  final double elevation;

  @override
  Widget build(BuildContext context) {
    return Material(
      clipBehavior: Clip.antiAlias,
      shape: SuperellipseShape(
        borderRadius: BorderRadius.circular(28.0),
      ), // SuperellipseShape
      color: color ?? Colors.white,
      shadowColor: color ?? Colors.black38,
      elevation: elevation ?? 1.0,
      child: child,
    ); // Material
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  superellipse_shape: ^0.1.5

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:superellipse_shape/superellipse_shape.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
74
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]
87
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test

Admin