File tree Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,3 @@ extension SafeSetStateExtension on State {
17
17
}
18
18
}
19
19
}
20
-
21
- extension NullableObjectExtension on Object ? {
22
- StackTrace ? get nullableStackTrace {
23
- if (this is Error ? ) {
24
- return (this as Error ? )? .stackTrace;
25
- }
26
- return null ;
27
- }
28
- }
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import 'dart:developer';
7
7
import 'package:flutter/foundation.dart' ;
8
8
9
9
import '../constants/type_defs.dart' ;
10
- import 'extensions.dart' ;
11
10
12
11
/// Log only in debug mode.
13
12
/// 只在调试模式打印
@@ -17,10 +16,14 @@ void realDebugPrint(dynamic message) {
17
16
}
18
17
}
19
18
20
- void handleErrorWithHandler (Object error, CameraErrorHandler ? handler) {
19
+ void handleErrorWithHandler (
20
+ Object e,
21
+ CameraErrorHandler ? handler, {
22
+ StackTrace ? s,
23
+ }) {
21
24
if (handler != null ) {
22
- handler (error, error.nullableStackTrace );
25
+ handler (e, s );
23
26
return ;
24
27
}
25
- throw error ;
28
+ throw e ;
26
29
}
Original file line number Diff line number Diff line change @@ -444,8 +444,8 @@ class CameraPickerState extends State<CameraPicker>
444
444
(() async =>
445
445
_minAvailableZoom = await controller.getMinZoomLevel ())(),
446
446
]);
447
- } catch (e) {
448
- handleErrorWithHandler (e, config.onError);
447
+ } catch (e, s ) {
448
+ handleErrorWithHandler (e, config.onError, s : s );
449
449
} finally {
450
450
safeSetState (() {
451
451
_shouldLockInitialize = false ;
@@ -1041,7 +1041,7 @@ class CameraPickerState extends State<CameraPicker>
1041
1041
),
1042
1042
_initializeWrapper (
1043
1043
isInitialized: () =>
1044
- controller .value.isRecordingVideo &&
1044
+ _controller ? .value.isRecordingVideo == true &&
1045
1045
isRecordingRestricted,
1046
1046
builder: (_, __) => CircularProgressBar (
1047
1047
duration: maximumRecordingDuration! ,
You can’t perform that action at this time.
0 commit comments