flutter_highlight 0.3.0 copy "flutter_highlight: ^0.3.0" to clipboard
flutter_highlight: ^0.3.0 copied to clipboard

outdated

Flutter syntax highlighter with lots of languages and styles support. Zero dependencies, automatic language detection.

flutter_highlight #

pub

Syntax highlighter for Flutter.

View gallery built with Flutter web: https://pd4d10.github.io/highlight/

Usage #

import 'package:flutter/material.dart';
import 'package:flutter_highlight/flutter_highlight.dart';
import 'package:flutter_highlight/themes/github.dart';

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    var code = '''main() {
  print("Hello, World!");
}
''';

    return HighlightView(
      // The original code to be highlighted
      code,

      // Specify language
      // It is recommended to give it a value for performance
      language: 'dart',

      // Specify highlight theme
      // All available themes are listed in `themes` folder
      theme: githubTheme,

      // Specify padding
      padding: EdgeInsets.all(12),

      // Specify text style
      textStyle: TextStyle(
        fontFamily: 'My awesome monospace font',
        fontSize: 16,
      ),
    );
  }
}

References #

License #

MIT

124
likes
0
pub points
96%
popularity

Publisher

unverified uploader

Flutter syntax highlighter with lots of languages and styles support. Zero dependencies, automatic language detection.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, highlight

More

Packages that depend on flutter_highlight