-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Refactor: Extracted camera overlays into their own widget with visibility management #949
Conversation
}, | ||
child: Stack( | ||
children: <Widget>[ | ||
Container( |
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.
The question I have is why do we need this container ?
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.
This container is helpful for a kind of scanner starting animation, the camera preview takes a little time to show up, and until then just a black screen with a scanner logo is shown until the preview animated before it. It's not from me but I'd leave it there.
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.
Got it, thanks, that's very usedul information, could you please document it
import 'package:smooth_ui_library/widgets/smooth_view_finder.dart'; | ||
import 'package:visibility_detector/visibility_detector.dart'; | ||
|
||
class ScannerOverlay extends StatelessWidget { |
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.
can you document that this has the qr overlay widget and SmoothProductCarousel
Yes I think we should handle those cases |
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.
Yess, the code looks great, I have a feeling this is going to fix all the camera issues
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.
Hi @M123-dev! Looks better now.
final double carouselHeight = | ||
constraints.maxHeight / 1.81; // roughly 55% of the available height |
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.
Strange to see this 1.81
again, after continuous_scan_page.dart
.
I don't know what if refers to. I suggest to use a constant instead.
And maybe to use 0.55
instead of 1.81
, that would save the comment // roughly 55% of the available height
.
Sentry issue: SMOOTHIE-S7 |
Thanks for your review @monsieurtanuki @jasmeet0817, I added some further documentation and the state management and maybe fixed a sentry but, I'm going to merge so that we can test this |
stopCamera: _stopImageStream, | ||
model: _model, | ||
scannerWidget: Transform.scale( | ||
scale: scale, |
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.
this scale causes camera to not take up the whole screen, is it really needed ?
What
FYK
The camera plugin has a section about Handling Lifecycle states, for short minimizing and then again opening the app can maybe cause some unexpected behaviors. What do you think we need to have some extra logic for that?