mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 01:08:54 +03:30
1.5.0
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,7 @@
|
|||||||
|
import 'package:barcode_scan/barcode_scan.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -130,32 +132,77 @@ class _CycleFilterScreenState extends State<CycleFilterScreen> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
TextFormField(
|
Row(
|
||||||
controller: cycleIdCTRL,
|
children: [
|
||||||
decoration: InputDecoration(
|
Flexible(
|
||||||
icon: Icon(
|
flex: 8,
|
||||||
FontAwesomeIcons.sortNumericDown,
|
child: TextFormField(
|
||||||
size: 6 * _deviceBlockSize,
|
controller: cycleIdCTRL,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
icon: Icon(
|
||||||
|
FontAwesomeIcons.sortNumericDown,
|
||||||
|
size: 6 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
labelStyle: TextStyle(
|
||||||
|
fontWeight: FontWeight.w100,
|
||||||
|
fontSize: 4 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
labelText: 'Cycle ID',
|
||||||
|
isDense: true,
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
vertical: 2, horizontal: 3),
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 5 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
onFieldSubmitted: (_) {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(_cycleNumberFocusNode);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
labelStyle: TextStyle(
|
// Spacer(),
|
||||||
fontWeight: FontWeight.w100,
|
Flexible(
|
||||||
fontSize: 4 * _deviceBlockSize,
|
flex: 1,
|
||||||
),
|
child: InkWell(
|
||||||
labelText: 'Cycle ID',
|
onTap: () {
|
||||||
isDense: true,
|
scan().then(
|
||||||
contentPadding: EdgeInsets.symmetric(
|
(String result) {
|
||||||
vertical: 2, horizontal: 3),
|
if (result == 'cancel') {
|
||||||
),
|
print('cancel');
|
||||||
style: TextStyle(
|
} else if (result == 'error') {
|
||||||
fontWeight: FontWeight.w700,
|
print('error');
|
||||||
fontSize: 5 * _deviceBlockSize,
|
} else if (result == 'access') {
|
||||||
),
|
print('access');
|
||||||
keyboardType: TextInputType.number,
|
} else {
|
||||||
textInputAction: TextInputAction.next,
|
print(result);
|
||||||
onFieldSubmitted: (_) {
|
cycleIdCTRL.text = result;
|
||||||
FocusScope.of(context)
|
// Navigator.of(context).pushNamed(
|
||||||
.requestFocus(_cycleNumberFocusNode);
|
// CycleDetailScreen.route,
|
||||||
},
|
// arguments: result,
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
FontAwesomeIcons.barcode,
|
||||||
|
size: 5 * _deviceBlockSize,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
@@ -255,3 +302,27 @@ class _CycleFilterScreenState extends State<CycleFilterScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:barcode_scan/barcode_scan.dart';
|
||||||
import 'package:cssd/config/routes.dart';
|
import 'package:cssd/config/routes.dart';
|
||||||
import 'package:cssd/models/label_models.dart';
|
import 'package:cssd/models/label_models.dart';
|
||||||
import 'package:cssd/providers/connectivity.dart';
|
import 'package:cssd/providers/connectivity.dart';
|
||||||
@@ -6,6 +7,7 @@ import 'package:cssd/widgets/Global/internet_error.dart';
|
|||||||
import 'package:cssd/widgets/LabelScreens/Filter/save_button.dart';
|
import 'package:cssd/widgets/LabelScreens/Filter/save_button.dart';
|
||||||
import 'package:cssd/widgets/LabelScreens/Filter/selector_box.dart';
|
import 'package:cssd/widgets/LabelScreens/Filter/selector_box.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
@@ -122,32 +124,76 @@ class _LabelFilterScreenState extends State<LabelFilterScreen> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
TextFormField(
|
Row(
|
||||||
controller: labelIdCTRl,
|
children: [
|
||||||
decoration: InputDecoration(
|
Flexible(
|
||||||
icon: Icon(
|
flex: 8,
|
||||||
FontAwesomeIcons.sortNumericDown,
|
child: TextFormField(
|
||||||
size: 6 * _deviceBlockSize,
|
controller: labelIdCTRl,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
icon: Icon(
|
||||||
|
FontAwesomeIcons.sortNumericDown,
|
||||||
|
size: 6 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
labelStyle: TextStyle(
|
||||||
|
fontWeight: FontWeight.w100,
|
||||||
|
fontSize: 4 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
labelText: 'Label ID',
|
||||||
|
isDense: true,
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
vertical: 2, horizontal: 3),
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 5 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
onFieldSubmitted: (_) {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(_cycleNumberFocusNode);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
labelStyle: TextStyle(
|
Flexible(
|
||||||
fontWeight: FontWeight.w100,
|
flex: 1,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
child: InkWell(
|
||||||
),
|
onTap: () {
|
||||||
labelText: 'Label ID',
|
scan().then(
|
||||||
isDense: true,
|
(String result) {
|
||||||
contentPadding: EdgeInsets.symmetric(
|
if (result == 'cancel') {
|
||||||
vertical: 2, horizontal: 3),
|
print('cancel');
|
||||||
),
|
} else if (result == 'error') {
|
||||||
style: TextStyle(
|
print('error');
|
||||||
fontWeight: FontWeight.w700,
|
} else if (result == 'access') {
|
||||||
fontSize: 5 * _deviceBlockSize,
|
print('access');
|
||||||
),
|
} else {
|
||||||
keyboardType: TextInputType.number,
|
print(result);
|
||||||
textInputAction: TextInputAction.next,
|
labelIdCTRl.text = result;
|
||||||
onFieldSubmitted: (_) {
|
// Navigator.of(context).pushNamed(
|
||||||
FocusScope.of(context)
|
// CycleDetailScreen.route,
|
||||||
.requestFocus(_cycleNumberFocusNode);
|
// arguments: result,
|
||||||
},
|
// );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
FontAwesomeIcons.barcode,
|
||||||
|
size: 5 * _deviceBlockSize,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
@@ -241,3 +287,26 @@ class _LabelFilterScreenState extends State<LabelFilterScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
import 'package:barcode_scan/barcode_scan.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -165,33 +167,78 @@ class _TestFilterScreenState extends State<TestFilterScreen> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
TextFormField(
|
Row(
|
||||||
controller: idCTRL,
|
children: [
|
||||||
decoration: InputDecoration(
|
Flexible(
|
||||||
icon: Icon(
|
flex: 8,
|
||||||
FontAwesomeIcons.sortNumericDown,
|
child: TextFormField(
|
||||||
size: 6 * _deviceBlockSize,
|
controller: idCTRL,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
icon: Icon(
|
||||||
|
FontAwesomeIcons.sortNumericDown,
|
||||||
|
size: 6 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
labelStyle: TextStyle(
|
||||||
|
fontWeight: FontWeight.w100,
|
||||||
|
fontSize: 4 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
labelText: 'ID',
|
||||||
|
isDense: true,
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
vertical: 2, horizontal: 3),
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 5 * _deviceBlockSize,
|
||||||
|
),
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
textInputAction: TextInputAction.next,
|
||||||
|
// onFieldSubmitted: (_) {
|
||||||
|
// FocusScope.of(context)
|
||||||
|
// .requestFocus(_cycleNumberFocusNode);
|
||||||
|
// },
|
||||||
|
),
|
||||||
),
|
),
|
||||||
labelStyle: TextStyle(
|
Flexible(
|
||||||
fontWeight: FontWeight.w100,
|
flex: 1,
|
||||||
fontSize: 4 * _deviceBlockSize,
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
scan().then(
|
||||||
|
(String result) {
|
||||||
|
if (result == 'cancel') {
|
||||||
|
print('cancel');
|
||||||
|
} else if (result == 'error') {
|
||||||
|
print('error');
|
||||||
|
} else if (result == 'access') {
|
||||||
|
print('access');
|
||||||
|
} else {
|
||||||
|
print(result);
|
||||||
|
idCTRL.text = result;
|
||||||
|
// Navigator.of(context).pushNamed(
|
||||||
|
// CycleDetailScreen.route,
|
||||||
|
// arguments: result,
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
FontAwesomeIcons.barcode,
|
||||||
|
size: 5 * _deviceBlockSize,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
labelText: 'ID',
|
],
|
||||||
isDense: true,
|
|
||||||
contentPadding: EdgeInsets.symmetric(
|
|
||||||
vertical: 2, horizontal: 3),
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
fontSize: 5 * _deviceBlockSize,
|
|
||||||
),
|
|
||||||
keyboardType: TextInputType.text,
|
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
// onFieldSubmitted: (_) {
|
|
||||||
// FocusScope.of(context)
|
|
||||||
// .requestFocus(_cycleNumberFocusNode);
|
|
||||||
// },
|
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 25,
|
height: 25,
|
||||||
),
|
),
|
||||||
@@ -347,3 +394,27 @@ class _TestFilterScreenState extends State<TestFilterScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:barcode_scan/barcode_scan.dart';
|
||||||
import 'package:cssd/config/routes.dart';
|
import 'package:cssd/config/routes.dart';
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:image_picker_gallery_camera/image_picker_gallery_camera.dart';
|
import 'package:image_picker_gallery_camera/image_picker_gallery_camera.dart';
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
import 'package:multiselect_formfield/multiselect_formfield.dart';
|
import 'package:multiselect_formfield/multiselect_formfield.dart';
|
||||||
@@ -119,7 +121,8 @@ class _FormCreatorState extends State<FormCreator> {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await Navigator.of(context).pushNamed(Routes.captureImageScreen);
|
await Navigator.of(context)
|
||||||
|
.pushNamed(Routes.captureImageScreen);
|
||||||
// await captureImage(context);
|
// await captureImage(context);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -164,21 +167,90 @@ class _FormCreatorState extends State<FormCreator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item['type'] == "Text") {
|
if (item['type'] == "Text") {
|
||||||
|
print(item['name']);
|
||||||
|
TextEditingController idCTRL = new TextEditingController();
|
||||||
|
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;
|
||||||
listWidgets.add(
|
listWidgets.add(
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: TextFormField(
|
child: item['name'] != 'Autoclave ID'
|
||||||
decoration: InputDecoration(
|
? TextFormField(
|
||||||
labelText: item['name'] ?? "",
|
controller: idCTRL,
|
||||||
border: UnderlineInputBorder(),
|
decoration: InputDecoration(
|
||||||
contentPadding: EdgeInsets.all(0),
|
labelText: item['name'] ?? "",
|
||||||
),
|
border: UnderlineInputBorder(),
|
||||||
initialValue: item['value'] ?? '',
|
contentPadding: EdgeInsets.all(0),
|
||||||
onChanged: (String value) {
|
),
|
||||||
formItems[count]['value'] = value;
|
initialValue: item['value'] ?? '',
|
||||||
_handleChanged();
|
onChanged: (String value) {
|
||||||
},
|
formItems[count]['value'] = value;
|
||||||
),
|
_handleChanged();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
flex: 8,
|
||||||
|
child: TextFormField(
|
||||||
|
controller: idCTRL,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: item['name'] ?? "",
|
||||||
|
border: UnderlineInputBorder(),
|
||||||
|
contentPadding: EdgeInsets.all(0),
|
||||||
|
),
|
||||||
|
initialValue: item['value'] ?? '',
|
||||||
|
onChanged: (String value) {
|
||||||
|
formItems[count]['value'] = value;
|
||||||
|
_handleChanged();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
flex: 1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
scan().then(
|
||||||
|
(String result) {
|
||||||
|
if (result == 'cancel') {
|
||||||
|
print('cancel');
|
||||||
|
} else if (result == 'error') {
|
||||||
|
print('error');
|
||||||
|
} else if (result == 'access') {
|
||||||
|
print('access');
|
||||||
|
} else {
|
||||||
|
print(result);
|
||||||
|
idCTRL.text = result;
|
||||||
|
formItems[count]['value'] = result;
|
||||||
|
_handleChanged();
|
||||||
|
// Navigator.of(context).pushNamed(
|
||||||
|
// CycleDetailScreen.route,
|
||||||
|
// arguments: result,
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
FontAwesomeIcons.barcode,
|
||||||
|
size: 5 * _deviceBlockSize,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -622,3 +694,27 @@ class ImageBox extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ description: A new Flutter project.
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.4.1+1
|
version: 1.5.0+2
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.2.2 <3.0.0"
|
sdk: ">=2.2.2 <3.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user