Skip to content

Commit 6d40625

Browse files
authored
Merge pull request #2 from SyncfusionExamples/Sample
Add divider between toolbar and the document
2 parents 400c551 + 9e922e9 commit 6d40625

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

lib/main.dart

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,23 @@ class _PdfViewerPageState extends State<PdfViewerPage> {
5252
Widget build(BuildContext context) {
5353
return Scaffold(
5454
appBar: AppBar(
55+
bottom: PreferredSize(
56+
preferredSize: const Size.fromHeight(0),
57+
child: Container(
58+
color: Theme.of(context).colorScheme.outlineVariant,
59+
height: 1,
60+
),
61+
),
5562
actions: [
56-
TextButton(
57-
style: TextButton.styleFrom(
58-
backgroundColor: Theme.of(context).colorScheme.onInverseSurface,
63+
Padding(
64+
padding: const EdgeInsets.only(right: 6),
65+
child: TextButton(
66+
style: TextButton.styleFrom(
67+
backgroundColor: Theme.of(context).colorScheme.onInverseSurface,
68+
),
69+
onPressed: () => _performSpellCheck(),
70+
child: const Text('Perform Spell Check'),
5971
),
60-
onPressed: () => _performSpellCheck(),
61-
child: const Text('Perform Spell Check'),
6272
),
6373
],
6474
),
@@ -116,14 +126,20 @@ class _PdfViewerPageState extends State<PdfViewerPage> {
116126
}
117127
}
118128

129+
/// Get the total count of misspelled words
130+
int count = 0;
131+
for (final MapEntry<int, List<TextWord>> entry in errorWords.entries) {
132+
count += entry.value.length;
133+
}
134+
119135
showDialog(
120136
context: context,
121137
builder: (BuildContext context) {
122138
return AlertDialog.adaptive(
123139
title: const Text('Spell Check Completed'),
124140
content: errorWords.isEmpty
125-
? const Text('No spell errors found')
126-
: const Text('Spell errors found'),
141+
? const Text('No spell errors found.')
142+
: Text('$count spelling errors found.'),
127143
actions: [
128144
TextButton(
129145
onPressed: () {

0 commit comments

Comments
 (0)