Skip to main content

truvideo_camera_sdk 3.5.0 copy "truvideo_camera_sdk: ^3.5.0" to clipboard
truvideo_camera_sdk: ^3.5.0 copied to clipboard

Access the device camera to capture photos and videos, saving them in the app’s storage and returning file paths for use.

Truvideo Camera SDK #

This plugin integrates TruvideoCameraSdk for capturing photos and videos.

Supported Platforms #

  • ✅ Android
  • ✅ iOS

Features #

  • Opens the camera with configurations
  • Supports front/rear camera selection
  • Captures images and records videos
  • Handles camera events
  • AR Camera with augmented reality overlays (iOS: ARKit, Android: ARCore)
  • Smart Scanner QR/barcode detection
  • Check AR hardware support and required AR framework installation

Requirements #

These requirements apply to package version 3.5.0.

  • Flutter 3.44 or newer and Dart 3.12 or newer
  • Android API 24 or newer, compile SDK 36, and Java 17
  • iOS 16.0 or newer
  • TruvideoCameraSdk Plugin

Android Kotlin compatibility #

The plugin supports both legacy Kotlin Gradle Plugin (KGP) integration and built-in Kotlin:

  • Legacy Kotlin: Requires Flutter 3.44 or newer and KGP 2.0.0 or newer. When using AGP 9, keep android.builtInKotlin=false.
  • Built-in Kotlin: Requires Flutter 3.47 or newer, AGP 9 or newer, and a compatible Gradle version. Migrate your app and its other Flutter plugins, remove legacy Kotlin plugin application and kotlinOptions, and set android.builtInKotlin=true in your app's android/gradle.properties.

Installing this package does not automatically enable built-in Kotlin in your app. See the Flutter built-in Kotlin migration guide for the app configuration steps.

iOS dependency management #

Swift Package Manager (SPM) and CocoaPods are both supported. Flutter 3.44 and newer enable SPM by default; apps using CocoaPods can continue to use it. Set your app's iOS deployment target to 16.0 or newer with either dependency manager.

See the Flutter SPM guide for details.

Setup #

  1. Add TruvideoCameraSdk Plugin to your project.
  2. Install dependencies:
    flutter pub get
    
  3. Ensure proper permissions in AndroidManifest.xml & Info.plist.
  4. Run the app:
    flutter run
    

Usage #

  • Listen to camera events:
  TruvideoCameraSdk.events.listen((event) {
    print("Event: \${event.type}, Data: \${event.data?.toJson()}");
  });
  • Open camera:
  Future<void> openCamera(String outputPath) async {
  final config = CameraConfiguration(
    lensFacing: TruvideoSdkCameraLensFacing.back,
    flashMode: TruvideoSdkCameraFlashMode.off,
    orientation: TruvideoSdkCameraOrientation.portrait,
    outputPath: outputPath ?? '',
    mode: CameraMode.videoAndImage(
      videoMaxCount: 3,
      imageMaxCount: 5,
      durationLimit: 5000, // Video duration limit (in Milliseconds),
    ),
  );

  try {
    List<TruvideoSdkCameraMedia> result = await TruvideoCameraSdk.openCamera(
      configuration: config,
    );
    for (var media in result) {
      print('Captured: ${media.filePath} – ${media.type}');
    }
  } on PlatformException catch (e) {
    print('Camera error: ${e.message}');
  }
}
  • Open AR Camera
Future<void> openARCamera(String outputPath) async {
  final config = ArCameraConfiguration(
    orientation: TruvideoSdkCameraOrientation.portrait,
    outputPath: outputPath,
    mode:CameraMode.videoAndImage(),
  );

  try {
    List<TruvideoSdkCameraMedia> result =
    await TruvideoCameraSdk.openArCamera(configuration: config);

    for (var media in result) {
      print('Captured: ${media.filePath} – ${media.type}');
    }
  } on PlatformException catch (e) {
    print('AR Camera error: ${e.message}');
  }
}
  • Open Scanner
Future<void> openScanner() async {
  try {
    String? result = await TruvideoCameraSdk.openScanner();
    if (result != null) {
      print('Result text: $result');
    } else {
      print('Result not found or scanner cancelled by user');
    }
  } on PlatformException catch (e) {
    print('Scanner error: ${e.message}');
  }
}

License #

MIT #

Support #

If you have any questions or suggestions regarding the SDK, please contact us at support@truvideo.com.

2
likes
140
points
586
downloads

Documentation

API reference

Publisher

verified publishertruvideo.com

Weekly Downloads

Access the device camera to capture photos and videos, saving them in the app’s storage and returning file paths for use.

Homepage

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on truvideo_camera_sdk

Packages that implement truvideo_camera_sdk