adding i18n to all other pages batch3
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../../providers/token_manager.dart';
|
||||
import 'dynamic_form_service.dart';
|
||||
|
||||
@@ -49,7 +50,7 @@ class _EditFormState extends State<EditForm> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Edit Form'),
|
||||
title: Text(AppLocalizations.of(context)!.editForm),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
@@ -58,16 +59,21 @@ class _EditFormState extends State<EditForm> {
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: formNameController,
|
||||
decoration: InputDecoration(labelText: 'Form Name'),
|
||||
decoration: InputDecoration(
|
||||
labelText:
|
||||
AppLocalizations.of(context)!.formName),
|
||||
),
|
||||
TextFormField(
|
||||
controller: formDescController,
|
||||
decoration: InputDecoration(labelText: 'Form Description'),
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context)!
|
||||
.formDescription),
|
||||
),
|
||||
DropdownButtonFormField<String>(
|
||||
value: relatedToController.text,
|
||||
decoration:
|
||||
const InputDecoration(labelText: 'Select Related To'),
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context)!
|
||||
.selectRelatedTo),
|
||||
items: [
|
||||
...relatedToFixedDropdown.map<DropdownMenuItem<String>>(
|
||||
(item) {
|
||||
@@ -86,8 +92,9 @@ class _EditFormState extends State<EditForm> {
|
||||
),
|
||||
DropdownButtonFormField<String>(
|
||||
value: pageEventController.text,
|
||||
decoration:
|
||||
const InputDecoration(labelText: 'Select Page Event'),
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context)!
|
||||
.selectPageEvent),
|
||||
items: [
|
||||
...pageEventFixedDropdown.map<DropdownMenuItem<String>>(
|
||||
(item) {
|
||||
@@ -106,22 +113,41 @@ class _EditFormState extends State<EditForm> {
|
||||
),
|
||||
TextFormField(
|
||||
controller: buttonCaptionController,
|
||||
decoration: InputDecoration(labelText: 'Button Caption'),
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(context)!
|
||||
.buttonCaption),
|
||||
),
|
||||
|
||||
const Text('Components Details'),
|
||||
Text(AppLocalizations.of(context)!.componentsDetails),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: DataTable(
|
||||
columns: const <DataColumn>[
|
||||
DataColumn(label: Text('Label')),
|
||||
DataColumn(label: Text('Type')),
|
||||
DataColumn(label: Text('Mapping')),
|
||||
DataColumn(label: Text('Mandatory')),
|
||||
DataColumn(label: Text('Readonly')),
|
||||
DataColumn(label: Text('Drop Values')),
|
||||
DataColumn(label: Text('SP')),
|
||||
DataColumn(label: Text('Actions'), numeric: false), // Add Actions column
|
||||
columns: <DataColumn>[
|
||||
DataColumn(
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.colLabel)),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.colType)),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.colMapping)),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.colMandatory)),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.colReadonly)),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.colDropValues)),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
AppLocalizations.of(context)!.colSP)),
|
||||
DataColumn(
|
||||
label: Text(AppLocalizations.of(context)!
|
||||
.colActions),
|
||||
numeric: false), // Add Actions column
|
||||
],
|
||||
rows: components.asMap().entries.map((entry) {
|
||||
final index = entry.key;
|
||||
@@ -228,7 +254,8 @@ class _EditFormState extends State<EditForm> {
|
||||
components.removeAt(index);
|
||||
});
|
||||
},
|
||||
child: Text('Delete'),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.delete),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -250,7 +277,7 @@ class _EditFormState extends State<EditForm> {
|
||||
});
|
||||
setState(() {}); // Refresh the UI to show the new row
|
||||
},
|
||||
child: Text('Add Row'),
|
||||
child: Text(AppLocalizations.of(context)!.addRow),
|
||||
),
|
||||
|
||||
ElevatedButton(
|
||||
@@ -266,7 +293,7 @@ class _EditFormState extends State<EditForm> {
|
||||
apiService.updateDynamicForm(token!, widget.formData['form_id'], widget.formData);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text('Update'),
|
||||
child: Text(AppLocalizations.of(context)!.update),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user