forked from eatvio/eatvio_app
fix: ui overflow nav-bar, name files in chat, qr-code scanner in dev-tools, message field size, keyboard type
This commit is contained in:
@@ -25,61 +25,63 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
|
||||
title: const Text('Сканирование штрихкода'),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: MobileScanner(
|
||||
controller: _controller,
|
||||
onDetect: (capture) {
|
||||
final List<Barcode> barcodes = capture.barcodes;
|
||||
if (barcodes.isEmpty) return;
|
||||
final rawValue = barcodes.first.rawValue;
|
||||
if (rawValue == null || rawValue == _detectedBarcode) return;
|
||||
setState(() {
|
||||
_detectedBarcode = rawValue;
|
||||
});
|
||||
},
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: MobileScanner(
|
||||
controller: _controller,
|
||||
onDetect: (capture) {
|
||||
final List<Barcode> barcodes = capture.barcodes;
|
||||
if (barcodes.isEmpty) return;
|
||||
final rawValue = barcodes.first.rawValue;
|
||||
if (rawValue == null || rawValue == _detectedBarcode) return;
|
||||
setState(() {
|
||||
_detectedBarcode = rawValue;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFF6F6F6),
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
'Найденный штрихкод',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
_detectedBarcode ?? 'Наведите камеру на штрихкод',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: _detectedBarcode == null ? Colors.grey : Colors.black,
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFF6F6F6),
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
'Найденный штрихкод',
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (_detectedBarcode != null)
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(_detectedBarcode);
|
||||
},
|
||||
child: const Text('Использовать штрихкод'),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
_detectedBarcode ?? 'Наведите камеру на штрихкод',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: _detectedBarcode == null ? Colors.grey : Colors.black,
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 16),
|
||||
if (_detectedBarcode != null)
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(_detectedBarcode);
|
||||
},
|
||||
child: const Text('Использовать штрихкод'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user