android_content_provider 0.4.2 copy "android_content_provider: ^0.4.2" to clipboard
android_content_provider: ^0.4.2 copied to clipboard

PlatformAndroid

Flutter plugin to use ContentProvider/ContentResolver APIs on Android

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

import 'books_page.dart';
import 'media_store_songs_page.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const ProviderScope(child: MyApp()));
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Builder(
        builder: (context) => Scaffold(
          appBar: AppBar(
            title: const Text('AndroidContentResolver example'),
          ),
          body: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                child: const Text(
                  'Books example (provider from example_provider)',
                ),
                onPressed: () {
                  Navigator.of(context).push(
                    MaterialPageRoute(builder: (context) => const BooksPage()),
                  );
                },
              ),
              ElevatedButton(
                child: const Text(
                  'MediaStore songs example (common Android provider)',
                ),
                onPressed: () {
                  Navigator.of(context).push(
                    MaterialPageRoute(
                      builder: (context) => const MediaStoreSongsPage(),
                    ),
                  );
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}
15
likes
150
points
1.43k
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin to use ContentProvider/ContentResolver APIs on Android

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

async, flutter, uuid

More

Packages that depend on android_content_provider