beta commit

This commit is contained in:
Odein
2023-10-26 15:04:34 +04:30
parent ddc5649b1c
commit 11f910bb1c
262 changed files with 31865 additions and 15718 deletions
+54 -54
View File
@@ -1,54 +1,54 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class LabelScanInputBox extends StatelessWidget {
const LabelScanInputBox({
Key key,
@required this.idCTRL,
@required double deviceBlockSize,
}) : _deviceBlockSize = deviceBlockSize,
super(key: key);
final TextEditingController idCTRL;
final double _deviceBlockSize;
@override
Widget build(BuildContext context) {
return TextFormField(
validator: (val) {
if (val.isEmpty) {
return 'Id required!!';
}
return null;
},
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Or enter a label ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
);
}
}
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class LabelScanInputBox extends StatelessWidget {
const LabelScanInputBox({
Key? key,
required this.idCTRL,
required double deviceBlockSize,
}) : _deviceBlockSize = deviceBlockSize,
super(key: key);
final TextEditingController idCTRL;
final double _deviceBlockSize;
@override
Widget build(BuildContext context) {
return TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
return null;
},
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Or enter a label ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
);
}
}
+58 -58
View File
@@ -1,58 +1,58 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class FilterScanSaveButton extends StatelessWidget {
const FilterScanSaveButton({
Key key,
@required GlobalKey<FormState> form,
@required this.idCTRL,
@required double deviceBlockSize,
}) : _form = form,
_deviceBlockSize = deviceBlockSize,
super(key: key);
final GlobalKey<FormState> _form;
final TextEditingController idCTRL;
final double _deviceBlockSize;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
if (!_form.currentState.validate()) {
return;
}
launch(
'https://cssd-doc.com/Show/Label/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.labelDetailScreen,
// arguments: idCTRL.text,
// );
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
margin: EdgeInsets.only(bottom: 50,left: 20,right: 20),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.blue, Colors.green],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'GO!',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
);
}
}
import 'package:cssd/config/colors.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class FilterScanSaveButton extends StatelessWidget {
const FilterScanSaveButton({
Key? key,
required GlobalKey<FormState> form,
required this.idCTRL,
required double deviceBlockSize,
}) : _form = form,
_deviceBlockSize = deviceBlockSize,
super(key: key);
final GlobalKey<FormState> _form;
final TextEditingController idCTRL;
final double _deviceBlockSize;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
}
launch(
'https://cssd-doc.com/Show/Label/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.labelDetailScreen,
// arguments: idCTRL.text,
// );
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kLightBlue, kLightBlueSub],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
);
}
}
+88 -88
View File
@@ -1,88 +1,88 @@
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';
class LabelScanBox extends StatelessWidget {
const LabelScanBox({
Key key,
}) : super(key: key);
Future<String> scan() async {
try {
var barcode = await BarcodeScanner.scan();
if (barcode.type.name == 'Cancelled') {
return 'cancel';
} else if (barcode.type.name == 'Failed') {
return 'error';
} // print(barcode.split('/'));
try {
var id = barcode.rawContent.contains('www.cssd-doc.com')
? barcode.rawContent.split('/')[5]
: barcode.rawContent;
return id;
} catch (_) {
return 'null';
}
} on PlatformException catch (_) {
return 'access';
} catch (_) {
return 'error';
}
// } on FormatException {
// setState(() => this.testCode =
// 'null (User returned using the "back"-button before scanning anything. Result)');
// } catch (e) {
// setState(() => this.testCode = 'Unknown error: $e');
// }
// return null;
}
@override
Widget build(BuildContext context) {
final _media = MediaQuery.of(context);
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Label Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
),
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Label/$result',
);
// Navigator.of(context).pushNamed(
// Routes.labelDetailScreen,
// arguments: result,
// );
}
},
);
},
);
}
}
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';
class LabelScanBox extends StatelessWidget {
const LabelScanBox({
Key? key,
}) : super(key: key);
Future<String> scan() async {
try {
var barcode = await BarcodeScanner.scan();
if (barcode.type.name == 'Cancelled') {
return 'cancel';
} else if (barcode.type.name == 'Failed') {
return 'error';
} // print(barcode.split('/'));
try {
var id = barcode.rawContent.contains('www.cssd-doc.com')
? barcode.rawContent.split('/')[5]
: barcode.rawContent;
return id;
} catch (_) {
return 'null';
}
} on PlatformException catch (_) {
return 'access';
} catch (_) {
return 'error';
}
// } on FormatException {
// setState(() => this.testCode =
// 'null (User returned using the "back"-button before scanning anything. Result)');
// } catch (e) {
// setState(() => this.testCode = 'Unknown error: $e');
// }
// return null;
}
@override
Widget build(BuildContext context) {
final _media = MediaQuery.of(context);
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Label Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
),
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Label/$result',
);
// Navigator.of(context).pushNamed(
// Routes.labelDetailScreen,
// arguments: result,
// );
}
},
);
},
);
}
}