https://github.com/snipmedev/kode_view
Flutter syntax highlighting widgets based on Highlights
https://github.com/snipmedev/kode_view
code edittext flutter syntax-highlighting textview
Last synced: about 1 month ago
JSON representation
Flutter syntax highlighting widgets based on Highlights
- Host: GitHub
- URL: https://github.com/snipmedev/kode_view
- Owner: SnipMeDev
- License: apache-2.0
- Created: 2023-10-21T07:51:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-22T12:30:41.000Z (over 1 year ago)
- Last Synced: 2024-11-22T13:27:41.276Z (over 1 year ago)
- Topics: code, edittext, flutter, syntax-highlighting, textview
- Language: Dart
- Homepage:
- Size: 357 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# kode_view
Flutter syntax highlighting widgets based on [Highlights](https://github.com/SnipMeDev/Highlights) library.

## Installation
```dart
flutter pub add kode_view
```
## Usage
### CodeTextView
```dart
import 'package:flutter/material.dart';
import 'package:kode_view/kode_view.dart';
@override
Widget build(BuildContext context) {
final codeSnippet = "class HelloWorld {}";
return MaterialApp(
home: Scaffold(
appBar: ...,
body: CodeTextView(
code: codeSnippet,
language: "Java",
theme: "darcula",
options: ...,
),
),
);
}
```
### CodeEditText
```dart
import 'package:flutter/material.dart';
import 'package:kode_view/kode_view.dart';
class _MyAppState extends State {
final SyntaxHighlightingController controller =
SyntaxHighlightingController(text: codeSnippet);
@override
Widget build(BuildContext context) {
final codeSnippet = "class HelloWorld {}";
return MaterialApp(
home: Scaffold(
appBar: ...,
body: CodeEditText(
code: codeSnippet,
controller: controller,
showCursor: true,
),
),
);
}
}
```
## 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.