-
Notifications
You must be signed in to change notification settings - Fork 7
feat(capture): check if camera is available before trying to capture #20
feat(capture): check if camera is available before trying to capture #20
Conversation
Hello @Thithip thanks for the MR |
Ok, I'll do this later. Thanks for review 👍 |
040eb49
to
22a6f9f
Compare
@luifr10 I split this MR into 4 commits, to add clarity on it. Tell me if it's ok for you. I can split into multiple MR if you think it makes more sense. |
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.
Thanks again for your MR, I just have a minor feedback
lib/page/capture_page.dart
Outdated
return Scaffold( | ||
appBar: AppBar(), | ||
body: const Center( | ||
child: Text('No camera found for this device'), |
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.
Please use the i10n mechanism:
- First add a new key (newAddedKey) to the
lib/l10n/app_en.arb
andlib/l10n/app_fr.arb
files. - Then use it in dart file :
AppLocalizations.of(context)!.newAddedKey
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.
Oh yes, nice catch!
I forgot this, sorry.
On some devices (desktop, web, iOS emulators) camera can be unavailable, and the app display a verbose error. With this feature, we display an error for the User, and the way to return the Home page (thanks to the Scaffold).
- remove hard-coded SizedBox - add a more dynamic way to scroll over Sequences, no matter the device size - no more cover the "Your sequences" title list
On local, Android behavior differ from others platforms with a specific `10.0.2.2` address. Adding a condition on this allows others devices (such as iOS, MacOS, or desktop) to connect to the local API for tests
- apply lint - add const when needed - fix misspelling issue - remove unnecessary `new` keyword
22a6f9f
to
f17b41a
Compare
On some devices (desktop, web, iOS emulators) camera can be unavailable, and the app display a verbose error.
With this feature, we display an error for the User, and the way to return the Home page (thanks to the Scaffold).
Plus, I fix the scroll on Home page (by removing the hard-coded
SizedBox
), to allow scrolling on every devices, no matter the size of it.And I apply some lint issues (
const
, brackets, misspelling word).I can split this MR is multiple if you consider this one is too big, or if you think some changes are not mandatory.
Please let me know if you want I add/remove some stuff here ;)