Created
March 31, 2019 16:57
-
-
Save redbluenat/e9ec489e9c39caef11e084342df8c4b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget cameraOptionsWidget() { | |
return Padding( | |
padding: const EdgeInsets.all(5.0), | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.start, | |
children: <Widget>[ | |
showCamera ? cameraTogglesRowWidget() : Container(), | |
], | |
), | |
); | |
} | |
Widget cameraTogglesRowWidget() { | |
final List<Widget> toggles = <Widget>[]; | |
if (cameras != null) { | |
if (cameras.isEmpty) { | |
return const Text('No camera found'); | |
} else { | |
for (CameraDescription cameraDescription in cameras) { | |
toggles.add( | |
SizedBox( | |
width: 90.0, | |
child: RadioListTile<CameraDescription>( | |
title: Icon(getCameraLensIcon(cameraDescription.lensDirection)), | |
groupValue: controller?.description, | |
value: cameraDescription, | |
onChanged: controller != null ? onNewCameraSelected : null, | |
), | |
), | |
); | |
} | |
} | |
} | |
return Row(children: toggles); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment