@@ -39,99 +39,100 @@ class _AppState extends State<App> {
3939
4040 return Material (
4141 child: Scaffold (
42- body: Column (
43- mainAxisAlignment: MainAxisAlignment .start,
44- children: [
45- LanguageToolTextField (
46- controller: spellCheckController,
47- language: 'en-US' ,
48- mistakePopup: MistakePopup (
49- popupRenderer: PopupOverlayRenderer (),
50- mistakeBuilder: _mistakeBuilder,
42+ body: SingleChildScrollView (
43+ child: Column (
44+ children: [
45+ LanguageToolTextField (
46+ controller: spellCheckController,
47+ language: 'en-US' ,
48+ mistakePopup: MistakePopup (
49+ popupRenderer: PopupOverlayRenderer (),
50+ mistakeBuilder: _mistakeBuilder,
51+ ),
5152 ),
52- ),
53- ValueListenableBuilder (
54- valueListenable : spellCheckController,
55- builder : (_, __, ___) => CheckboxListTile (
56- title : const Text ( "Enable spell checking" ) ,
57- value : spellCheckController.isEnabled,
58- onChanged : (value) =>
59- spellCheckController.isEnabled = value ?? false ,
53+ ValueListenableBuilder (
54+ valueListenable : spellCheckController,
55+ builder : (_, __, ___) => CheckboxListTile (
56+ title : const Text ( "Enable spell checking" ),
57+ value : spellCheckController.isEnabled ,
58+ onChanged : (value) =>
59+ spellCheckController.isEnabled = value ?? false ,
60+ ) ,
6061 ),
61- ),
62- const SizedBox (height : 20 ),
63- Card (
64- margin : const EdgeInsets . all ( 16 ),
65- child : Padding (
66- padding : const EdgeInsets . all ( 16 ),
67- child : Column (
68- mainAxisSize : MainAxisSize .min ,
69- crossAxisAlignment : CrossAxisAlignment .start,
70- children : [
71- const Text (
72- 'Dictionary' ,
73- style : TextStyle (
74- fontSize : 18 ,
75- fontWeight : FontWeight .bold ,
62+ const SizedBox (height : 20 ),
63+ Card (
64+ margin : const EdgeInsets . all ( 16 ),
65+ child : Padding (
66+ padding : const EdgeInsets . all ( 16 ),
67+ child : Column (
68+ mainAxisSize : MainAxisSize .min,
69+ crossAxisAlignment : CrossAxisAlignment .start ,
70+ children : [
71+ const Text (
72+ 'Dictionary' ,
73+ style : TextStyle (
74+ fontSize : 18 ,
75+ fontWeight : FontWeight .bold ,
76+ ) ,
7677 ),
77- ),
78- const SizedBox (height: 16 ),
79- Row (
80- children: [
81- Expanded (
82- child: TextField (
83- controller: _addWordController,
84- decoration: const InputDecoration (
85- labelText: 'Add word to dictionary' ,
86- border: OutlineInputBorder (),
78+ const SizedBox (height: 16 ),
79+ Row (
80+ children: [
81+ Expanded (
82+ child: TextField (
83+ controller: _addWordController,
84+ decoration: const InputDecoration (
85+ labelText: 'Add word to dictionary' ,
86+ border: OutlineInputBorder (),
87+ ),
88+ onSubmitted: (_) => _addWord (),
8789 ),
88- onSubmitted: (_) => _addWord (),
8990 ),
90- ),
91- const SizedBox (width: 8 ),
92- ElevatedButton (
93- onPressed: _addWord,
94- child: const Text ('Add' ),
95- ),
96- ],
97- ),
98- const SizedBox (height: 16 ),
99- Row (
100- mainAxisAlignment: MainAxisAlignment .spaceBetween,
101- children: [
102- Text (
103- 'Dictionary Words (${_dictionary .length })' ,
104- style: const TextStyle (fontWeight: FontWeight .w500),
105- ),
106- if (_dictionary.isNotEmpty)
107- TextButton (
108- onPressed: _clearAllWords,
109- child: const Text ('Clear All' ),
91+ const SizedBox (width: 8 ),
92+ ElevatedButton (
93+ onPressed: _addWord,
94+ child: const Text ('Add' ),
11095 ),
111- ],
112- ),
113- const SizedBox (height: 8 ),
114- if (_dictionary.isEmpty)
115- const Center (
116- child: Text (
117- 'No words in dictionary' ,
118- style: TextStyle (color: Colors .grey),
119- ),
120- )
121- else
122- for (final word in _dictionary)
123- ListTile (
124- title: Text (word),
125- trailing: IconButton (
126- icon: const Icon (Icons .delete),
127- onPressed: () => _removeWord (word),
96+ ],
97+ ),
98+ const SizedBox (height: 16 ),
99+ Row (
100+ mainAxisAlignment: MainAxisAlignment .spaceBetween,
101+ children: [
102+ Text (
103+ 'Dictionary Words (${_dictionary .length })' ,
104+ style: const TextStyle (fontWeight: FontWeight .w500),
128105 ),
129- ),
130- ],
106+ if (_dictionary.isNotEmpty)
107+ TextButton (
108+ onPressed: _clearAllWords,
109+ child: const Text ('Clear All' ),
110+ ),
111+ ],
112+ ),
113+ const SizedBox (height: 8 ),
114+ if (_dictionary.isEmpty)
115+ const Center (
116+ child: Text (
117+ 'No words in dictionary' ,
118+ style: TextStyle (color: Colors .grey),
119+ ),
120+ )
121+ else
122+ for (final word in _dictionary)
123+ ListTile (
124+ title: Text (word),
125+ trailing: IconButton (
126+ icon: const Icon (Icons .delete),
127+ onPressed: () => _removeWord (word),
128+ ),
129+ ),
130+ ],
131+ ),
131132 ),
132133 ),
133- ) ,
134- ] ,
134+ ] ,
135+ ) ,
135136 ),
136137 ),
137138 );
0 commit comments