Merge branch 'refs/heads/design_3.0_task_module_new_merge' into design_3.0_asset_inventory_module
commit
dfef9aadb7
@ -1,6 +1,6 @@
|
|||||||
#Thu Oct 24 09:39:31 AST 2024
|
#Thu Oct 24 09:39:31 AST 2024
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@ -1,72 +1,73 @@
|
|||||||
import 'dart:io';
|
// import 'dart:io';
|
||||||
|
//
|
||||||
import 'package:flutter/material.dart';
|
// @todo delete
|
||||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:test_sa/extensions/context_extension.dart';
|
// import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||||
import 'package:test_sa/extensions/int_extensions.dart';
|
// import 'package:test_sa/extensions/context_extension.dart';
|
||||||
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
// import 'package:test_sa/extensions/int_extensions.dart';
|
||||||
|
// import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
||||||
|
//
|
||||||
class ScanQrView extends StatefulWidget {
|
//
|
||||||
const ScanQrView({Key? key}) : super(key: key);
|
// class ScanQrView extends StatefulWidget {
|
||||||
|
// const ScanQrView({Key? key}) : super(key: key);
|
||||||
@override
|
//
|
||||||
_ScanQrViewState createState() => _ScanQrViewState();
|
// @override
|
||||||
}
|
// _ScanQrViewState createState() => _ScanQrViewState();
|
||||||
|
// }
|
||||||
class _ScanQrViewState extends State<ScanQrView> {
|
//
|
||||||
// Barcode result;
|
// class _ScanQrViewState extends State<ScanQrView> {
|
||||||
QRViewController? _controller;
|
// // Barcode result;
|
||||||
bool _scanDone = false;
|
// QRViewController? _controller;
|
||||||
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR_scanner');
|
// bool _scanDone = false;
|
||||||
|
// final GlobalKey qrKey = GlobalKey(debugLabel: 'QR_scanner');
|
||||||
// In order to get hot reload to work we need to pause the camera if the platform
|
//
|
||||||
// is android, or resume the camera if the platform is iOS.
|
// // In order to get hot reload to work we need to pause the camera if the platform
|
||||||
@override
|
// // is android, or resume the camera if the platform is iOS.
|
||||||
void reassemble() {
|
// @override
|
||||||
super.reassemble();
|
// void reassemble() {
|
||||||
if (Platform.isAndroid) {
|
// super.reassemble();
|
||||||
_controller?.pauseCamera();
|
// if (Platform.isAndroid) {
|
||||||
} else if (Platform.isIOS) {
|
// _controller?.pauseCamera();
|
||||||
_controller?.resumeCamera();
|
// } else if (Platform.isIOS) {
|
||||||
}
|
// _controller?.resumeCamera();
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
@override
|
//
|
||||||
void dispose() {
|
// @override
|
||||||
super.dispose();
|
// void dispose() {
|
||||||
_controller?.dispose();
|
// super.dispose();
|
||||||
}
|
// _controller?.dispose();
|
||||||
|
// }
|
||||||
@override
|
//
|
||||||
Widget build(BuildContext context) {
|
// @override
|
||||||
return Scaffold(
|
// Widget build(BuildContext context) {
|
||||||
|
// return Scaffold(
|
||||||
body: Stack(
|
//
|
||||||
children: [
|
// body: Stack(
|
||||||
QRView(
|
// children: [
|
||||||
key: qrKey,
|
// QRView(
|
||||||
onQRViewCreated: (QRViewController controller) {
|
// key: qrKey,
|
||||||
setState(() {
|
// onQRViewCreated: (QRViewController controller) {
|
||||||
_controller = controller;
|
// setState(() {
|
||||||
});
|
// _controller = controller;
|
||||||
controller.scannedDataStream.listen((scanData) {
|
// });
|
||||||
if (!_scanDone) {
|
// controller.scannedDataStream.listen((scanData) {
|
||||||
_scanDone = true;
|
// if (!_scanDone) {
|
||||||
Navigator.of(context).pop(scanData.code);
|
// _scanDone = true;
|
||||||
}
|
// Navigator.of(context).pop(scanData.code);
|
||||||
});
|
// }
|
||||||
},
|
// });
|
||||||
overlay: QrScannerOverlayShape(borderColor: Colors.red, borderRadius: 10, borderLength: 30, borderWidth: 10, cutOutSize: 280),
|
// },
|
||||||
),
|
// overlay: QrScannerOverlayShape(borderColor: Colors.red, borderRadius: 10, borderLength: 30, borderWidth: 10, cutOutSize: 280),
|
||||||
Padding(
|
// ),
|
||||||
padding: const EdgeInsets.all(12.0),
|
// Padding(
|
||||||
child: SizedBox(
|
// padding: const EdgeInsets.all(12.0),
|
||||||
height: 100.toScreenHeight,
|
// child: SizedBox(
|
||||||
child: DefaultAppBar(title: context.translation.scanQr)),
|
// height: 100.toScreenHeight,
|
||||||
)
|
// child: DefaultAppBar(title: context.translation.scanQr)),
|
||||||
],
|
// )
|
||||||
),
|
// ],
|
||||||
);
|
// ),
|
||||||
}
|
// );
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|||||||
@ -1,79 +1,79 @@
|
|||||||
|
//
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
|
//
|
||||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
// import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||||
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
// import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
||||||
|
// todo @delete
|
||||||
class QrScannerDialog extends StatefulWidget {
|
// class QrScannerDialog extends StatefulWidget {
|
||||||
@override
|
// @override
|
||||||
State<QrScannerDialog> createState() => _QrScannerDialogState();
|
// State<QrScannerDialog> createState() => _QrScannerDialogState();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
class _QrScannerDialogState extends State<QrScannerDialog> {
|
// class _QrScannerDialogState extends State<QrScannerDialog> {
|
||||||
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
|
// final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
|
||||||
Barcode? result;
|
// Barcode? result;
|
||||||
QRViewController? controller;
|
// QRViewController? controller;
|
||||||
bool isPicked = false;
|
// bool isPicked = false;
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
// return Scaffold(
|
||||||
body: Container(
|
// body: Container(
|
||||||
width: double.infinity,
|
// width: double.infinity,
|
||||||
height: double.infinity,
|
// height: double.infinity,
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
child: Column(
|
// child: Column(
|
||||||
children: [
|
// children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
flex: 1,
|
// flex: 1,
|
||||||
child: QRView(
|
// child: QRView(
|
||||||
key: qrKey,
|
// key: qrKey,
|
||||||
onQRViewCreated: _onQRViewCreated,
|
// onQRViewCreated: _onQRViewCreated,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
// Expanded(
|
// // Expanded(
|
||||||
// flex: 1,
|
// // flex: 1,
|
||||||
// child: Center(
|
// // child: Center(
|
||||||
// child: (result != null)
|
// // child: (result != null)
|
||||||
// ? Text(
|
// // ? Text(
|
||||||
// 'Barcode Type: ${result!.format} Data: ${result!.code}')
|
// // 'Barcode Type: ${result!.format} Data: ${result!.code}')
|
||||||
// : Text('Scan a code'),
|
// // : Text('Scan a code'),
|
||||||
// ),
|
// // ),
|
||||||
// ),
|
// // ),
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.all(12.0),
|
// padding: const EdgeInsets.all(12.0),
|
||||||
child: AppFilledButton(
|
// child: AppFilledButton(
|
||||||
label: "LocaleKeys.cancel.tr()",
|
// label: "LocaleKeys.cancel.tr()",
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
Navigator.pop(context);
|
// Navigator.pop(context);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
void _onQRViewCreated(QRViewController controller) {
|
// void _onQRViewCreated(QRViewController controller) {
|
||||||
this.controller = controller;
|
// this.controller = controller;
|
||||||
|
//
|
||||||
controller.scannedDataStream.listen((scanData) {
|
// controller.scannedDataStream.listen((scanData) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
result = scanData;
|
// result = scanData;
|
||||||
if (!isPicked) {
|
// if (!isPicked) {
|
||||||
isPicked = true;
|
// isPicked = true;
|
||||||
Navigator.pop(context, result!.code);
|
// Navigator.pop(context, result!.code);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
controller.pauseCamera();
|
// controller.pauseCamera();
|
||||||
controller.resumeCamera();
|
// controller.resumeCamera();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
void dispose() {
|
// void dispose() {
|
||||||
controller?.dispose();
|
// controller?.dispose();
|
||||||
super.dispose();
|
// super.dispose();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
Loading…
Reference in New Issue