mirror of
https://github.com/Iconica-Development/flutter_media_picker.git
synced 2025-05-18 16:33:45 +02:00
fix: comments Jorian
This commit is contained in:
parent
471724a559
commit
4d9f760418
14 changed files with 61 additions and 43 deletions
40
CHANGELOG.md
40
CHANGELOG.md
|
@ -1,23 +1,3 @@
|
|||
## 0.0.1
|
||||
|
||||
- Initial port
|
||||
|
||||
## 0.0.2
|
||||
|
||||
- Updated flutter_form version
|
||||
|
||||
## 0.0.3
|
||||
|
||||
- Fixed bug where onTap was not working when header is set
|
||||
|
||||
## 0.1.0
|
||||
|
||||
- Ability to set styling for the audio input.
|
||||
|
||||
## 0.1.1
|
||||
|
||||
- Updated flutter_form version to 2.0.1
|
||||
|
||||
## 0.2.0
|
||||
- Added option to select a file
|
||||
- Added file_picker package for file picking possibility
|
||||
|
@ -26,3 +6,23 @@
|
|||
- Icons are customizable
|
||||
- When using standard icon buttons delivered with this package you can set the icon text, icon text size, icon and icon size
|
||||
- Translated the example to English
|
||||
|
||||
## 0.1.1
|
||||
|
||||
- Updated flutter_form version to 2.0.1
|
||||
|
||||
## 0.1.0
|
||||
|
||||
- Ability to set styling for the audio input.
|
||||
|
||||
## 0.0.3
|
||||
|
||||
- Fixed bug where onTap was not working when header is set
|
||||
|
||||
## 0.0.2
|
||||
|
||||
- Updated flutter_form version
|
||||
|
||||
## 0.0.1
|
||||
|
||||
- Initial port
|
||||
|
|
|
@ -70,7 +70,7 @@ class _MediaCheckPageState extends State<MediaCheckPage> {
|
|||
widget.cancel();
|
||||
formController.autoNextStep();
|
||||
},
|
||||
child: const Text("Share"),
|
||||
child: const Text('Share'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -140,7 +140,7 @@ class _MediaCheckPageState extends State<MediaCheckPage> {
|
|||
),
|
||||
Expanded(
|
||||
child: FlutterFormInputMultiLine(
|
||||
hint: "Add description...",
|
||||
hint: 'Add description...',
|
||||
maxCharacters: 300,
|
||||
controller: descriptionController),
|
||||
),
|
||||
|
|
|
@ -65,10 +65,10 @@ class _MediaPickerIconOptionsState extends ConsumerState<MediaPickerPageIconOpti
|
|||
verticalSpacing: 20,
|
||||
mediaPickerInputs: [
|
||||
MediaPickerInputPhoto(
|
||||
label: "Make photo",
|
||||
label: 'Make photo',
|
||||
icon: const IconButtonWithText(
|
||||
icon: Icons.camera_alt,
|
||||
iconText: "Custom Photo Icon",
|
||||
iconText: 'Custom Photo Icon',
|
||||
),
|
||||
pickFile: mediaService.pickImageFile,
|
||||
checkPageSettings: {
|
||||
|
@ -81,7 +81,7 @@ class _MediaPickerIconOptionsState extends ConsumerState<MediaPickerPageIconOpti
|
|||
},
|
||||
),
|
||||
MediaPickerInputVideo(
|
||||
label: "Make video",
|
||||
label: 'Make video',
|
||||
pickFile: mediaService.pickVideoFile,
|
||||
videoPlayerFactory: MediaPickerVideoPlayerFactory(),
|
||||
checkPageSettings: {
|
||||
|
@ -95,7 +95,7 @@ class _MediaPickerIconOptionsState extends ConsumerState<MediaPickerPageIconOpti
|
|||
),
|
||||
if (!kIsWeb)
|
||||
MediaPickerInputAudio(
|
||||
label: "Record audio",
|
||||
label: 'Record audio',
|
||||
checkPageSettings: {'title': 'Share audio'},
|
||||
onComplete: (MediaResult result) {
|
||||
Navigator.pop(context);
|
||||
|
@ -103,14 +103,14 @@ class _MediaPickerIconOptionsState extends ConsumerState<MediaPickerPageIconOpti
|
|||
audioService: audioService,
|
||||
),
|
||||
MediaPickerInputText(
|
||||
label: "Write text",
|
||||
label: 'Write text',
|
||||
checkPageSettings: {'title': 'Share text'},
|
||||
onComplete: (MediaResult result) {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
MediaPickerInputFile(
|
||||
label: "Select file",
|
||||
label: 'Select file',
|
||||
pickFile: mediaService.pickFile,
|
||||
fileExtensions: [
|
||||
'pdf',
|
||||
|
|
|
@ -63,7 +63,7 @@ class _MediaPickerTextOptionsState extends ConsumerState<MediaPickerPageTextOpti
|
|||
buttonType: ButtonType.text,
|
||||
mediaPickerInputs: [
|
||||
MediaPickerInputPhoto(
|
||||
label: "Make photo",
|
||||
label: 'Make photo',
|
||||
pickFile: mediaService.pickImageFile,
|
||||
checkPageSettings: {
|
||||
'title': 'Share photo',
|
||||
|
@ -75,7 +75,7 @@ class _MediaPickerTextOptionsState extends ConsumerState<MediaPickerPageTextOpti
|
|||
},
|
||||
),
|
||||
MediaPickerInputVideo(
|
||||
label: "Make video",
|
||||
label: 'Make video',
|
||||
pickFile: mediaService.pickVideoFile,
|
||||
videoPlayerFactory: MediaPickerVideoPlayerFactory(),
|
||||
checkPageSettings: {
|
||||
|
@ -89,7 +89,7 @@ class _MediaPickerTextOptionsState extends ConsumerState<MediaPickerPageTextOpti
|
|||
),
|
||||
if (!kIsWeb)
|
||||
MediaPickerInputAudio(
|
||||
label: "Record audio",
|
||||
label: 'Record audio',
|
||||
checkPageSettings: {'title': 'Share audio'},
|
||||
onComplete: (MediaResult result) {
|
||||
Navigator.pop(context);
|
||||
|
@ -97,14 +97,14 @@ class _MediaPickerTextOptionsState extends ConsumerState<MediaPickerPageTextOpti
|
|||
audioService: audioService,
|
||||
),
|
||||
MediaPickerInputText(
|
||||
label: "Write text",
|
||||
label: 'Write text',
|
||||
checkPageSettings: {'title': 'Share text'},
|
||||
onComplete: (MediaResult result) {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
MediaPickerInputFile(
|
||||
label: "Select file",
|
||||
label: 'Select file',
|
||||
pickFile: mediaService.pickFile,
|
||||
fileExtensions: [
|
||||
'pdf',
|
||||
|
|
|
@ -23,7 +23,7 @@ import 'package:flutter_media_picker/src/widgets/icon_button_with_text.dart';
|
|||
/// [onComplete] will be called when the user has selected/made the media.
|
||||
/// If checkpage is set this method will be called when the [onComplete] is called in the checkPage.
|
||||
abstract class MediaPickerInput {
|
||||
String label = "Media Picker input";
|
||||
String label = 'Media Picker input';
|
||||
|
||||
Widget icon = const IconButtonWithText();
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
enum ButtonType {
|
||||
icons,
|
||||
text,
|
||||
|
|
|
@ -1 +1,5 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
export 'button_type.dart';
|
||||
|
|
|
@ -15,7 +15,7 @@ import 'package:intl/intl.dart';
|
|||
/// This feature is only usable for native applications.
|
||||
class MediaPickerInputAudio implements MediaPickerInput {
|
||||
MediaPickerInputAudio({
|
||||
this.label = "Audio",
|
||||
this.label = 'Audio',
|
||||
Widget? icon,
|
||||
this.checkPageSettings,
|
||||
this.onComplete,
|
||||
|
@ -50,7 +50,7 @@ class MediaPickerInputAudio implements MediaPickerInput {
|
|||
if (content.fileValue != null) {
|
||||
audio = content;
|
||||
} else {
|
||||
throw Exception("No recording returned");
|
||||
throw Exception('No recording returned');
|
||||
}
|
||||
},
|
||||
inputStyling: inputStyling ?? AudioInputStyling(),
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
@ -12,7 +15,7 @@ import '../../flutter_media_picker.dart';
|
|||
/// Input for file used by [MediaPicker].
|
||||
class MediaPickerInputFile implements MediaPickerInput {
|
||||
MediaPickerInputFile({
|
||||
this.label = "File",
|
||||
this.label = 'File',
|
||||
Widget? icon,
|
||||
this.fileExtensions = const ['pdf', 'jpg', 'png'],
|
||||
this.checkPageSettings,
|
||||
|
@ -65,9 +68,8 @@ class MediaPickerInputFile implements MediaPickerInput {
|
|||
case '.pdf':
|
||||
case '.doc':
|
||||
case '.docx':
|
||||
return Text(result.fileName!);
|
||||
case '.txt':
|
||||
return const DisplayText();
|
||||
return Text(result.fileName!);
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import 'package:flutter_media_picker/src/widgets/icon_button_with_text.dart';
|
|||
/// Input for photo used by [MediaPicker].
|
||||
class MediaPickerInputPhoto implements MediaPickerInput {
|
||||
MediaPickerInputPhoto({
|
||||
this.label = "Photo",
|
||||
this.label = 'Photo',
|
||||
Widget? icon,
|
||||
this.checkPageSettings,
|
||||
this.onComplete,
|
||||
|
|
|
@ -12,7 +12,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|||
/// Input for text used by [MediaPicker].
|
||||
class MediaPickerInputText implements MediaPickerInput {
|
||||
MediaPickerInputText({
|
||||
this.label = "Text",
|
||||
this.label = 'Text',
|
||||
Widget? icon,
|
||||
this.checkPageSettings,
|
||||
this.onComplete,
|
||||
|
|
|
@ -10,7 +10,7 @@ import 'package:flutter_media_picker/flutter_media_picker.dart';
|
|||
/// Input for video used by [MediaPicker].
|
||||
class MediaPickerInputVideo implements MediaPickerInput {
|
||||
MediaPickerInputVideo({
|
||||
this.label = "Video",
|
||||
this.label = 'Video',
|
||||
Widget? icon,
|
||||
this.checkPageSettings,
|
||||
this.onComplete,
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class IconButtonWithText extends StatelessWidget {
|
||||
const IconButtonWithText({
|
||||
super.key,
|
||||
this.iconSize = 40,
|
||||
this.iconText = "Button",
|
||||
this.iconText = 'Button',
|
||||
this.iconTextSize = 16,
|
||||
this.icon = Icons.file_copy,
|
||||
});
|
||||
|
|
|
@ -1 +1,5 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
export 'icon_button_with_text.dart';
|
||||
|
|
Loading…
Reference in a new issue