flutter_syntax_view 4.0.0 copy "flutter_syntax_view: ^4.0.0" to clipboard
flutter_syntax_view: ^4.0.0 copied to clipboard

A static syntax highlighter widget which highlights code text according to the programming language syntax using native Dart code.

flutter_syntax_view #

Flutter Syntax Highlighter

Usage #

  String code = """
// Importing core libraries
import 'dart:math';
int fibonacci(int n) {
  if (n == 0 || n == 1) return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
}          
var result = fibonacci(20);
/* and there 
    you have it! */
""";

  SyntaxView(
      code: code,	// Code text
      syntax: Syntax.DART,	// Language
      syntaxTheme: SyntaxTheme.vscodeDark(),	// Theme
      fontSize: 12.0,	// Font size
      withZoom: true,	// Enable/Disable zoom icon controls
      withLinesCount: true,	// Enable/Disable line number
      expanded: false,	// Enable/Disable container expansion
    )

Supported Syntax #

  • Dart
  • C
  • C++
  • Java
  • Kotlin
  • Swift
  • JavaScript
  • YAML

Themes #

Installing #

Package

Contributing #

  • if you are familiar with Regular Expressions in Dart and would like contribute in adding further syntax support. it will be very appreciated!

Contributors ✨ #

Thanks goes to these wonderful people!

Features and bugs #

If you face any problems feel free to open an issue at the issue tracker. If you feel the library is missing a feature, please raise a ticket on Github. Pull request are also welcome.

70
likes
120
pub points
89%
popularity

Publisher

unverified uploader

A static syntax highlighter widget which highlights code text according to the programming language syntax using native Dart code.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, string_scanner

More

Packages that depend on flutter_syntax_view