mirror of
https://github.com/Iconica-Development/flutter_image_picker.git
synced 2025-05-18 19:53:45 +02:00
Added more documentation
This commit is contained in:
parent
d187caefbb
commit
65d4cdd150
2 changed files with 9 additions and 0 deletions
|
@ -2,9 +2,12 @@ import 'dart:typed_data';
|
|||
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
/// The Image Picker Service class is the functionality of the Image Picker package which uses the Image Picker package to choose an image.
|
||||
/// If you have your own implementation of the Image Picker you can add it to the constructor when creating the class.
|
||||
class ImagePickerService {
|
||||
ImagePickerService({this.imagePicker});
|
||||
|
||||
/// It's possible to have your own implementation for the Image Picker if you don't want to use the Image Picker Package.
|
||||
ImagePicker? imagePicker;
|
||||
|
||||
/// [pickImage] is the function that picks the image and returns it as a [Uint8List].
|
||||
|
|
|
@ -4,6 +4,9 @@ import 'package:image_picker/image_picker.dart';
|
|||
|
||||
import '../models/image_picker_theme.dart';
|
||||
|
||||
/// The Image Picker class generates the Image Picker Widget which can be displayed in your application. If you call the class you can give it 2 optional variables:
|
||||
/// The first one is the [ImagePickerTheme] which can be used to change the UI of the widget.
|
||||
/// The second one is your own implementation of the ImagePickerService. Which can be used in testing for example.
|
||||
class ImagePicker extends StatelessWidget {
|
||||
const ImagePicker(
|
||||
{Key? key,
|
||||
|
@ -11,7 +14,10 @@ class ImagePicker extends StatelessWidget {
|
|||
this.imagePickerService})
|
||||
: super(key: key);
|
||||
|
||||
/// ImagePickerTheme can be used to change the UI of the Image Picker Widget to change the text/icons to your liking.
|
||||
final ImagePickerTheme imagePickerTheme;
|
||||
|
||||
/// The ImagePickerService can be used if you want to use your own implementation of the Image Service if you want to use it for testing or add more features. If null the current implementation will be used.
|
||||
final ImagePickerService? imagePickerService;
|
||||
|
||||
@override
|
||||
|
|
Loading…
Reference in a new issue