A Null safety fork of flutter_simple_sticker_view. Attach stickers on another image. Stickers can be applied, removed, moved, scaled and now also rotated. Export your created composition as image. This package supports null safety and comes with better documentation.

Overview

Stick It

Stick It is a fork of flutter_simple_sticker_view.

Attach stickers on another image. Stickers can be moved, scaled and now also rotated. Export your created composition as image. This package supports null safety and comes with better documentation.

Simplest Example Advanced Example

Getting Started

Add stick_it as a dependency in your pubspec.yaml file. You can also check the installing page. Check out the example page for an advanced example with background image picker, image export, image save and custom settings.

Usage

Import the library via

import 'package:stick_it/stick_it.dart';

Simplest Example

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

class SimplestExample extends StatelessWidget {
  const SimplestExample({Key? key}) : super(key: key);
  static String routeName = 'simplest-example';
  static String routeTitle = 'Simplest Example';
  final String _background =
      'https://images.unsplash.com/photo-1545147986-a9d6f2ab03b5?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=934&q=80';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(routeTitle),
      ),
      body: StickIt(
        /// The [StickIt] Class only requires two named parameters.
        ///
        /// [Widget] child - the child that the stickers should be placed upon.
        /// [List<Image>] stickerList - the list of stickers available to the user.
        ///
        /// StickIt supports a lot of styling related optional named parameters,
        /// that you can change and check out in the AdvancedExample. (tbd)
        child: Image.network(_background),
        stickerList: [
          Image.asset('assets/icons8-anubis-48.png'),
          Image.asset('assets/icons8-bt21-shooky-48.png'),
          Image.asset('assets/icons8-fire-48.png'),
          Image.asset('assets/icons8-jake-48.png'),
          Image.asset('assets/icons8-keiji-akaashi-48.png'),
          Image.asset('assets/icons8-mate-48.png'),
          Image.asset('assets/icons8-pagoda-48.png'),
          Image.asset('assets/icons8-spring-48.png'),
          Image.asset('assets/icons8-totoro-48.png'),
          Image.asset('assets/icons8-year-of-dragon-48.png'),
        ],
      ),
    );
  }
}

Supported Parameters

named parameter type required default description
child Widget yes Content you wish to place stickers upon
stickerList List < Image > yes List of sticker images that should be shown within the bottom panel. Those can be placed on top of your child Widget.
devicePixelRatio double no 3.0 The devices pixel ratio. See also: https://stackoverflow.com/questions/8785643/what-exactly-is-device-pixel-ratio
panelBackgroundColor Color no Colors.black Background color of the bottom panel.
panelHeight double no 200.0 Height of the bottom panel.
panelStickerBackgroundColor Color no Colors.white10 Background color of the container stickers are placed within.
panelStickerCrossAxisCount int no 4 Defines how many stickers are placed within one row of the grid.
panelStickerAspectRatio double no 1.0 Ratio of the cross-axis to the main-axis extent of each child.
stickerMaxScale double no 2.0 Maximal scaling ratio for your stickers. E.g 2 will allow the sticker to be twice as big!
stickerMinScale double no 0.5 Minimal scaling ratio for your stickers.E.g 0.5 will allow the sticker to be half as big at minimum!
stickerRotatable bool no true Controls whether your stickers should be rotatable, while the scaling event is active.Set to false, if you don't want rotation.
stickerSize double no 100.0 Size of the [Rect] the stickers are on when placed within the [Stack]. Setting this value up will only increase the [Rect] size. So, to display them bigger when placing on the [child] you will have to set something like fit: Boxfit.cover on the image you are providing in the [stickerList].
viewPort Size no Size(constraints.maxWidth, constraints.maxHeight) [Size] of the viewport that is provided.You don't have to set this manually, it will take the available space per default.

Supported Methods

function name returns description
exportImage() Future Creates an [Uint8List] out of your composition, that you can use to save as [Image].Before that it will clear all selections, so they don't appear on the new creation.
You might also like...

Cozy app, with implemented null safety

cozy A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

Dec 28, 2021

Aris keyunique - Use the Flutter Unique Key To Preserve the state of Stateful Widgets if they moved around in the Widget tree

Aris keyunique - Use the Flutter Unique Key To Preserve the state of Stateful Widgets if they moved around in the Widget tree

Flutter Tutorial - Flutter Keys - Unique Key Use the Flutter Unique Key To Prese

Dec 29, 2021

Academic master is E-learning app where students can share their doubts wiith their peers they can chat and also they can find their notes

Academic master is E-learning app where students can share their doubts wiith their peers they can chat and also they can find their notes

Academic Master is E-learning App. Features:- 1) You can post real Post query in Images and video formates. 2) We will Provide notes,books and previou

Dec 14, 2022

Custom style-dictionary transforms and formats to generate Flutter resources from a Figma Design Token plugin export..

style-dictionary-figma-flutter An extension to style-dictionary to support more custom types with Flutter as target platform. It supports the custom t

Dec 30, 2022

An implementation of the behavioral composition pattern for Flame. Built by Very Good Ventures 🦄

An implementation of the behavioral composition pattern for Flame. Built by Very Good Ventures 🦄

Flame Behaviors Developed with 💙 by Very Good Ventures 🦄 An implementation of the behavioral composition pattern for Flame. Installation 💻 flutter

Jan 2, 2023

A fork/modification of flutter epub view package

A fork/modification of flutter epub view package

epub_view Pure flutter widget for view EPUB documents on all platforms. Based on epub package. Render with flutter widgets (not native view) on any pl

Dec 28, 2021

Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

nfc_in_flutter NFC in Flutter is a plugin for reading and writing NFC tags in Flutter. It works on both Android and iOS with a simple stream interface

Sep 28, 2022
Comments
  • Problems with setstate

    Problems with setstate

    I try to change the panelHeight and update the screen by setstate, but the StickIt widget seems to be corrupt as soon as I use setstate

    Error after using after setstate: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Null check operator used on a null value E/flutter (18051): #0 _StickItState._exportImage (package:stick_it/src/stick_it.dart:192:56) E/flutter (18051): #1 StickIt.exportImage (package:stick_it/src/stick_it.dart:94:51)

    code:

      StickIt _stickIt;
      bool showStickerBar=true;
    
      @override
      Widget build(BuildContext context) {
        
        _stickIt = StickIt(
          child: Image.file(widget.image, fit: BoxFit.cover),
          panelHeight:
          showStickerBar==true
              ? 200
              : 0,
          stickerList: [
            Image.asset('assets/stickers/test1.png'),
            Image.asset('assets/stickers/test2.png'),
          ],
        );
    
        return new Scaffold(
          appBar: PreferredSize(
            preferredSize: Size(double.infinity, 80),
            child: Stack(
              children: <Widget>[
                      InkWell(
                        onTap: () async {
    
                          final imageInUnit8List = await _stickIt.exportImage();
                          final Directory tempDir = await getTemporaryDirectory();
                          File imageWithSticker = await File('${tempDir.path}/image.png').create();
                          imageWithSticker.writeAsBytesSync(imageInUnit8List);
    
                        },
                        child: Text('next',
                          style: TextStyle(
                            fontSize: 17,
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
          body: Center(
            child: Container(
              child: _stickIt,
            ),
          ),
          floatingActionButton:
                FloatingActionButton(
                  onPressed: () {
                    if (showStickerBar==true){
                      setState(() {
                        showStickerBar = false;
                      });
                    }else if (showStickerBar==false){
                      setState(() {
                        showStickerBar = true;
                      });
                    }
                  },
                  child: new Icon(
                    Icons.emoji_emotions_outlined,
                  ),
                ),
    
          
    

    _stickIt , I do not use null safety (unfortunately that is not possible)

    thanks for help

    bug 
    opened by Bernhard602 4
  • set the viewport to a fixed size

    set the viewport to a fixed size

    is there a way to set the viewport to a fixed size, instead of taking all of the available space? When i use BoxFit.fitHeight the exported picture has a white area left and right, because stickit exports the entire screen width, but the image doesn't fill the complete width.

    I tried it with: viewport: const Size(300, 600), But it has no effect.

    My code:

         _stickIt = StickIt(
              viewport: const Size(300, 600),
              key: UniqueKey(),
              child: Image.file(widget.image!, 
                  fit: BoxFit.fitHeight
              ),
              panelBackgroundColor: appColorBlack,
              panelHeight:200,
              stickerList: [
                Image.asset('assets/stickers/1.webp'),
                Image.asset('assets/stickers/2.webp'),
                Image.asset('assets/stickers/3.webp'),
              ],
            );
    

    thanks

    opened by Bernhard602 0
  • Extend example documentation

    Extend example documentation

    Add documentation to the package advanced example in regards to: why and when a Key is required.

    • [ ] Adjust example.md
    • [ ] Adjust advanced_example.dart

    Reference issue: #1

    documentation 
    opened by NicolasDurant 0
Releases(v.1.0.0+2)
Owner
zzvbm
Maverick, tryhard, passionate coder, average chess player, cardistry pleb, italian food lover and worldtraveller, who learned two dead languages.
zzvbm
Custom dropdown widget allows to add highly customizable widget in your projects with proper open and close animations and also comes with form required validation.

Custom Dropdown Custom Dropdown package lets you add customizable animated dropdown widget. Features Lots of properties to use and customize dropdown

Abdullah Chauhan 22 Dec 29, 2022
A fully functional Movies Application built with Flutter. The application built with null safety and clean architecture, also uses OMDB API for fetching movies in the search item

Cinema DB Project Details This project uses null safety feature Project uses clean code architecture (Uncle Bob's Architecture) Project can run on bot

Dhruvam 2 Oct 1, 2022
Todo is an Simple Task Management App coded using Dart which is a peogramming language for Flutter SDK(2.5) supports Null Safety 📑🚩

Todo ?? ?? ?? Introduction Todo is an Simple Task Management App coded using Dart which is a peogramming language for Flutter SDK(2.5) supports Null S

navee-ramesh 6 Nov 5, 2022
A widget that shows an image which can be scaled and dragged using gestures.

[DISCONTINUED] - 24.05.2021 While this widget was useful in the early days of Flutter, the Flutter team introduced an own way to zoom and pan, see Int

EPNW 15 May 3, 2022
camilo velandia 69 Dec 30, 2022
Yet another Todo app, now using Flutter (with ScopedModel)

Flutter Todo Yet another Todo app, now using Flutter. Getting Started This Todo app is implemented using Flutter (with Scoped Model for state manageme

Tuan Nguyen 107 Jan 4, 2023
Flutter application for latest news by top newspapers . And allow for share articles with friends. Now available in night mode. Also landscape mode is available

Breaking News Latest news for almost 55 country. Feature of saving article and search ariticles. Used API https://newsapi.org/ Note: if data is not ge

null 7 Oct 24, 2022
Scale the entire UI design proportionally. Button, image, font, everything is scaled automatically

Scale the entire UI design proportionally. Button, image, font, everything is scaled automatically. Before: 250x250 square is the same size across dev

Wildcard 3 Sep 25, 2022
This is a view pager provides carousel effect and dismissal animation when page was removed.

This is a view pager provides carousel effect and dismissal animation when page was removed. Features Carousel effect Horizontal Vertical Dismissal an

Zhe-Yi, Zhu 4 Dec 22, 2022
A TabBarController that is easy to use for flutter developers. 🥰 It supports various styles of page navigation, and you can also use it to customize your favorite styles. 🍻🍻

easy_tab_controller A user-friendly TabBarController widget for flutter developer. Getting Started This project is a starting point for a Flutter plug

圆号本昊 3 May 26, 2022