Skip to content

Commit 8329adc

Browse files
authored
🚑️ Correct arguments of EntitySaveCallback (#85)
1 parent 74ffa21 commit 8329adc

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

lib/src/constants/type_defs.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import 'enums.dart';
2525
/// * 不要使用 `Navigator.of(context).pop/maybePop` 返回 `null``AssetEntity`
2626
/// 以外类型的内容,否则会抛出类型转换异常。
2727
/// {@endtemplate}
28-
typedef EntitySaveCallback = FutureOr<dynamic> Function({
28+
typedef EntitySaveCallback = FutureOr<dynamic> Function(
2929
BuildContext context,
3030
CameraPickerViewType viewType,
3131
File file,
32-
});
32+
);
3333

3434
/// {@template wechat_camera_picker.CameraErrorHandler}
3535
/// The error handler when any error occurred during the picking process.

lib/src/internals/methods.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import 'dart:developer';
66

77
import 'package:flutter/foundation.dart';
88

9-
import 'extensions.dart';
109
import '../constants/type_defs.dart';
10+
import 'extensions.dart';
1111

1212
/// Log only in debug mode.
1313
/// 只在调试模式打印

lib/src/widgets/camera_picker_viewer.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,7 @@ class _CameraPickerViewerState extends State<CameraPickerViewer> {
211211
/// because the parent picker will ignore it.
212212
Future<void> createAssetEntityAndPop() async {
213213
if (widget.onEntitySaving != null) {
214-
await widget.onEntitySaving!(
215-
context: context,
216-
viewType: pickerType,
217-
file: previewFile,
218-
);
214+
await widget.onEntitySaving!(context, pickerType, previewFile);
219215
return;
220216
}
221217
AssetEntity? entity;

0 commit comments

Comments
 (0)