nine_scaling_image 1.0.3 copy "nine_scaling_image: ^1.0.3" to clipboard
nine_scaling_image: ^1.0.3 copied to clipboard

An extended Image widget with nine-scaling

Nine-Slice Scaling Image #

This package allows user use nine-slice scaling image widget on Flutter. This is useful especially for application with pixel-art design.

Images #

Widget samples

Getting Started #

Add nine_scaling_image to your pubspec.yaml:

nine_scaling_image: any

Adding Widget on your project #

Add your material image file into your project and update pubspec.yaml to use it like as follows:

flutter:
  assets:
    - assets/sampleimage.png

Import package and use NineScalingImage class as folows:

NineScalingImage img = NineScalingImage(assetPath: 'assets/sampleimage.png', pieceSize: const Size.square(5));

You can set following parameters:

  • assetPath (required)
    • a path to image
  • pieceSize (required)
    • a piece size in nine-slicing
  • centerColor (optional)
    • a color which fill the center of widget
  • dstPieceScale (optional)
    • a piece ratio between scource image and destination widget size
  • child (optional)
    • child widget in nine-slicing object
1
likes
130
pub points
11%
popularity

Publisher

verified publishershuaki.com

An extended Image widget with nine-scaling

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on nine_scaling_image