Skip to content
pubscout

open_file_safe_plus

0.0.8, released 2 months ago by shadatrahman.com

Open local files with the platform's native viewer/app from Flutter.

$ flutter pub add open_file_safe_plus
Source repository

What it does

The plugin launches the OS's default app to display a given file path. It works on Android, iOS, desktop, and web and returns a result indicating success or error.

AI-written summary of version 0.0.8, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to let the user view or share a file using the device's native apps
  • You want a simple cross‑platform way to open PDFs, images, videos, etc.

Skip it when

  • You need to embed the file content inside your UI
  • You require fine‑grained control over the viewer or custom rendering

Strengths

  • Cross‑platform (mobile, desktop, web)
  • Simple API with result handling
  • Supports MIME type and UTI overrides

Weaknesses

  • Only opens files; no preview or editing capabilities
  • Requires native configuration (Android manifest, iOS FileProvider)

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
1

Add FileProvider to AndroidManifest and filepaths.xml; iOS may need UTIs; optional Linux FFI or Process fallback; no build_runner needed

import 'package:open_file_safe_plus/open_file_safe_plus.dart';

final result = await OpenFileSafePlus.open('/sdcard/example.txt');
if (result.type == ResultType.done) {
  // opened successfully
} else {
  print('${result.type}: ${result.message}');
}

Alternatives

Packages that do the same job and could replace open_file_safe_plus.

  • file

    Provides file system utilities without native opening, useful if you only need file manipulation

Works with

Packages commonly used together with open_file_safe_plus: ones it builds on, ones built on it, and its own family.