@@ -186,8 +186,8 @@ class _EditorPageState extends State<EditorPage> {
186
186
},
187
187
onAutoComplete: (String lastToken) {
188
188
autoComplete = [];
189
- for (var module in ModulesManager .modules){
190
- autoComplete.addAll (module.onAutoComplete (language, lastToken));
189
+ for (var module in ModulesManager .modules) {
190
+ autoComplete.addAll (module.onAutoComplete (language, lastToken));
191
191
}
192
192
setState (() {
193
193
autoCompleteShown = true ;
@@ -199,7 +199,7 @@ class _EditorPageState extends State<EditorPage> {
199
199
autoCompleteY = offset.dy + 64 ;
200
200
});
201
201
},
202
- onUnAutoComplete: (){
202
+ onUnAutoComplete: () {
203
203
setState (() {
204
204
autoCompleteShown = false ;
205
205
});
@@ -242,17 +242,17 @@ class _EditorPageState extends State<EditorPage> {
242
242
List <Widget > result = List .generate (autoComplete.length, (index) {
243
243
var item = autoComplete[index].split ("|" );
244
244
var type = "undefined" , name = "name" , desc = "undefined" ;
245
- if (item.isNotEmpty) {
245
+ if (item.isNotEmpty) {
246
246
type = item.length > 1 ? item[0 ] : "undefined" ;
247
247
name = item.length > 1 ? item[1 ] : item[0 ];
248
248
desc = item.length > 2 ? item[2 ] : "" ;
249
249
}
250
250
var color = Colors .black12;
251
- switch (type){
251
+ switch (type) {
252
252
case "var" :
253
253
color = Colors .blueAccent;
254
254
break ;
255
- case "func " :
255
+ case "function " :
256
256
color = Colors .purpleAccent;
257
257
break ;
258
258
case "type" :
@@ -262,43 +262,56 @@ class _EditorPageState extends State<EditorPage> {
262
262
color = Colors .redAccent;
263
263
break ;
264
264
}
265
- return InkWell (
266
- //style: TextStyle(padding: MaterialStateProperty.all(EdgeInsets.zero)),
267
- child: Row (
268
- children: [
269
- Container (
270
- color: color,
271
- child: Text (
272
- type.characters.first,
273
- textAlign: TextAlign .center,
274
- ),
275
- padding: const EdgeInsets .all (8.0 ),
276
- margin: const EdgeInsets .only (right: 8.0 ),
277
- width: 32 ,
278
- ),
279
- Text (
280
- name,
265
+ return Tooltip (
266
+ verticalOffset: 200 ,
267
+ message: desc,
268
+ child: InkWell (
269
+ //style: TextStyle(padding: MaterialStateProperty.all(EdgeInsets.zero)),
270
+ child: Row (
271
+ children: [
272
+ Container (
273
+ color: color,
274
+ child: Text (
275
+ type.characters.first,
276
+ textAlign: TextAlign .center,
277
+ ),
278
+ padding: const EdgeInsets .all (8.0 ),
279
+ margin: const EdgeInsets .only (right: 8.0 ),
280
+ width: 32 ,
281
+ ),
282
+ Text (
283
+ name,
284
+ ),
285
+ const Spacer (
286
+ flex: 1 ,
287
+ ),
288
+ Flexible (
289
+ child: Text (
290
+ desc,
291
+ overflow: TextOverflow .ellipsis,
292
+ textAlign: TextAlign .end,
293
+ ),
294
+ fit: FlexFit .tight,
295
+ ),
296
+ const SizedBox .square (
297
+ dimension: 12 ,
298
+ )
299
+ ],
281
300
),
282
- const Spacer (flex: 1 ,),
283
- Flexible (
284
- child: Text (desc,overflow: TextOverflow .ellipsis,textAlign: TextAlign .end,),
285
- fit: FlexFit .tight,
286
- ),
287
- const SizedBox .square (dimension: 12 ,)
288
-
289
- ],
290
- ),
291
- onTap: () {
292
- setState (() {
293
- autoCompleteShown = false ;
294
- if (selectedTab == null || selectedTab! < 0 ) return ;
295
- var currentTab = tabs[selectedTab! ];
296
- var currentField = ((currentTab.content as SingleChildScrollView ).child as Container ).child as InnerField ;
297
- var controller = currentField.codeController;
298
- controller.insertStr (name);
299
- });
300
- },
301
- );
301
+ onTap: () {
302
+ setState (() {
303
+ autoCompleteShown = false ;
304
+ if (selectedTab == null || selectedTab! < 0 ) return ;
305
+ var currentTab = tabs[selectedTab! ];
306
+ var currentField =
307
+ ((currentTab.content as SingleChildScrollView ).child
308
+ as Container )
309
+ .child as InnerField ;
310
+ var controller = currentField.codeController;
311
+ controller.insertStr (name);
312
+ });
313
+ },
314
+ ));
302
315
});
303
316
304
317
return result;
@@ -311,7 +324,9 @@ class _EditorPageState extends State<EditorPage> {
311
324
// Populate the file browser tree once
312
325
initializeTreeView ();
313
326
}
314
- var tabController = TabbedViewController (tabs,);
327
+ var tabController = TabbedViewController (
328
+ tabs,
329
+ );
315
330
tabController.selectedIndex = selectedTab;
316
331
final page = Stack (children: [
317
332
Column (//direction: Axis.vertical,
@@ -321,7 +336,7 @@ class _EditorPageState extends State<EditorPage> {
321
336
? TabbedViewTheme (
322
337
data: getTabTheme (),
323
338
child: TabbedView (
324
- onTabSelection: (int ? selection){
339
+ onTabSelection: (int ? selection) {
325
340
selectedTab = selection ?? - 1 ;
326
341
},
327
342
onTabClose: (tabIndex, tabData) {
@@ -341,7 +356,11 @@ class _EditorPageState extends State<EditorPage> {
341
356
width: 512 ,
342
357
child: ClipRRect (
343
358
child: Container (
344
- constraints: const BoxConstraints (minWidth: 256 ,maxWidth: 600 ,minHeight: 16 ,maxHeight: 300 ),
359
+ constraints: const BoxConstraints (
360
+ minWidth: 256 ,
361
+ maxWidth: 600 ,
362
+ minHeight: 16 ,
363
+ maxHeight: 300 ),
345
364
clipBehavior: Clip .none,
346
365
color: ThemeManager .getThemeSchemeColor ("foreground" ),
347
366
child: Material (
@@ -368,9 +387,7 @@ class _EditorPageState extends State<EditorPage> {
368
387
icon: const Icon (Icons .close),
369
388
tooltip: "Close Project" ,
370
389
),
371
- IconButton (
372
- onPressed: () => {},
373
- icon: const Icon (Icons .more_horiz)),
390
+ IconButton (onPressed: () => {}, icon: const Icon (Icons .more_horiz)),
374
391
const SizedBox (width: 16.0 ),
375
392
],
376
393
),
0 commit comments