File tree Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -721,12 +721,30 @@ class CameraPickerState extends State<CameraPicker>
721
721
/// This displayed at the top of the screen.
722
722
/// 该区域显示在屏幕上方。
723
723
Widget get settingsAction {
724
- return _initializeWrapper (
725
- builder: (CameraValue v, __) => Padding (
726
- padding: const EdgeInsets .symmetric (horizontal: 12.0 ),
727
- child: Row (
728
- children: < Widget > [const Spacer (), switchFlashesButton (v)],
729
- ),
724
+ return Padding (
725
+ padding: const EdgeInsets .symmetric (horizontal: 12.0 ),
726
+ child: Row (
727
+ children: < Widget > [
728
+ if ((cameras? .length ?? 0 ) > 1 ) switchCamerasButton,
729
+ const Spacer (),
730
+ _initializeWrapper (
731
+ builder: (CameraValue v, __) => switchFlashesButton (v),
732
+ ),
733
+ ],
734
+ ),
735
+ );
736
+ }
737
+
738
+ /// The button to switch between cameras.
739
+ /// 切换相机的按钮
740
+ Widget get switchCamerasButton {
741
+ return IconButton (
742
+ onPressed: switchCameras,
743
+ icon: Icon (
744
+ Platform .isIOS
745
+ ? Icons .flip_camera_ios_outlined
746
+ : Icons .flip_camera_android_outlined,
747
+ size: 24 ,
730
748
),
731
749
);
732
750
}
You can’t perform that action at this time.
0 commit comments