FLUTTER ECOSYSTEM

majlindavdylaj/lindi_sticker_widget

Lindi Sticker Widget 是一个 Flutter 插件,可用于翻转、旋转、调整大小、移动、删除和编辑任何小部件。

lindi_sticker_widget 项目封面
Stars
21
Forks
13
最近推送(UTC)
2025年7月29日
项目状态
未归档
Majlind Avdylaj GitHub avatar
GITHUB User

Majlind Avdylaj ↗

Flutter Developer

Kosovo
语言DartC++CMakeSwiftCHTMLKotlinObjective-C

技术话题

此仓库发布的插件

使用的依赖

依赖清单 4 项

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

lindi_sticker_widget

Features

  Rotate
  Resize
  Move
  Layer Update (Change Stack position)
  Edit
  Delete
  Flip
  Lock

Getting started

pub package

Add this to dependencies in your app's pubspec.yaml

lindi_sticker_widget : latest_version

Usage

Sample code to integrate can be found in example/lib/main.dart.

LindiController

Customize the controller as you like!

LindiController controller = LindiController(
  borderColor: Colors.white,
  icons: [
    LindiStickerIcon(
        icon: Icons.done,
        alignment: Alignment.topRight,
        onTap: () {
          controller.selectedWidget!.done();
        }),
    LindiStickerIcon(
        icon: Icons.lock_open,
        lockedIcon: Icons.lock,
        alignment: Alignment.topCenter,
        type: IconType.lock,
        onTap: () {
          controller.selectedWidget!.lock();
        }),
    LindiStickerIcon(
        icon: Icons.close,
        alignment: Alignment.topLeft,
        onTap: () {
          controller.selectedWidget!.delete();
        }),
    LindiStickerIcon(
        icon: Icons.edit,
        alignment: Alignment.centerLeft,
        onTap: () {
          controller.selectedWidget!
              .edit(const Icon(Icons.star, size: 50, color: Colors.yellow));
        }),
    LindiStickerIcon(
        icon: Icons.layers,
        alignment: Alignment.centerRight,
        onTap: () {
          controller.selectedWidget!.stack();
        }),
    LindiStickerIcon(
        icon: Icons.flip,
        alignment: Alignment.bottomLeft,
        onTap: () {
          controller.selectedWidget!.flip();
        }),
    LindiStickerIcon(
        icon: Icons.crop_free,
        alignment: Alignment.bottomRight,
        type: IconType.resize
    ),
  ],
);
Integrate LindiStickerWidget
LindiStickerWidget(
    controller: controller,
    child: SizedBox(
        width: double.infinity,
        height: double.infinity,
        child: Image.network('https://picsum.photos/200/300', fit: BoxFit.cover)
    ),
)
Add Widget to LindiStickerWidget
controller.add(
    Text('Hello World')
);
Get index of selected widget
controller.onPositionChange((index) {
  print("widgets size: ${controller.widgets.length}, current index: $index");
});
Save LindiStickerWidget as Uint8List
Uint8List? image = await controller.saveAsUint8List();

Screenshots

Image Image

:heart: Found this project useful?

If you found this project useful, then please consider giving it a :star: on Github and sharing it with your friends via social media.