adding i18n to all other pages
This commit is contained in:
@@ -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),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user