stack_art_board

Creator: coderz1093

Last updated:

0 purchases

stack_art_board Image
stack_art_board Images

Languages

Categories

Add to Cart

Description:

stack art board

Stack Art Board #
A Flutter package consisting of stacks that allows adding any widgets, and enables editing, deleting, and changing the order of layers.




For a more throughout example see the example.
video

How to Use #
Getting started #
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
...
stack_art_board: <latest_version>
copied to clipboard
In your library add the following import:
import 'package:stack_art_board/stack_art_board.dart';
copied to clipboard
For help getting started with Flutter, view the online documentation.
Initialize a StackArtboard #
import 'package:stack_art_board/stack_art_board.dart';

final StackArtBoardController controller = StackArtBoardController();

StackArtBoard(
stackArtBoardKey: UniqueKey(),
controller: controller,
artBoardConfig: ArtBoardConfig(
containerSize: const Size(300, 300),
artBoardSize: const Size(3000, 3000),
toolIconWidth: 20,
borderWidth: 5,
borderColor: Colors.black,
rotateWidget: Container(color: Colors.orange),
deleteWidget: Container(color: Colors.purple),
),
background: Container(color: Colors.green),
),
copied to clipboard
Add a custom Widget #
controller.add(
CustomCanvasItem(
child: Container(
color: Colors.red,
child: const Center(
child: Text('text'),
),
),
canvasConfig: CanvasConfig(
size: const Size(600, 600),
transform: Matrix4.identity(),
allowUserInteraction: true,
),
),
);
copied to clipboard
Add an Image widget with the ability to penetrate click events through transparent areas of the image. #
final ByteData data = await rootBundle.load('assets/image.png');
final imageBytes = data.buffer.asUint8List();
final image = img_lib.decodeImage(imageBytes);
if (image == null) return;
controller.add(
TransparentBgImageCanvasItem(
image: image,
imageBytes: imageBytes,
canvasConfig: CanvasConfig(
size: Size(image.width.toDouble(), image.height.toDouble()),
transform: Matrix4.identity(),
allowUserInteraction: true,
),
),
);
copied to clipboard
All canvas operations #
void add<T extends CanvasItem>(T item)
copied to clipboard
void insert<T extends CanvasItem>(T item, int index)
copied to clipboard
void remove(Key key)
copied to clipboard
void removeExcept(Key key)
copied to clipboard
bool contain(Key key)
copied to clipboard
void clear()
copied to clipboard
void moveToTop()
copied to clipboard
void moveToBottom()
copied to clipboard
void move(int oldIndex, int newIndex)
copied to clipboard
void reset()
copied to clipboard
void dispose()
copied to clipboard

Sponsoring #
I'm working on my packages on my free-time, but I don't have as much time as I would. If this package or any other package I created is helping you, please consider to sponsor me so that I can take time to read the issues, fix bugs, merge pull requests and add features to these packages.

Contributions #
Feel free to contribute to this project.
If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.