-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements feature to influence position of camera controls in horizontal mode #209
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1635,6 +1635,14 @@ class CameraPickerState extends State<CameraPicker> | |
); | ||
} | ||
|
||
TextDirection determineTextDirection(Enum orientation, DominantHand hand) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docs too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was my initial thought too, but the code on line 1652 cause issues, specifically: I realise now that my There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turn those values into string so you don't need an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The name |
||
if (orientation == DeviceOrientation.landscapeRight) { | ||
return hand == DominantHand.left ? TextDirection.rtl : TextDirection.ltr; | ||
} else { | ||
return hand == DominantHand.right ? TextDirection.ltr : TextDirection.rtl; | ||
} | ||
} | ||
|
||
Widget buildForegroundBody( | ||
BuildContext context, | ||
BoxConstraints constraints, | ||
|
@@ -1647,9 +1655,8 @@ class CameraPickerState extends State<CameraPicker> | |
padding: const EdgeInsets.only(bottom: 20), | ||
child: Flex( | ||
direction: isPortrait ? Axis.vertical : Axis.horizontal, | ||
textDirection: orientation == DeviceOrientation.landscapeRight | ||
? TextDirection.rtl | ||
: TextDirection.ltr, | ||
textDirection: | ||
determineTextDirection(orientation, pickerConfig.dominantHand), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add the trailing comma here. |
||
verticalDirection: orientation == DeviceOrientation.portraitDown | ||
? VerticalDirection.up | ||
: VerticalDirection.down, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need docs here, make it as a template so the config can ref it directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please give me an example, as I'm not sure what to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define:
flutter_wechat_camera_picker/lib/src/constants/type_defs.dart
Lines 66 to 72 in 5370cca
Use:
flutter_wechat_camera_picker/lib/src/constants/config.dart
Line 140 in 5370cca