|
@@ -1,5 +1,3 @@
|
|
|
-import 'dart:math';
|
|
|
-
|
|
|
import 'package:camera/camera.dart';
|
|
|
import 'package:fis_jsonrpc/rpc.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
@@ -36,8 +34,8 @@ class FacialRecognitionPage extends GetView<FacialRecognitionController> {
|
|
|
child: Obx(
|
|
|
() => controller.state.isCameraReady
|
|
|
? Container(
|
|
|
- child: _buildCameraArea(),
|
|
|
color: Colors.black,
|
|
|
+ child: _buildCameraArea(),
|
|
|
)
|
|
|
: const Center(
|
|
|
child: CircularProgressIndicator(
|
|
@@ -59,21 +57,13 @@ class FacialRecognitionPage extends GetView<FacialRecognitionController> {
|
|
|
child: LayoutBuilder(builder: (context, constraints) {
|
|
|
return Stack(
|
|
|
children: <Widget>[
|
|
|
- Container(
|
|
|
- color: Colors.black,
|
|
|
- alignment: Alignment.center,
|
|
|
- child: _cameraPreviewWidget(),
|
|
|
+ OverflowBox(
|
|
|
+ child: AspectRatio(
|
|
|
+ aspectRatio:
|
|
|
+ controller.kCameraController?.value.aspectRatio ?? 1,
|
|
|
+ child: _cameraPreviewWidget(),
|
|
|
+ ),
|
|
|
),
|
|
|
- // OverflowBox(
|
|
|
- // maxHeight: constraints.maxHeight,
|
|
|
- // maxWidth: 2000,
|
|
|
- // child: Container(
|
|
|
- // color: Colors.black,
|
|
|
- // child: Center(
|
|
|
- // child: _cameraPreviewWidget(),
|
|
|
- // ),
|
|
|
- // ),
|
|
|
- // ),
|
|
|
const Center(child: CameraForFace()),
|
|
|
Align(
|
|
|
alignment: Alignment.bottomRight,
|
|
@@ -98,37 +88,22 @@ class FacialRecognitionPage extends GetView<FacialRecognitionController> {
|
|
|
child: CircularProgressIndicator(),
|
|
|
);
|
|
|
} else {
|
|
|
- return Transform.rotate(
|
|
|
- angle: controller.adjustCameraAngle(
|
|
|
- cameraController,
|
|
|
- cameraController.description,
|
|
|
- ) *
|
|
|
- pi /
|
|
|
- 180,
|
|
|
- child: Listener(
|
|
|
- onPointerDown: (_) => controller.pointers++,
|
|
|
- onPointerUp: (_) => controller.pointers--,
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- child: CameraPreview(
|
|
|
- cameraController,
|
|
|
- child: LayoutBuilder(
|
|
|
- builder:
|
|
|
- (BuildContext context, BoxConstraints constraints) {
|
|
|
- return GestureDetector(
|
|
|
- behavior: HitTestBehavior.opaque,
|
|
|
- onScaleStart: controller.handleScaleStart,
|
|
|
- onScaleUpdate: controller.handleScaleUpdate,
|
|
|
- onTapDown: (TapDownDetails details) =>
|
|
|
- controller.onViewFinderTap(details, constraints),
|
|
|
- child: const FaceBoundingBox(),
|
|
|
- );
|
|
|
- },
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
+ return Listener(
|
|
|
+ onPointerDown: (_) => controller.pointers++,
|
|
|
+ onPointerUp: (_) => controller.pointers--,
|
|
|
+ child: CameraPreview(
|
|
|
+ cameraController,
|
|
|
+ child: LayoutBuilder(
|
|
|
+ builder: (BuildContext context, BoxConstraints constraints) {
|
|
|
+ return GestureDetector(
|
|
|
+ behavior: HitTestBehavior.opaque,
|
|
|
+ onScaleStart: controller.handleScaleStart,
|
|
|
+ onScaleUpdate: controller.handleScaleUpdate,
|
|
|
+ onTapDown: (TapDownDetails details) =>
|
|
|
+ controller.onViewFinderTap(details, constraints),
|
|
|
+ child: const FaceBoundingBox(),
|
|
|
+ );
|
|
|
+ },
|
|
|
),
|
|
|
),
|
|
|
);
|