We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 893790b commit 60b19b1Copy full SHA for 60b19b1
1 file changed
example/lib/main.dart
@@ -46,15 +46,17 @@ class _MyAppState extends State<MyApp> {
46
Future<void> _updateHighlights(String code) async {
47
print('Updating highlights $code');
48
_code = code;
49
- _highlightsPlugin.getHighlights(
+ _highlightsPlugin
50
+ .getHighlights(
51
_code ?? '',
52
_language,
53
_theme,
54
_emphasis,
- ).then((value) {
55
+ )
56
+ .then((value) {
57
print('Flutter Highlights $value');
58
setState(() {
- // TODO Sort by position
59
+ value.sort((a, b) => a.location.start.compareTo(b.location.start));
60
_highlights = value.map((highlight) => highlight.toString()).toList();
61
});
62
0 commit comments