superellipse_shape 0.1.2 copy "superellipse_shape: ^0.1.2" to clipboard
superellipse_shape: ^0.1.2 copied to clipboard

outdated

A package for creating superellipse shapes in flutter. A superellipse is used to make smooth rounded edges on a widget, smoother than border-radius.

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.'),
            ),
          ),
        ),
      ),
    );

  }

}

class SuperellipseCard extends StatelessWidget {

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

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

  @override
  Widget build(BuildContext context) {

    return Material(
      clipBehavior: Clip.antiAlias,

      shape: SuperellipseShape(5.0),
      
      color: color ?? Colors.white,
      shadowColor: color ?? Colors.black38,
      elevation: elevation ?? 1.0,
      child: child,
    );

  }

}
45
likes
0
pub points
86%
popularity

Publisher

unverified uploader

A package for creating superellipse shapes in flutter. A superellipse is used to make smooth rounded edges on a widget, smoother than border-radius.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on superellipse_shape