fix: rotate photo selfie
This commit is contained in:
parent
c4c0479341
commit
2e98c1a234
|
@ -12,6 +12,7 @@ import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_v
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'dart:math' as math;
|
||||
|
||||
class DisplayPictureScreen extends StatefulWidget {
|
||||
final String imagePath, content;
|
||||
|
@ -106,7 +107,14 @@ class _DisplayPictureScreenState extends State<DisplayPictureScreen> {
|
|||
SizedBox(
|
||||
width: SizeConfig.width,
|
||||
height: SizeConfig.height * .4,
|
||||
child: Image.file(File(widget.imagePath))),
|
||||
child: Transform(
|
||||
alignment: Alignment.center,
|
||||
transform: widget.content == 'selfie'
|
||||
? Matrix4.rotationY(math.pi)
|
||||
: Matrix4.rotationY(0),
|
||||
child: Image.file(
|
||||
File(widget.imagePath),
|
||||
))),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: Text(
|
||||
|
|
|
@ -13,6 +13,7 @@ import 'package:cims_apps/features/auth/registration/view/submission_data/submis
|
|||
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'dart:math' as math;
|
||||
|
||||
class SubmitDataIdCard extends StatelessWidget {
|
||||
const SubmitDataIdCard({Key? key}) : super(key: key);
|
||||
|
@ -108,14 +109,21 @@ class SubmitDataIdCard extends StatelessWidget {
|
|||
SizedBox(
|
||||
height: SizeConfig.height * .18,
|
||||
width: SizeConfig.width * .45,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Image.file(
|
||||
File(e.image),
|
||||
fit: BoxFit.fill,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return const Icon(Icons.image_not_supported_outlined);
|
||||
},
|
||||
child: Transform(
|
||||
alignment: Alignment.center,
|
||||
transform: e.key == 'selfie'
|
||||
? Matrix4.rotationY(math.pi)
|
||||
: Matrix4.rotationY(0),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Image.file(
|
||||
File(e.image),
|
||||
fit: BoxFit.fill,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return const Icon(
|
||||
Icons.image_not_supported_outlined);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -52,8 +52,8 @@ class SubmissionDataViewModel extends ChangeNotifier {
|
|||
];
|
||||
|
||||
List<ItemSelectForm> listImg = [
|
||||
ItemSelectForm('', 'ID Card', image: ''),
|
||||
ItemSelectForm('', 'Selfie with ID Card', image: ''),
|
||||
ItemSelectForm('ktp', 'ID Card', image: ''),
|
||||
ItemSelectForm('selfie', 'Selfie with ID Card', image: ''),
|
||||
];
|
||||
|
||||
Future<List<CameraDescription>> initCamera() async {
|
||||
|
|
|
@ -681,18 +681,18 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_flutter_core
|
||||
sha256: "4eed0d3ae50c16b5e8e4957f3c1917e9bd0315a08dfb49a104ca8fc10244bef3"
|
||||
sha256: "9f98e2726af42967497eaef68f3373261700bbfcd33bd97da4ec85cb56fcdaf7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "24.2.6"
|
||||
version: "24.2.7"
|
||||
syncfusion_flutter_signaturepad:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: syncfusion_flutter_signaturepad
|
||||
sha256: da55bd7d796f2c9b4707f3e063e443f67c355c6098002e446bbf43672952916e
|
||||
sha256: d51d5e346c70b938a8e1f2318a073213172aea7b99e33073c379657b1066c001
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "24.2.6"
|
||||
version: "24.2.7"
|
||||
synchronized:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
Loading…
Reference in New Issue
Block a user