Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shakeebkhan66 committed Jun 5, 2024
1 parent f1602d5 commit eb87b98
Showing 1 changed file with 9 additions and 117 deletions.
126 changes: 9 additions & 117 deletions lib/utils/kwargs_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ class TableWidget extends StatefulWidget {

class _TableWidgetState extends State<TableWidget> {
TableRow _buildTableRow(
MapEntry<String, String> rowData,
// int index,
) {
int index = widget.tableData.indexOf(rowData);
MapEntry<String, String> rowData,
int index,
) {
return TableRow(
children: [
_buildTableCell(
TextFormField(
initialValue: rowData.key,
onChanged: (newValue) {
setState(() {
final index = widget.tableData.indexOf(rowData);
final updatedEntry = MapEntry<String, String>(newValue, rowData.value);
widget.tableData[index] = updatedEntry;
});
Expand All @@ -131,6 +131,7 @@ class _TableWidgetState extends State<TableWidget> {
initialValue: rowData.value,
onChanged: (newValue) {
setState(() {
final index = widget.tableData.indexOf(rowData);
final updatedEntry = MapEntry<String, String>(rowData.key, newValue);
widget.tableData[index] = updatedEntry;
});
Expand Down Expand Up @@ -202,120 +203,11 @@ class _TableWidgetState extends State<TableWidget> {
),
...widget.tableData.asMap().entries.map(
(entry) => _buildTableRow(
entry.value,
// entry.key,
),
),
entry.value,
entry.key,
),
),
],
);
}
}

// class _TableWidgetState extends State<TableWidget> {
// TableRow _buildTableRow(
// MapEntry<String, String> rowData,
// int index,
// ) {
// return TableRow(
// children: [
// _buildTableCell(
// TextFormField(
// initialValue: rowData.key,
// onChanged: (newValue) {
// setState(() {
// final index = widget.tableData.indexOf(rowData);
// final updatedEntry = MapEntry<String, String>(newValue, rowData.value);
// widget.tableData[index] = updatedEntry;
// });
// },
// decoration: const InputDecoration(
// border: InputBorder.none,
// contentPadding: EdgeInsets.all(8),
// ),
// ),
// ),
// _buildTableCell(
// TextFormField(
// initialValue: rowData.value,
// onChanged: (newValue) {
// setState(() {
// final index = widget.tableData.indexOf(rowData);
// final updatedEntry = MapEntry<String, String>(rowData.key, newValue);
// widget.tableData[index] = updatedEntry;
// });
// },
// decoration: const InputDecoration(
// border: InputBorder.none,
// contentPadding: EdgeInsets.all(8),
// ),
// ),
// ),
// _buildTableCell(
// IconButton(
// icon: const Icon(
// Icons.delete,
// color: Colors.red,
// ),
// onPressed: () {
// setState(() {
// widget.provider.removeRow(index);
// });
// },
// ),
// ),
// ],
// );
// }
//
// TableCell _buildTableCell(Widget child) {
// return TableCell(
// child: Container(
// alignment: Alignment.center,
// height: 50,
// child: child,
// ),
// );
// }
//
// @override
// Widget build(BuildContext context) {
// return Table(
// border: TableBorder.all(color: Colors.grey),
// columnWidths: const {
// 0: FixedColumnWidth(150),
// 1: FixedColumnWidth(150),
// 2: FixedColumnWidth(50),
// },
// children: [
// TableRow(
// children: [
// _buildTableCell(
// const Text(
// "Key",
// style: TextStyle(fontWeight: FontWeight.bold),
// ),
// ),
// _buildTableCell(
// const Text(
// "Value",
// style: TextStyle(fontWeight: FontWeight.bold),
// ),
// ),
// _buildTableCell(
// const Text(
// "",
// style: TextStyle(fontWeight: FontWeight.bold),
// ),
// ),
// ],
// ),
// ...widget.tableData.asMap().entries.map(
// (entry) => _buildTableRow(
// entry.value,
// entry.key,
// ),
// ),
// ],
// );
// }
// }

0 comments on commit eb87b98

Please sign in to comment.