image_stickers 0.0.2 copy "image_stickers: ^0.0.2" to clipboard
image_stickers: ^0.0.2 copied to clipboard

outdated

Plugin to apply image stickers to the background image. Drag, resize, rotate stickers.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:image_stickers/image_stickers.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  List<UISticker> stickers = [];

  @override
  void initState() {
    stickers.add(createSticker(0));
  }

  UISticker createSticker(int index){
    return UISticker(
        imageProvider: const AssetImage("assets/sticker.png"),
        x: 100 + 100.0 * index,
        y: 360,
        editable: true);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          ImageStickers(
            backgroundImage: const AssetImage("assets/car.png"),
            stickerList: stickers,
          ),
          TextButton(onPressed: (){
            setState(() {
              stickers.add(createSticker(stickers.length));
            });
          }, child: const Text("Add sticker"))
        ],
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
16
likes
0
points
62
downloads

Publisher

verified publisherkoallider.me

Weekly Downloads

Plugin to apply image stickers to the background image. Drag, resize, rotate stickers.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, image

More

Packages that depend on image_stickers