Open AhmadIzaz opened 1 month ago
Never mind, I used this https://romannurik.github.io/AndroidAssetStudio/nine-patches.html#source.type=image&sourceDensity=640&name=nine_primary_button for creating 9 patch image and then I used dart run nine_patcher and it did created the two files, json and the png file.
But upon using this
Center(
child: NinePatchImage.fromAssetMetadata(
name: 'assets/nine_primary_button.9.json',
margin: const EdgeInsets.all(5),
padding: const EdgeInsets.all(5),
child: const Text('This is my button')),
),
It destroyed the button :(
It does stretch but destroyed the whole button layout
Original png image
after
Here is the json
So I got the png from your give project
nad went to this website https://www.9patch.online/editor and created the 9 patch image of this png and this website gives me this 9 slice image
and now when i run
dart run nine_patcher path/to/the/.9.png/image
and then it returns this error`Unhandled exception: InvalidNinePatchException: 'No stretch area found along the top.'
0 findStretch (package:nine_patcher/src/image_decode.dart:115:5)
1 decodeNinePatchMetadata (package:nine_patcher/src/image_decode.dart:24:19)
2 new NinePatchImage.fromImage (package:nine_patcher/src/image.dart:18:22)
3 main (file:///Users/ahmadizaz/.pub-cache/hosted/pub.dev/nine_patcher-1.0.1/bin/nine_patcher.dart:65:29)