FLUTTER ECOSYSTEM

devmuaz/coupon-uikit

一個簡單的套件,提供一些小部件和自訂剪裁器,用於實現優惠券卡的形狀。

優惠券-uikit 專案封面
Stars
38
Forks
6
最近推送(UTC)
2026年1月18日
專案狀態
未封存
AbdulMuaz Aqeel GitHub avatar
GITHUB User

AbdulMuaz Aqeel ↗

Sr. Software Engineer

@talabateyIraq, Baghdad官方網站 ↗
語言DartSwiftKotlinObjective-C

技術主題

使用的依賴

依賴清單 3 項
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^6.0.0

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Coupon UI Kit

pub package likes pub points

A Flutter package that provides widgets and custom clippers to implement coupon card shapes with beautiful designs.

Features

  • Flexible Design: Create horizontal or vertical coupon cards
  • Customizable: Control curve position, radius, border radius, and more
  • Multiple Styles: Support for shadows, borders, gradients, and custom decorations
  • Custom Clippers: Use CouponClipper to create your own custom coupon widgets
  • Well Documented: Comprehensive documentation and examples

Screenshots

Basic Coupon Cards

Basic Coupon Cards
Basic Coupon Cards 2

Basic Coupon Cards 2
Rounded Coupon Cards

Rounded Coupon Cards
Bordered Coupon Cards

Bordered Coupon Cards
Vertical Coupon Cards

Vertical Coupon Cards
Gradient Coupon Cards

Gradient Coupon Cards
Custom Coupon Cards

Custom Styled Coupons

Installation

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

dependencies:
  coupon_uikit: ^latest

Then run:

flutter pub get

Usage

There are two ways to get started:

1. Using the CouponCard Widget

The easiest way is to use the built-in CouponCard widget:

import 'package:coupon_uikit/coupon_uikit.dart';

CouponCard(
  height: 150,
  backgroundColor: Colors.blue,
  curveAxis: Axis.vertical,
  firstChild: Container(
    color: Colors.red,
    child: Center(child: Text('23% OFF')),
  ),
  secondChild: Container(
    padding: EdgeInsets.all(16),
    child: Column(
      children: [
        Text('Coupon Code'),
        Text('FREESALES', style: TextStyle(fontSize: 24)),
      ],
    ),
  ),
)
2. Using the CouponClipper Class

If you want more control, you can use the CouponClipper to create your own custom widget:

import 'package:coupon_uikit/coupon_uikit.dart';

ClipPath(
  clipper: CouponClipper(
    borderRadius: 8,
    curveRadius: 20,
    curvePosition: 100,
    curveAxis: Axis.horizontal,
  ),
  child: Container(
    width: 350,
    height: 400,
    color: Colors.purple,
    // Your custom content here
  ),
)

Properties

CouponCard
Property Type Default Description
firstChild Widget required The first section of the coupon card
secondChild Widget required The second section of the coupon card
width double? null Width of the coupon card
height double 150 Height of the coupon card
borderRadius double 8 Border radius for corners
curveRadius double 20 Size of the cutout curve
curvePosition double 100 Position of the curve
curveAxis Axis Axis.horizontal Direction of the curve (horizontal/vertical)
clockwise bool false Border radius direction
backgroundColor Color? null Background color
decoration Decoration? null Custom decoration (gradient, etc.)
shadow Shadow? null Shadow effect
border BorderSide? null Border around the coupon

Example

Check out the example directory for a complete showcase of all available widgets and styles.

Medium Articles

You can read articles about Flutter development on my devmuaz Medium account.

Contributions & Support

Issues and pull requests are always welcome 😄

If you find this package useful and like it, please:

  • Give it a like ❤️ on pub.dev
  • Star the repo ⭐️ on GitHub

License

MIT