file_picker_plus 1.7.0 copy "file_picker_plus: ^1.7.0" to clipboard
file_picker_plus: ^1.7.0 copied to clipboard

discontinuedreplaced by: file_picker_pro

Flutter plugin for selecting files from the Android and iOS file library, and taking new pictures with the camera.

example/lib/main.dart

import 'dart:developer';

import 'package:file_picker_plus/file_data.dart';
import 'package:file_picker_plus/file_picker.dart';
import 'package:file_picker_plus/files.dart';
import 'package:flutter/material.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  FileData _fileData = FileData();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: SafeArea(
          child: Column(
            children: [
              FilePicker(
                  context: context,
                  height: 100,
                  fileData: _fileData,
                  crop: true,
                  maxFileSizeInMb: 10,
                  allowedExtensions: Files.allowedAllExtensions,
                  onSelected: (fileData) {
                    _fileData = fileData;
                    log(fileData.filePath);
                    setState(() {});
                  },
                  onCancel: (message, messageCode) {
                    log("[$messageCode] $message");
                  }),
            ],
          ),
        ),
      ),
    );
  }
}
7
likes
150
pub points
64%
popularity

Publisher

unverified uploader

Flutter plugin for selecting files from the Android and iOS file library, and taking new pictures with the camera.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

file_picker, flutter, flutter_web_plugins, image_cropper, image_picker, mime, open_share_pro, plugin_platform_interface

More

Packages that depend on file_picker_plus