mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 18:03:14 +08:00
Autocompletion: Show a bit more options
This is still just a Poc
This commit is contained in:
@ -68,7 +68,7 @@ class _AutoCompletionWidgetState extends State<AutoCompletionWidget> {
|
|||||||
if (prefix == "\n") {
|
if (prefix == "\n") {
|
||||||
// Pressed Enter
|
// Pressed Enter
|
||||||
} else {
|
} else {
|
||||||
_showOverlayTag(context, text.substring(0, range.start));
|
_showOverlayTag(context, text.substring(0, range.start - 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,6 +104,18 @@ class _AutoCompletionWidgetState extends State<AutoCompletionWidget> {
|
|||||||
|
|
||||||
//print("Painter ${painter.width} $height");
|
//print("Painter ${painter.width} $height");
|
||||||
|
|
||||||
|
var tags = ['Hello', 'Howdy', 'Pooper'];
|
||||||
|
var list = Column(
|
||||||
|
children: [
|
||||||
|
for (var tag in tags)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
child: Text('#$tag', style: const TextStyle(fontSize: 20.0)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
);
|
||||||
|
|
||||||
_hideOverlay();
|
_hideOverlay();
|
||||||
overlayEntry = OverlayEntry(builder: (context) {
|
overlayEntry = OverlayEntry(builder: (context) {
|
||||||
return Positioned(
|
return Positioned(
|
||||||
@ -112,15 +124,10 @@ class _AutoCompletionWidgetState extends State<AutoCompletionWidget> {
|
|||||||
left: widget.textFieldFocusNode.offset.dx + width,
|
left: widget.textFieldFocusNode.offset.dx + width,
|
||||||
|
|
||||||
// Tag code.
|
// Tag code.
|
||||||
child: const Material(
|
child: Material(
|
||||||
elevation: 4.0,
|
elevation: 4.0,
|
||||||
color: Colors.lightBlueAccent,
|
color: Colors.grey[200],
|
||||||
child: Text(
|
child: list,
|
||||||
'Show tag here',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user