Skip to content
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

Feature/capture control builder #28

Merged
merged 7 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/Dev_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
flutter-version: '3.3.10' # you can also specify exact version of flutter
flutter-version: '3.16.5' # you can also specify exact version of flutter

- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603

Expand All @@ -39,10 +39,6 @@ jobs:
# Get flutter dependencies.
- run: flutter pub get

# Uncomment this step to verify the use of 'flutter format' on each commit.
- name: Verify flutter formatting
run: flutter format --set-exit-if-changed .

# Statically analyze the Dart code for any errors.
- name: Analyze project flutter source
run: flutter analyze .
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 0.0.9

- Added `captureControlBuilder` returning detected face so that developers can build a custom capture control icon.
- Added `autoDisableCaptureControl` to disable capture control when enabled and no face is detected.
- Enhanced performance.
- Updated dependencies.
- Modified `README.md`.

**DEPRECATIONS**

- The `captureControlIcon` have been replaced with `captureControlBuilder`.

## 0.0.8

- Added indicatorShapes and indicatorAssetImage parameters so that developers can choose their desired face indicator.
Expand Down
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,31 @@ void main() async{

Here is a list of properties available to customize your widget:

| Name | Type | Description |
|-----------------------|-------------------------|-------------------------------------------------------------------------------|
| onCapture | Function(File?) | callback invoked when camera captured image |
| onFaceDetected | Function(DetectedFace?) | callback invoked when camera detects face |
| imageResolution | ImageResolution | used this to set image resolution |
| defaultCameraLens | CameraLens | used this to set initial camera lens direction |
| defaultFlashMode | CameraFlashMode | used this to set initial flash mode |
| enableAudio | bool | set false to disable capture sound |
| autoCapture | bool | set true to capture image on face detected |
| showControls | bool | set false to hide all controls |
| showCaptureControl | bool | set false to hide capture control icon |
| showFlashControl | bool | set false to hide flash control control icon |
| showCameraLensControl | bool | set false to hide camera lens control icon |
| message | String | use this pass a message above the camera |
| messageStyle | TextStyle | style applied to the message widget |
| orientation | CameraOrientation | use this to lock camera orientation |
| captureControlIcon | Widget | use this to render a custom widget for capture control |
| lensControlIcon | Widget | use this to render a custom widget for camera lens control |
| flashControlBuilder | FlashControlBuilder | use this to build custom widgets for flash control based on camera flash mode |
| messageBuilder | MessageBuilder | use this to build custom messages based on face position |
| indicatorShape | IndicatorShape | use this to change the shape of the face indicator |
| indicatorAssetImage | String | use this to pass an asset image when IndicatorShape is set to image |
| indicatorBuilder | IndicatorBuilder | use this to build custom widgets for the face indicator |
| Name | Type | Description |
|---------------------------|-------------------------|-------------------------------------------------------------------------------|
| onCapture | Function(File?) | callback invoked when camera captured image |
| onFaceDetected | Function(DetectedFace?) | callback invoked when camera detects face |
| imageResolution | ImageResolution | used this to set image resolution |
| defaultCameraLens | CameraLens | used this to set initial camera lens direction |
| defaultFlashMode | CameraFlashMode | used this to set initial flash mode |
| enableAudio | bool | set false to disable capture sound |
| autoCapture | bool | set true to capture image on face detected |
| showControls | bool | set false to hide all controls |
| showCaptureControl | bool | set false to hide capture control icon |
| showFlashControl | bool | set false to hide flash control control icon |
| showCameraLensControl | bool | set false to hide camera lens control icon |
| message | String | use this pass a message above the camera |
| messageStyle | TextStyle | style applied to the message widget |
| orientation | CameraOrientation | use this to lock camera orientation |
| captureControlIcon | Widget | use this to render a custom widget for capture control |
| lensControlIcon | Widget | use this to render a custom widget for camera lens control |
| flashControlBuilder | FlashControlBuilder | use this to build custom widgets for flash control based on camera flash mode |
| messageBuilder | MessageBuilder | use this to build custom messages based on face position |
| indicatorShape | IndicatorShape | use this to change the shape of the face indicator |
| indicatorAssetImage | String | use this to pass an asset image when IndicatorShape is set to image |
| indicatorBuilder | IndicatorBuilder | use this to build custom widgets for the face indicator |
| captureControlBuilder | CaptureControlBuilder | use this to build custom widgets for capture control |
| autoDisableCaptureControl | bool | set true to disable capture control when no face is detected |

### Contributions
---
Expand Down
10 changes: 5 additions & 5 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ PODS:
- face_camera (0.0.1):
- Flutter
- Flutter (1.0.0)
- google_mlkit_commons (0.3.0):
- google_mlkit_commons (0.6.1):
- Flutter
- MLKitVision
- google_mlkit_face_detection (0.6.0):
- google_mlkit_face_detection (0.9.0):
- Flutter
- google_mlkit_commons
- GoogleMLKit/FaceDetection (~> 4.0.0)
Expand Down Expand Up @@ -104,8 +104,8 @@ SPEC CHECKSUMS:
camera_avfoundation: 3125e8cd1a4387f6f31c6c63abb8a55892a9eeeb
face_camera: 9473f8c80e20d67bd2d946ed573ccee168d31186
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
google_mlkit_commons: a4f893c1b9708fc697b2194728013a1ed0f50b6b
google_mlkit_face_detection: 6b9965dd7f972bcb52dc8a9a7ba41d0b06de8d3b
google_mlkit_commons: 3857c1e9f23ca02073f8dd34a7a3580feb814cef
google_mlkit_face_detection: 52f7e4c15a7c49b98940fa32af4c2b10fd8608fc
GoogleDataTransport: f0308f5905a745f94fb91fea9c6cbaf3831cb1bd
GoogleMLKit: 2bd0dc6253c4d4f227aad460f69215a504b2980e
GoogleToolboxForMac: 8bef7c7c5cf7291c687cf5354f39f9db6399ad34
Expand All @@ -121,4 +121,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 292ac9b78545fb990cfde18c9de0a5d28dbb7984

COCOAPODS: 1.12.0
COCOAPODS: 1.14.3
18 changes: 13 additions & 5 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
0CAB0517EA1190F06B296CB7 /* Pods-Runner.release.xcconfig */,
92D8FFB6E9378F3BC822909C /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -157,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -377,8 +376,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = QU292HZ89L;
DEVELOPMENT_TEAM = 4J6G3CYQ9U;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -387,6 +388,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.conezi.faceCameraExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -508,8 +510,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = QU292HZ89L;
DEVELOPMENT_TEAM = 4J6G3CYQ9U;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -518,6 +522,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.conezi.faceCameraExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -531,8 +536,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = QU292HZ89L;
DEVELOPMENT_TEAM = 4J6G3CYQ9U;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -541,6 +548,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.conezi.faceCameraExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
16 changes: 8 additions & 8 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand All @@ -24,6 +26,12 @@
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>Camera permission is required for image upload.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs to be able to access your microphone</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -43,13 +51,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSCameraUsageDescription</key>
<string>Camera permission is required for image upload.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs to be able to access your microphone</string>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
Loading
Loading