highlights_plugin
Dart implementation of highlights KMP engine:
https://github.com/SnipMeDev/Highlights
Installation
flutter pub add highlights_plugin
Usage
final plugin = HighlightsPlugin(debug: true);
// ['kotlin', 'dart', 'swift', 'php', 'java', ...]
final languages = await plugin.getLanguages();
// ['monokai', 'darcula', 'notepad', ...]
final themes = await plugin.getThemes();
// Bold Hello
final emphasis = PhraseLocation(start: 3, length: 8);
// List with ColorHighlight or BoldHighlight
final result = await plugin.getHighlights(
'// Hello, World!',
languages.first,
themes.first,
[emphasis],
);
Features
- 17 supported languages (Kotlin, Dart, Swift, PHP, etc)
- Light / dark mode
- 6 built-in themes
- Phrase bolding (emphasis)
- Result caching and support for incremental changes
Support
- Android โ
- iOS โ
- macOS ๐ด (Not yet)
- Linux ๐ด (Not yet)
- Windows ๐ด (Not yet)
- Web ๐ด (Not yet)
License ๐๏ธ
Copyright 2024 Tomasz Kฤ
dzioลka.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.