Skip to content

Commit abe049b

Browse files
committed
🚸 Improve multiple internal durations
1 parent 32c7466 commit abe049b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/src/widgets/camera_picker.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import 'camera_picker_viewer.dart';
2828
import 'exposure_point_widget.dart';
2929

3030
const Color _lockedColor = Colors.amber;
31-
const Duration _kRouteDuration = Duration(milliseconds: 300);
31+
const Duration _kDuration = Duration(milliseconds: 300);
3232

3333
/// Create a camera picker integrate with [CameraDescription].
3434
/// 通过 [CameraDescription] 整合的拍照选择
@@ -1052,7 +1052,7 @@ class CameraPickerState extends State<CameraPicker>
10521052
return ValueListenableBuilder<bool>(
10531053
valueListenable: _isExposureModeDisplays,
10541054
builder: (_, bool value, Widget? child) => AnimatedOpacity(
1055-
duration: _kRouteDuration,
1055+
duration: _kDuration,
10561056
opacity: value ? 1 : 0,
10571057
child: child,
10581058
),
@@ -1131,7 +1131,7 @@ class CameraPickerState extends State<CameraPicker>
11311131
ValueListenableBuilder<bool>(
11321132
valueListenable: _isExposureModeDisplays,
11331133
builder: (_, bool value, Widget? child) => AnimatedOpacity(
1134-
duration: _kRouteDuration,
1134+
duration: _kDuration,
11351135
opacity: value ? 1 : 0,
11361136
child: child,
11371137
),

lib/src/widgets/camera_picker_page_route.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CameraPickerPageRoute<T> extends PageRoute<T> {
1616
CameraPickerPageRoute({
1717
required this.builder,
1818
this.transitionCurve = Curves.easeIn,
19-
this.transitionDuration = const Duration(milliseconds: 500),
19+
this.transitionDuration = const Duration(milliseconds: 300),
2020
this.barrierColor,
2121
this.barrierDismissible = false,
2222
this.barrierLabel,

0 commit comments

Comments
 (0)