adding i18n to all other pages
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:barcode_widget/barcode_widget.dart';
|
||||
|
||||
import '../Barcode/Barcode_create_entity_screen.dart';
|
||||
import '../Qrcode/Qrcode_create_entity_screen.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
class QrBarCodeScreen extends StatefulWidget {
|
||||
const QrBarCodeScreen({super.key});
|
||||
@@ -26,7 +27,7 @@ class _QrBarCodeScreenState extends State<QrBarCodeScreen> {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Generated QR Code'),
|
||||
title: Text(AppLocalizations.of(context)!.generatedQrCode),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -45,7 +46,7 @@ class _QrBarCodeScreenState extends State<QrBarCodeScreen> {
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(); // Close the dialog
|
||||
},
|
||||
child: const Text('Close'),
|
||||
child: Text(AppLocalizations.of(context)!.close),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -62,7 +63,8 @@ class _QrBarCodeScreenState extends State<QrBarCodeScreen> {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Generated Bar Code'),
|
||||
title: Text(
|
||||
AppLocalizations.of(context)!.generatedBarCode),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -87,7 +89,7 @@ class _QrBarCodeScreenState extends State<QrBarCodeScreen> {
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(); // Close the dialog
|
||||
},
|
||||
child: const Text('Close'),
|
||||
child: Text(AppLocalizations.of(context)!.close),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -104,7 +106,9 @@ class _QrBarCodeScreenState extends State<QrBarCodeScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('QR AND BAR CODE')),
|
||||
appBar: AppBar(
|
||||
title:
|
||||
Text(AppLocalizations.of(context)!.qrAndBarCode)),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
@@ -115,27 +119,34 @@ class _QrBarCodeScreenState extends State<QrBarCodeScreen> {
|
||||
// GENERATE QR CODE
|
||||
TextFormField(
|
||||
controller: qr_code_dataController,
|
||||
decoration: const InputDecoration(labelText: 'qr_code_data'),
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context)!
|
||||
.qrCodeData),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
_showqr_code_dataDialog();
|
||||
},
|
||||
child: const Text('Generate Qr')),
|
||||
child: Text(AppLocalizations.of(context)!
|
||||
.generateQr)),
|
||||
|
||||
// GENERATE BAR CODE
|
||||
TextFormField(
|
||||
controller: bar_code_dataController,
|
||||
decoration: const InputDecoration(labelText: 'Bar Code Data'),
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context)!
|
||||
.barCodeData),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
_show_bar_code_dataDialog(bar_code_dataController.text);
|
||||
},
|
||||
child: const Text('Generate Bar code'),
|
||||
child: Text(AppLocalizations.of(context)!
|
||||
.generateBarCode),
|
||||
),
|
||||
|
||||
// QR CODE SCANNER
|
||||
|
||||
const SizedBox(height: 16),
|
||||
@@ -146,7 +157,8 @@ class _QrBarCodeScreenState extends State<QrBarCodeScreen> {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const qrcodeScreen()));
|
||||
},
|
||||
child: const Text('QR Code Scanner'),
|
||||
child: Text(AppLocalizations.of(context)!
|
||||
.qrCodeScanner),
|
||||
),
|
||||
// BAR CODE SCANNER
|
||||
|
||||
@@ -158,7 +170,8 @@ class _QrBarCodeScreenState extends State<QrBarCodeScreen> {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const BarcodeScreen()));
|
||||
},
|
||||
child: const Text('Bar Code Scanner'),
|
||||
child: Text(AppLocalizations.of(context)!
|
||||
.barCodeScanner),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user