flutter_simple_sticker_view
一個用於在圖像上附加貼紙的新Flutter外掛專案,依您想要的方式進行。附加的圖像也可以匯出。
Flutter 插件,可將貼紙附加至影像,隨心所欲。可縮放、可移動。附加的影像也可匯出。
{"sdk":"flutter"}^2.0.8{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
Flutter plugin for attach stickers on image, as you want. scalable, movable. attached image can also be export.
https://img.shields.io/pub/v/flutter_simple_sticker_view.svg https://img.shields.io/github/license/myriky/flutter_simple_sticker_viewhttps://user-images.githubusercontent.com/581861/69323565-52a84100-0c8a-11ea-974e-f2887d8755b2.gifhttps://user-images.githubusercontent.com/581861/69323562-520faa80-0c8a-11ea-95f1-625314339a56.gif
Add flutter_simple_sticker_view as a dependency in your pubspec.yaml file.
Check out the example directory for a sample app.
Import the library via
import 'package:flutter_simple_sticker_view/flutter_simple_sticker_view.dart';
FlutterSimpleStickerView(
Container(
child: Center(child: Text("Hello, World!")),
),
[
Image.asset("assets/icons8-super-mario-50.png"),
Image.asset("assets/icons8-superman-50.png"),
Image.asset("assets/icons8-captain-america-50.png"),
Image.asset("assets/icons8-avengers-50.png"),
Image.asset("assets/icons8-iron-man-50.png"),
Image.asset("assets/icons8-batman-50.png"),
Image.asset("assets/icons8-thor-50.png"),
Image.asset("assets/icons8-venom-head-50.png"),
Image.asset("assets/icons8-homer-simpson-50.png"),
Image.asset("assets/icons8-spider-man-head-50.png"),
Image.asset("assets/icons8-harry-potter-50.png"),
Image.asset("assets/icons8-genie-lamp-50.png"),
Image.asset("assets/icons8-cyborg-50.png"),
Image.asset("assets/icons8-one-ring-50.png"),
Image.network("https://img.icons8.com/emoji/2x/wolf-emoji.png"),
Image.network("https://img.icons8.com/emoji/2x/tiger-emoji.png"),
],
)
var _stickerView = FlutterSimpleStickerView(...);
Uint8List image = await _stickerView.exportImage();
See the example :)
stickerSize: default sticker size. width/height. (default is 100.0)
stickerMaxScale: maximum scale of sticker. (default is 2.0)
stickerMinScale: minimum scalof of sticker (default is 0.5)
panelHeight: sticker panel height. (default is 200)
panelBackgroundColor: background color of sticker panel.
panelStickerBackgroundColor: background color of sticker in panel.
panelStickercrossAxisCount: axis count of sticker (default is 4)
panelStickerAspectRatio: ratio of sticker in sticker panel. (default is 1.0)
devicePixelRatio: device pixel ratio for exporting image. (eg. MediaQuery.of(context).devicePixelRatio)
enjoy! 💃