-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[camera]refactor flash mode and add unit test #4695
[camera]refactor flash mode and add unit test #4695
Conversation
224bbf0
to
b948452
Compare
@stuartmorgan Just double check - are you fine with not bumping the version here? Or do you think we should bump it because we added unit tests? There will be multiple similar PRs coming up. |
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.
LGTM with naming nit.
Thanks @hellohuanlin!
@@ -10,6 +10,7 @@ | |||
#import <CoreMotion/CoreMotion.h> | |||
#import <libkern/OSAtomic.h> | |||
#import <uuid/uuid.h> | |||
#import "FLTFlashMode.h" |
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.
I think FlashMode.h
as you had it was better, there's no reason to prefix header names (that I'm aware of), even though a few other files have done so.
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 reason in general is, per style guide:
File names should reflect the name of the class implementation that they contain—including case.
Most files are classes, and thus have a prefix because the class does.
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.
You're right, that is the pattern, and Apple also prefixes their header names. Hard to keep it all straight. 🙂
14babcd
to
672a77e
Compare
This pull request is not suitable for automatic merging in its current state.
|
This is strange. It is conflicting with #4692, which is not landed to main yet. |
Ah right. my mistake |
672a77e
to
bad2437
Compare
Breaking up
CameraPlugin.m
is part of optional cleanups discussed in the proposal. The monolithicCameraPlugin.m
makes it hard to unit test other sub-tasks, so we want to do this clean up sooner.This PR moves
FlashMode
type and its related util functions into a separate file. Also added unit tests for these util functions.No version change: just moving code
Issue here: flutter/flutter#96429
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.