Skip to content

Commit f74608a

Browse files
author
LavanyaA
authored
Merge pull request #1219 from syncfusion-content/FLUT-958978-UG-docs-correction-phase-four-dev
FLUT-958978 - [Feature] Cleared grammatical issues for datagrid
2 parents a49cb29 + 77dab10 commit f74608a

30 files changed

+8182
-7749
lines changed

Flutter/datagrid/accessibility.md

Lines changed: 110 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: post
33
title: Accessibility in Flutter DataGrid | DataTable | Syncfusion
4-
description: Learn here all about the accessibility of the Syncfusion Flutter DataGrid (SfDataGrid) widget and more.
4+
description: Learn here all about the accessibility features of the Syncfusion Flutter DataGrid (SfDataGrid) widget and more.
55
platform: flutter
66
control: SfDataGrid
77
documentation: ug
@@ -11,28 +11,28 @@ documentation: ug
1111

1212
## Screen reader support
1313

14-
The `SfDataGrid` can be accessed easily by the screen readers in the following ways on Android and iOS platforms:
14+
The [SfDataGrid](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid-class.html) can be accessed easily by screen readers in the following ways on Android and iOS platforms:
1515

1616
* Cell contents can be read by tapping the required cell.
17-
* Read the adjacent cell's content by swiping right or left.
18-
* Scroll the Datagrid vertically and horizontally by dragging two fingers.
17+
* Read adjacent cell content by swiping right or left.
18+
* Scroll the DataGrid vertically and horizontally by dragging with two fingers.
1919

2020
## Sufficient contrast
2121

22-
The `SfDataGrid` provides sufficient color contrast to make the cell content easier. Use the following properties to customize the appearance of the datagrid elements.
22+
The [SfDataGrid](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid-class.html) provides sufficient color contrast to make cell content more readable. Use the following properties to customize the appearance of the DataGrid elements:
2323

24-
* [currentCellStyle](https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfDataGridThemeData/currentCellStyle.html)
25-
* [frozenPaneElevation](https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfDataGridThemeData/frozenPaneElevation.html)
26-
* [frozenPaneLineColor](https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfDataGridThemeData/frozenPaneLineColor.html)
27-
* [gridLineColor](https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfDataGridThemeData/gridLineColor.html)
28-
* [headerColor](https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfDataGridThemeData/headerColor.html)
29-
* [headerHoverColor](https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfDataGridThemeData/headerHoverColor.html)
30-
* [selectionColor](https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfDataGridThemeData/selectionColor.html)
31-
* [sortIconColor](https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfDataGridThemeData/sortIconColor.html)
24+
* [currentCellStyle](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/DataGridCurrentCellStyle-class.html)
25+
* [frozenPaneElevation](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/frozenPaneElevation.html)
26+
* [frozenPaneLineColor](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/frozenPaneLineColor.html)
27+
* [gridLineColor](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/gridLineColor.html)
28+
* [headerColor](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/headerColor.html)
29+
* [headerHoverColor](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/headerHoverColor.html)
30+
* [selectionColor](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/selectionColor.html)
31+
* [sortIconColor](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/sortIconColor.html)
3232

3333
## Large fonts
3434

35-
As `SfDataGrid` gets the widget from the user end for each cell, the font size in that widget will be automatically changed based on OS settings in Android and iOS platforms. To view the cell content clearly, the row heights in the Datagrid will be automatically adjusted based on the `MediaQueryData.textScaleFactor`.
35+
Since [SfDataGrid](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid-class.html) receives widgets from the user for each cell, the font size in those widgets will automatically adjust based on OS settings in Android and iOS platforms. To ensure cell content remains clearly visible, the row heights in the DataGrid will automatically adjust based on the `MediaQueryData.textScaleFactor`.
3636

3737
{% tabs %}
3838
{% highlight Dart %}
@@ -42,57 +42,69 @@ import 'package:syncfusion_flutter_datagrid/datagrid.dart';
4242
@override
4343
Widget build(BuildContext context) {
4444
return MediaQuery(
45-
data: MediaQueryData(textScaleFactor: 1.5),
46-
child: SfDataGrid(source: _employeeDataSource, columns: <GridColumn>[
45+
data: MediaQueryData(textScaleFactor: 1.5),
46+
child: SfDataGrid(
47+
source: _employeeDataSource,
48+
columns: <GridColumn>[
4749
GridColumn(
48-
columnName: 'id',
49-
label: Container(
50-
padding: EdgeInsets.symmetric(horizontal: 16.0),
51-
alignment: Alignment.centerRight,
52-
child: Text(
53-
'ID',
54-
overflow: TextOverflow.ellipsis,
55-
))),
50+
columnName: 'id',
51+
label: Container(
52+
padding: EdgeInsets.symmetric(horizontal: 16.0),
53+
alignment: Alignment.centerRight,
54+
child: Text(
55+
'ID',
56+
overflow: TextOverflow.ellipsis,
57+
)
58+
)
59+
),
5660
GridColumn(
57-
columnName: 'name',
58-
label: Container(
59-
padding: EdgeInsets.symmetric(horizontal: 16.0),
60-
alignment: Alignment.centerLeft,
61-
child: Text(
62-
'Name',
63-
overflow: TextOverflow.ellipsis,
64-
))),
61+
columnName: 'name',
62+
label: Container(
63+
padding: EdgeInsets.symmetric(horizontal: 16.0),
64+
alignment: Alignment.centerLeft,
65+
child: Text(
66+
'Name',
67+
overflow: TextOverflow.ellipsis,
68+
)
69+
)
70+
),
6571
GridColumn(
66-
columnName: 'salary',
67-
label: Container(
68-
padding: EdgeInsets.symmetric(horizontal: 16.0),
69-
alignment: Alignment.centerRight,
70-
child: Text(
71-
'Salary',
72-
overflow: TextOverflow.ellipsis,
73-
))),
72+
columnName: 'salary',
73+
label: Container(
74+
padding: EdgeInsets.symmetric(horizontal: 16.0),
75+
alignment: Alignment.centerRight,
76+
child: Text(
77+
'Salary',
78+
overflow: TextOverflow.ellipsis,
79+
)
80+
)
81+
),
7482
GridColumn(
75-
columnName: 'designation',
76-
label: Container(
77-
padding: EdgeInsets.symmetric(horizontal: 16.0),
78-
alignment: Alignment.centerLeft,
79-
child: Text(
80-
'Designation',
81-
overflow: TextOverflow.ellipsis,
82-
)))
83-
]));
83+
columnName: 'designation',
84+
label: Container(
85+
padding: EdgeInsets.symmetric(horizontal: 16.0),
86+
alignment: Alignment.centerLeft,
87+
child: Text(
88+
'Designation',
89+
overflow: TextOverflow.ellipsis,
90+
)
91+
)
92+
)
93+
]
94+
)
95+
);
8496
}
8597

8698
{% endhighlight %}
8799
{% endtabs %}
88100

89101
## Keyboard navigation
90102

91-
The `SfDataGrid` provides keyboard navigation support when the [selectionMode](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/selectionMode.html) and [navigationMode](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/navigationMode.html) are enabled. Refer to this [link](https://help.syncfusion.com/flutter/datagrid/selection#keyboard-behavior) for supported keys and their purpose.
103+
The [SfDataGrid](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid-class.html) provides keyboard navigation support when the [selectionMode](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/selectionMode.html) and [navigationMode](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/navigationMode.html) are enabled. Refer to this [link](https://help.syncfusion.com/flutter/datagrid/selection#keyboard-behavior) for supported keys and their purpose.
92104

93105
## Visual density
94106

95-
The row heights in `SfDataGrid` will be automatically adjusted based on the [visualDensity](https://api.flutter.dev/flutter/material/ThemeData/visualDensity.html).
107+
The row heights in [SfDataGrid](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid-class.html) will automatically adjust based on the [visualDensity](https://api.flutter.dev/flutter/material/ThemeData/visualDensity.html) property.
96108

97109
{% tabs %}
98110
{% highlight Dart %}
@@ -103,45 +115,57 @@ import 'package:syncfusion_flutter_datagrid/datagrid.dart';
103115
@override
104116
Widget build(BuildContext context) {
105117
return Theme(
106-
data: ThemeData(visualDensity: VisualDensity.compact),
107-
child: SfDataGrid(source: _employeeDataSource, columns: <GridColumn>[
118+
data: ThemeData(visualDensity: VisualDensity.compact),
119+
child: SfDataGrid(
120+
source: _employeeDataSource,
121+
columns: <GridColumn>[
108122
GridColumn(
109-
columnName: 'id',
110-
label: Container(
111-
padding: EdgeInsets.symmetric(horizontal: 16.0),
112-
alignment: Alignment.centerRight,
113-
child: Text(
114-
'ID',
115-
overflow: TextOverflow.ellipsis,
116-
))),
123+
columnName: 'id',
124+
label: Container(
125+
padding: EdgeInsets.symmetric(horizontal: 16.0),
126+
alignment: Alignment.centerRight,
127+
child: Text(
128+
'ID',
129+
overflow: TextOverflow.ellipsis,
130+
)
131+
)
132+
),
117133
GridColumn(
118-
columnName: 'name',
119-
label: Container(
120-
padding: EdgeInsets.symmetric(horizontal: 16.0),
121-
alignment: Alignment.centerLeft,
122-
child: Text(
123-
'Name',
124-
overflow: TextOverflow.ellipsis,
125-
))),
134+
columnName: 'name',
135+
label: Container(
136+
padding: EdgeInsets.symmetric(horizontal: 16.0),
137+
alignment: Alignment.centerLeft,
138+
child: Text(
139+
'Name',
140+
overflow: TextOverflow.ellipsis,
141+
)
142+
)
143+
),
126144
GridColumn(
127-
columnName: 'salary',
128-
label: Container(
129-
padding: EdgeInsets.symmetric(horizontal: 16.0),
130-
alignment: Alignment.centerRight,
131-
child: Text(
132-
'Salary',
133-
overflow: TextOverflow.ellipsis,
134-
))),
145+
columnName: 'salary',
146+
label: Container(
147+
padding: EdgeInsets.symmetric(horizontal: 16.0),
148+
alignment: Alignment.centerRight,
149+
child: Text(
150+
'Salary',
151+
overflow: TextOverflow.ellipsis,
152+
)
153+
)
154+
),
135155
GridColumn(
136-
columnName: 'designation',
137-
label: Container(
138-
padding: EdgeInsets.symmetric(horizontal: 16.0),
139-
alignment: Alignment.centerLeft,
140-
child: Text(
141-
'Designation',
142-
overflow: TextOverflow.ellipsis,
143-
)))
144-
]));
156+
columnName: 'designation',
157+
label: Container(
158+
padding: EdgeInsets.symmetric(horizontal: 16.0),
159+
alignment: Alignment.centerLeft,
160+
child: Text(
161+
'Designation',
162+
overflow: TextOverflow.ellipsis,
163+
)
164+
)
165+
)
166+
]
167+
)
168+
);
145169
}
146170

147171
{% endhighlight %}

Flutter/datagrid/column-drag-and-drop.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ class EmployeeDataSource extends DataGridSource {
4747
void buildDataGridRows() {
4848
dataGridRows = employees.map<DataGridRow>((employee) {
4949
return DataGridRow(
50-
cells: columns.map<DataGridCell>((column) {
51-
return DataGridCell(
52-
columnName: column.columnName,
53-
value: employee[column.columnName],
54-
);
55-
}).toList());
50+
cells: columns.map<DataGridCell>((column) {
51+
return DataGridCell(
52+
columnName: column.columnName,
53+
value: employee[column.columnName],
54+
);
55+
}).toList());
5656
}).toList();
5757
}
5858

@@ -66,14 +66,14 @@ class EmployeeDataSource extends DataGridSource {
6666
@override
6767
DataGridRowAdapter? buildRow(DataGridRow row) {
6868
return DataGridRowAdapter(
69-
cells: row.getCells().map((dataGridCell) {
70-
return Container(
69+
cells: row.getCells().map((dataGridCell) {
70+
return Container(
7171
alignment: Alignment.center,
7272
padding: const EdgeInsets.symmetric(horizontal: 8.0),
7373
child: Text(
7474
dataGridCell.value.toString(),
7575
));
76-
}).toList());
76+
}).toList());
7777
}
7878

7979
refreshDataGrid() {
@@ -118,7 +118,7 @@ You can cancel the column dropping at a specific column by returning `false` fro
118118
allowColumnsDragging: true,
119119
columns: columns,
120120
onColumnDragging: (DataGridColumnDragDetails details) {
121-
if (details.action == DataGridColumnDragAction.update &&
121+
if (details.action == DataGridColumnDragAction.update &&
122122
details.to == 2) {
123123
return false;
124124
}
@@ -127,8 +127,8 @@ You can cancel the column dropping at a specific column by returning `false` fro
127127
final GridColumn rearrangeColumn = columns[details.from];
128128
columns.removeAt(details.from);
129129
columns.insert(details.to!, rearrangeColumn);
130-
employeeDataSource.buildDataGridRow();
131-
employeeDataSource.updateDtaGrid();
130+
employeeDataSource.buildDataGridRows();
131+
employeeDataSource.refreshDataGrid();
132132
}
133133
return true;
134134
},
@@ -162,22 +162,22 @@ The DataGrid allows you to change the drag feedback widget by returning a custom
162162
child: const Center(
163163
child: DefaultTextStyle(
164164
style: TextStyle(
165-
fontSize: 14,
166-
color: Colors.pink,
167-
fontWeight: FontWeight.bold),
165+
fontSize: 14,
166+
color: Colors.pink,
167+
fontWeight: FontWeight.bold),
168168
child: Text('Drag View'),
169169
),
170170
),
171171
);
172172
},
173173
onColumnDragging: (DataGridColumnDragDetails details) {
174-
if (details.action == DataGridColumnDragAction.dropped &&
174+
if (details.action == DataGridColumnDragAction.dropped &&
175175
details.to != null) {
176176
final GridColumn rearrangeColumn = columns[details.from];
177177
columns.removeAt(details.from);
178178
columns.insert(details.to!, rearrangeColumn);
179-
employeeDataSource.buildDataGridRow();
180-
employeeDataSource.updateDtaGrid();
179+
employeeDataSource.buildDataGridRows();
180+
employeeDataSource.refreshDataGrid();
181181
}
182182
return true;
183183
},
@@ -215,8 +215,8 @@ The following code describes how to change the drag indicator color and thicknes
215215
appBar: AppBar(title: const Text('Syncfusion Flutter DataGrid')),
216216
body: SfDataGridTheme(
217217
data: SfDataGridThemeData(
218-
columnDragIndicatorColor: Colors.pink,
219-
columnDragIndicatorStrokeWidth: 3),
218+
columnDragIndicatorColor: Colors.pink,
219+
columnDragIndicatorStrokeWidth: 3),
220220
child: SfDataGrid(
221221
source: employeeDataSource,
222222
allowColumnsDragging: true,

0 commit comments

Comments
 (0)