adding i18n to all other pages batch3
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
// class ReportEditor extends StatefulWidget {
|
||||
// @override
|
||||
// _ReportEditorState createState() => _ReportEditorState();
|
||||
@@ -687,7 +689,8 @@ class _ReportEditorState extends State<ReportEditor> {
|
||||
await pdfFile.writeAsBytes(pdfBytes);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('PDF saved to ${pdfFile.path}'),
|
||||
content: Text(AppLocalizations.of(context)!
|
||||
.pdfSaved(pdfFile.path)),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -696,7 +699,8 @@ class _ReportEditorState extends State<ReportEditor> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: AppBar(title: Text('Report Editor')),
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context)!.reportEditor)),
|
||||
body: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
@@ -705,21 +709,27 @@ class _ReportEditorState extends State<ReportEditor> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text('Drag and Drop Fields:'),
|
||||
Text(AppLocalizations.of(context)!.dragDropFields),
|
||||
Draggable<String>(
|
||||
data: 'Title',
|
||||
child: DragField(text: 'Title'),
|
||||
feedback: DragField(text: 'Title'),
|
||||
child: DragField(
|
||||
text: AppLocalizations.of(context)!.dragTitle),
|
||||
feedback: DragField(
|
||||
text: AppLocalizations.of(context)!.dragTitle),
|
||||
),
|
||||
Draggable<String>(
|
||||
data: 'Phone Number',
|
||||
child: DragField(text: 'Phone Number'),
|
||||
feedback: DragField(text: 'Phone Number'),
|
||||
child: DragField(
|
||||
text: AppLocalizations.of(context)!.dragPhone),
|
||||
feedback: DragField(
|
||||
text: AppLocalizations.of(context)!.dragPhone),
|
||||
),
|
||||
Draggable<String>(
|
||||
data: 'Date',
|
||||
child: DragField(text: 'Date'),
|
||||
feedback: DragField(text: 'Date'),
|
||||
child: DragField(
|
||||
text: AppLocalizations.of(context)!.dragDate),
|
||||
feedback: DragField(
|
||||
text: AppLocalizations.of(context)!.dragDate),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -743,7 +753,8 @@ class _ReportEditorState extends State<ReportEditor> {
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Text('Scale Bar Report Editor'),
|
||||
child: Text(AppLocalizations.of(context)!
|
||||
.scaleBarTitle),
|
||||
),
|
||||
...droppedFields.asMap().entries.map((entry) {
|
||||
final index = entry.key;
|
||||
@@ -924,14 +935,17 @@ class _EditableFieldState extends State<EditableField> {
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: keyController,
|
||||
decoration: InputDecoration(labelText: 'Key'),
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context)!.keyLabel),
|
||||
onChanged: (value) {
|
||||
widget.onEdit(value, valueController.text);
|
||||
},
|
||||
),
|
||||
TextFormField(
|
||||
controller: valueController,
|
||||
decoration: InputDecoration(labelText: 'Value'),
|
||||
decoration: InputDecoration(
|
||||
labelText:
|
||||
AppLocalizations.of(context)!.valueLabel),
|
||||
onChanged: (value) {
|
||||
widget.onEdit(keyController.text, value);
|
||||
},
|
||||
@@ -955,7 +969,8 @@ class DraggableTarget extends StatelessWidget {
|
||||
child: DragTarget<String>(
|
||||
builder: (context, candidateData, rejectedData) {
|
||||
return Center(
|
||||
child: Text('Drop Here', style: TextStyle(fontSize: 24)),
|
||||
child: Text(AppLocalizations.of(context)!.dropHere,
|
||||
style: TextStyle(fontSize: 24)),
|
||||
);
|
||||
},
|
||||
onAccept: (String field) {
|
||||
|
||||
Reference in New Issue
Block a user