adding i18n to all other pages

This commit is contained in:
Azmat-7860
2026-10-03 11:22:48 +05:30
parent 47656678e1
commit 3fbeb606a8
22 changed files with 2526 additions and 249 deletions
@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
// OLD: import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart'; // removed no namespace AGP8 - by Azmat
import 'package:mobile_scanner/mobile_scanner.dart'; // migrated for AGP8 Java17 - by Azmat
import '../../../l10n/app_localizations.dart';
class BarcodeScreen extends StatefulWidget {
const BarcodeScreen({super.key});
@@ -22,7 +24,8 @@ class _BarcodeScreenState extends State<BarcodeScreen> {
context,
MaterialPageRoute(
builder: (context) => Scaffold(
appBar: AppBar(title: const Text('Scan Barcode')),
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.scanBarcode)),
body: MobileScanner(
controller: barCodeController,
onDetect: (capture) => Navigator.pop(
@@ -47,7 +50,8 @@ class _BarcodeScreenState extends State<BarcodeScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('BAR CODE')),
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.barCode)),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
@@ -56,8 +60,8 @@ class _BarcodeScreenState extends State<BarcodeScreen> {
child: Center(
child: Column(
children: [
const Text(
'Scanned Barcode:',
Text(
AppLocalizations.of(context)!.scannedBarcode,
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 10),
@@ -71,7 +75,8 @@ class _BarcodeScreenState extends State<BarcodeScreen> {
scanBarcode(); // Trigger barcode scanning
},
icon: const Icon(Icons.camera_alt), // Camera icon
label: const Text('Scan Barcode'),
label: Text(
AppLocalizations.of(context)!.scanBarcode),
),
const SizedBox(height: 16),
],
@@ -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),
),
],
),
@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
// OLD: import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart'; // removed no namespace AGP8 - by Azmat
import 'package:mobile_scanner/mobile_scanner.dart'; // migrated for AGP8 Java17 - by Azmat
import '../../../l10n/app_localizations.dart';
class qrcodeScreen extends StatefulWidget {
const qrcodeScreen({super.key});
@@ -22,7 +24,8 @@ class _qrcodeScreenState extends State<qrcodeScreen> {
context,
MaterialPageRoute(
builder: (context) => Scaffold(
appBar: AppBar(title: const Text('Scan QR')),
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.scanQR)),
body: MobileScanner(
controller: qrCodeController,
onDetect: (capture) => Navigator.pop(
@@ -47,7 +50,8 @@ class _qrcodeScreenState extends State<qrcodeScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('QR Code')),
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.qrCode)),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
@@ -56,8 +60,8 @@ class _qrcodeScreenState extends State<qrcodeScreen> {
child: Center(
child: Column(
children: [
const Text(
'Scanned QRcode:',
Text(
AppLocalizations.of(context)!.scannedQRCode,
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 10),
@@ -71,7 +75,8 @@ class _qrcodeScreenState extends State<qrcodeScreen> {
scanQRcode(); // Trigger barcode scanning
},
icon: const Icon(Icons.camera_alt), // Camera icon
label: const Text('Scan QRcode'),
label: Text(
AppLocalizations.of(context)!.scanQRCode),
),
const SizedBox(height: 16),
],