From 2786c81047b71455074a7df538814eb1da2c30ed Mon Sep 17 00:00:00 2001 From: immankumarsync Date: Tue, 8 Oct 2024 13:16:32 +0530 Subject: [PATCH] Add divider between toolbar and the document --- lib/main.dart | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index d77e458..f27d002 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -52,13 +52,23 @@ class _PdfViewerPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( + bottom: PreferredSize( + preferredSize: const Size.fromHeight(0), + child: Container( + color: Theme.of(context).colorScheme.outlineVariant, + height: 1, + ), + ), actions: [ - TextButton( - style: TextButton.styleFrom( - backgroundColor: Theme.of(context).colorScheme.onInverseSurface, + Padding( + padding: const EdgeInsets.only(right: 6), + child: TextButton( + style: TextButton.styleFrom( + backgroundColor: Theme.of(context).colorScheme.onInverseSurface, + ), + onPressed: () => _performSpellCheck(), + child: const Text('Perform Spell Check'), ), - onPressed: () => _performSpellCheck(), - child: const Text('Perform Spell Check'), ), ], ), @@ -116,14 +126,20 @@ class _PdfViewerPageState extends State { } } + /// Get the total count of misspelled words + int count = 0; + for (final MapEntry> entry in errorWords.entries) { + count += entry.value.length; + } + showDialog( context: context, builder: (BuildContext context) { return AlertDialog.adaptive( title: const Text('Spell Check Completed'), content: errorWords.isEmpty - ? const Text('No spell errors found') - : const Text('Spell errors found'), + ? const Text('No spell errors found.') + : Text('$count spelling errors found.'), actions: [ TextButton( onPressed: () {