Flutter Resizer Image using Rust library for fast image resizing.
- pubspec.yml
dependencies:
flutter_resizer_image: ^1.0.0
or
dependencies:
flutter_resizer_image:
git: https://github.com/prongbang/flutter_resizer_image
- Initial
import 'package:flutter_resizer_image/flutter_resizer_image.dart';
void main() async {
await FlutterResizerImage.init();
runApp(const MyApp());
}
- New Instance
final resizerImage = FlutterResizerImage.instance();
- Resize with Percent
String image = "iVBORw0KGgoA....AAANS=";
final image = await resizerImage.resizerWithPercent(image: image, percent: 50);
- Resize with Width x Height
String image = "iVBORw0KGgoA....AAANS=";
final image = await resizerImage.resizer(image: image, width: 100, height: 100);