light_weight_picker

Last updated:

0 purchases

light_weight_picker Image
light_weight_picker Images
Add to Cart

Description:

light weight picker

light_weight_picker #
A file picker plugin without any dependencies.
Getting Started #
This plugin allows developers to use native file picker api on Android and iOS without any dependencies.
Usage #

import 'package:light_weight_picker/light_weight_picker.dart';
import 'package:light_weight_picker/selected_file.dart';

class _MyAppState extends State<MyApp> {
final lightWeightPickerPlugin = LightWeightPicker();

pickFile() async {
SelectedFile? selectedFile = await lightWeightPickerPlugin
.browseAndGetFile(fileType: [FileTypes.All]);
if (selectedFile != null) {
debugPrint(selectedFile.fileName.toString());
debugPrint(selectedFile.fileExtension.toString());
debugPrint(selectedFile.fileBytes.toString());
}
}

@override
void initState() {
super.initState();
}

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: ElevatedButton(
onPressed: pickFile,
child: const Text("Browse"),
),
),
),
);
}
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.