|
@@ -1,3 +1,5 @@
|
|
|
+import 'dart:math';
|
|
|
+
|
|
|
import 'package:camera/camera.dart';
|
|
|
import 'package:fis_jsonrpc/rpc.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
@@ -54,16 +56,22 @@ class FacialRecognitionPage extends GetView<FacialRecognitionController> {
|
|
|
child: LayoutBuilder(builder: (context, constraints) {
|
|
|
return Stack(
|
|
|
children: <Widget>[
|
|
|
- OverflowBox(
|
|
|
- maxHeight: constraints.maxHeight,
|
|
|
- maxWidth: 2000,
|
|
|
- child: Container(
|
|
|
- color: Colors.black,
|
|
|
- child: Center(
|
|
|
- child: _cameraPreviewWidget(),
|
|
|
- ),
|
|
|
+ Container(
|
|
|
+ color: Colors.black,
|
|
|
+ child: Center(
|
|
|
+ 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,
|
|
@@ -88,22 +96,34 @@ class FacialRecognitionPage extends GetView<FacialRecognitionController> {
|
|
|
child: CircularProgressIndicator(),
|
|
|
);
|
|
|
} else {
|
|
|
- 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(),
|
|
|
- );
|
|
|
- },
|
|
|
+ return Transform.rotate(
|
|
|
+ angle: controller.adjustCameraAngle(
|
|
|
+ cameraController,
|
|
|
+ cameraController.description,
|
|
|
+ ) *
|
|
|
+ pi /
|
|
|
+ 180,
|
|
|
+ child: Listener(
|
|
|
+ onPointerDown: (_) => controller.pointers++,
|
|
|
+ onPointerUp: (_) => controller.pointers--,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ 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(),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
),
|
|
|
);
|