Last updated:
0 purchases
flutter jigsaw puzzle
flutter_jigsaw_puzzle #
A Flutter jigsaw puzzle view that supports custom grids of varying sizes.
Features #
Create a jigsaw puzzle from any AssetImage
Configurable grid size (2x2, 3x3, 4x4, 5x5, 6x6, ...)
Separate callbacks for when each block gets snapped and for when the puzzle is completed
Getting started #
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
...
flutter_jigsaw_puzzle: <latest_version>
copied to clipboard
In your library add the following import:
import 'package:flutter_jigsaw_puzzle/flutter_jigsaw_puzzle.dart';
copied to clipboard
For help getting started with Flutter, view the online documentation.
Example #
3x3 #
5x5 #
10x10 #
final puzzleKey = GlobalKey<JigsawWidgetState>();
Column(
children: [
ElevatedButton(
onPressed: () async {
await puzzleKey.currentState.generate();
},
child: const Text('Generate'),
),
JigsawPuzzle(
gridSize: 10,
image: const AssetImage('assets/Jigsaw.jpg'),
onFinished: () {
// ignore: avoid_print
print('finished!');
},
snapSensitivity: .5, // Between 0 and 1
puzzleKey: puzzleKey,
onBlockSuccess: () {
// ignore: avoid_print
print('block success!');
},
)
],
),
copied to clipboard
You can find a working example in the Example project.
Changelog #
Please see the Changelog page to know what's recently changed.
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 new feature, please send a pull request.
TODO #
Tests
Animations
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.