From 65d4cdd150b18120c48d802cd00302e92729074d Mon Sep 17 00:00:00 2001 From: commitimpush Date: Mon, 5 Sep 2022 09:54:42 +0200 Subject: [PATCH] Added more documentation --- lib/src/services/image_picker_service.dart | 3 +++ lib/src/ui/image_picker_ui.dart | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/lib/src/services/image_picker_service.dart b/lib/src/services/image_picker_service.dart index ace1c1a..a4c1670 100644 --- a/lib/src/services/image_picker_service.dart +++ b/lib/src/services/image_picker_service.dart @@ -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]. diff --git a/lib/src/ui/image_picker_ui.dart b/lib/src/ui/image_picker_ui.dart index 5314fae..c983f9e 100644 --- a/lib/src/ui/image_picker_ui.dart +++ b/lib/src/ui/image_picker_ui.dart @@ -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