Skip to content

A plugin that help app to call ContentResolver on Android.

License

Notifications You must be signed in to change notification settings

ueman/flutter_content_resolver

 
 

Repository files navigation

content_resolver

The plugin is to resolve Android's content URI that is often used by Content providers.

Install

Add this to your package's pubspec.yaml file and execute flutter pub get:

dependencies:
  content_resolver: ^0.3.0

Usage

Resolving content

The following fragment is a use case with app_links to receive content:... URI content:

_appLinks = AppLinks(onAppLink: (uri) async {
  // If the data is some image, you can pass the data directly to Image.data or something.
  final Content content = await ContentResolver.resolveContent(uri);
  ...
});

Writing content

The following fragment illustrates how to write data to content:... URI:

  final data = Uint8List.fromList(utf8.encode('Hello World'));
  await ContentResolver.writeContent(uri.toString(), data);
  ...

Please note that if the URI is not writable, the code throws certain exception.

About

A plugin that help app to call ContentResolver on Android.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 53.1%
  • Kotlin 36.4%
  • C++ 6.4%
  • Java 2.7%
  • CMake 1.4%