unzipx 0.0.1
unzipx: ^0.0.1 copied to clipboard
UnZipX is a lightweight Flutter package that extracts ZIP files from the assets folder and saves them to the app's support directory. It simplifies asset extraction with a single
import 'package:flutter/material.dart';
import 'package:unzipx/unzipx.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('UnZipX Example')),
body: Center(
child: ElevatedButton(
onPressed: () async {
try {
String extractedPath = await UnZipX.extractZipFromAssets('assets/sample.zip');
print("Files extracted to: $extractedPath");
} catch (e) {
print("Extraction failed: $e");
}
},
child: Text('Extract ZIP'),
),
),
),
);
}
}