rar 0.1.0 copy "rar: ^0.1.0" to clipboard
rar: ^0.1.0 copied to clipboard

A Flutter plugin for handling RAR files. Extract and list contents of RAR archives on both Android and iOS.

rar #

A Flutter plugin for handling RAR archives on Android and iOS. This plugin allows you to extract RAR files, list their contents, and more.

Features #

  • Extract RAR files
  • List contents of RAR files
  • Support for password-protected RAR archives

Getting Started #

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  rar: latest_version

Usage #

Extracting a RAR file #

import 'package:rar/rar.dart';

Future<void> extractRarFile() async {
  final result = await Rar.extractRarFile(
    rarFilePath: '/path/to/archive.rar',
    destinationPath: '/path/to/destination/folder',
    password: 'optional_password', // Optional
  );
  
  if (result['success']) {
    print('Extraction successful: ${result['message']}');
  } else {
    print('Extraction failed: ${result['message']}');
  }
}

Listing RAR contents #

import 'package:rar/rar.dart';

Future<void> listRarContents() async {
  final result = await Rar.listRarContents(
    rarFilePath: '/path/to/archive.rar',
    password: 'optional_password', // Optional
  );
  
  if (result['success']) {
    print('Files in archive:');
    for (final file in result['files']) {
      print('- $file');
    }
  } else {
    print('Failed to list contents: ${result['message']}');
  }
}

Note on Creating RAR Archives #

Creating RAR archives is not supported in this plugin because:

  1. RAR is a proprietary format, and creating RAR archives requires the use of proprietary tools
  2. There are no reliable, open-source libraries for creating RAR archives on Android and iOS

For creating archives, consider using the ZIP format instead, which has better native support on both platforms.

License #

This plugin is released under the MIT License.

Third-party Libraries #

This plugin depends on:

  • JUnRar for Android (LGPL-3.0 License)
  • UnrarKit for iOS (BSD License)
2
likes
160
points
132
downloads

Publisher

verified publisherlkrjangid.tech

Weekly Downloads

A Flutter plugin for handling RAR files. Extract and list contents of RAR archives on both Android and iOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on rar

Packages that implement rar