1

I want to display the content of this url in flutter application with code viewer, is that possible to do that? I am not talking about only dart code.

I tried to show it with flutter_markdown, and I think it is basic

1

1 Answer 1

2

you can use syntax_highlighter package.

dependencies:
  syntax_highlighter: ^1.0.0

import 'package:syntax_highlighter/syntax_highlighter.dart';

To display a block of code, use SyntaxHighlighter widget. You can specify the language of the code using the language parameter, and the actual code to be displayed using the text parameter. like example:

SyntaxHighlighter(
  language: 'dart',
  text: '''
void main() {
  print('Hello!');
}
''',
)
Sign up to request clarification or add additional context in comments.

1 Comment

Actually, it is very old package, thanks for the recommendation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.