Flutter

demo

Curve Clipper

pub package

Use curve_clipper package

  • In applications that have innovation in design
  • Use in modern designs
  • Cutting widgets for the beauty and uniqueness of the design

🎛 📱

Install Package

Add the following line to your pubspec.yaml under dependencies:

dependencies:
  curve_clipper: ^0.1.0

Then run:

flutter pub get

Usage

Import it

import 'package:curve_clipper/curve_clipper.dart';


wavy

CustomClipperWidget(
  mode: ClipperMode.wavy,
  heightFromOrigin: 160,
  child: Container(
    width: double.infinity,
    height: 200,
    decoration: const BoxDecoration(
      color: Colors.cyan,
    ),
  ),
),


wavy-sin

CustomClipperWidget(
  mode: ClipperMode.wavySin,
  heightFromOrigin: 100,
  child: Container(
    width: double.infinity,
    height: 200,
    decoration: const BoxDecoration(
      color: Colors.cyan,
    ),
  ),
),


wavy-curtain

CustomClipperWidget(
  mode: ClipperMode.wavyCurtain,
  heightFromOrigin: 180,
  curvePoint: 80,
  child: Container(
    width: double.infinity,
    height: 200,
    decoration: const BoxDecoration(
      color: Colors.cyan,
    ),
  ),
),
  • curvePoint is the point in the center that has the lowest height
  • Its value must be greater than zero and less than heightFromOrigin


convex

CustomClipperWidget(
  mode: ClipperMode.convex,
  heightFromOrigin: 120,
  child: Container(
    width: double.infinity,
    height: 200,
    decoration: const  BoxDecoration(
      color: Colors.cyan,
    ),
  ),
),


concave

CustomClipperWidget(
   mode: ClipperMode.concave,
   heightFromOrigin: 180,
   curvePoint: 10,
   child: Container(
     width: double.infinity,
     height: 200,
     decoration: const  BoxDecoration(
        color: Colors.cyan,
     ),
   ),
),
  • curvePoint is the point in the center that has the lowest height
  • Its value must be greater than zero and less than heightFromOrigin


by Shervin Hassanzadeh

Contact me at

linkedin Email telegram github stackoverflow

Libraries

curve_clipper
Curve Clipper Library Documentation