{"id":32307083,"url":"https://github.com/viztushar/syntax_highlighter","last_synced_at":"2026-02-21T08:36:45.433Z","repository":{"id":56841003,"uuid":"189737264","full_name":"viztushar/syntax_highlighter","owner":"viztushar","description":"Syntax Highlighter for Dart/Flutter Code","archived":false,"fork":false,"pushed_at":"2021-10-14T10:22:56.000Z","size":69,"stargazers_count":31,"open_issues_count":5,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-23T07:24:48.410Z","etag":null,"topics":["dart","dart-syntax-highlighter","flutter","flutter-apps","flutter-demo","flutter-package","flutter-syntax","flutter-syntax-highlighter","syntax","syntax-highlighter","syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/syntax_highlighter","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viztushar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-01T13:40:13.000Z","updated_at":"2023-09-20T01:29:31.000Z","dependencies_parsed_at":"2022-08-29T12:50:31.109Z","dependency_job_id":null,"html_url":"https://github.com/viztushar/syntax_highlighter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/viztushar/syntax_highlighter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viztushar%2Fsyntax_highlighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viztushar%2Fsyntax_highlighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viztushar%2Fsyntax_highlighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viztushar%2Fsyntax_highlighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viztushar","download_url":"https://codeload.github.com/viztushar/syntax_highlighter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viztushar%2Fsyntax_highlighter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29677612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","dart-syntax-highlighter","flutter","flutter-apps","flutter-demo","flutter-package","flutter-syntax","flutter-syntax-highlighter","syntax","syntax-highlighter","syntax-highlighting"],"created_at":"2025-10-23T07:13:52.327Z","updated_at":"2026-02-21T08:36:45.428Z","avatar_url":"https://github.com/viztushar.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# syntax_highlighter\n\nsyntax highlighter for show your code in the app\n\n# How to Use It\n\n### Step 2\n\nadd your code in your file\n\n```javascript\nString _exampleCode =\n      \"class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() =\u003e _MyHomePageState();}\";\n```\n\n### Step 2\n\nadd `SyntaxHighlighterStyle` in your `build` method\n\n```javascript\nfinal SyntaxHighlighterStyle style =\n        Theme.of(context).brightness == Brightness.dark\n            ? SyntaxHighlighterStyle.darkThemeStyle()\n            : SyntaxHighlighterStyle.lightThemeStyle();\n```\n\n### Step 3\n\nadd this code\n\n```javascript\n            RichText(\n              text: TextSpan(\n                style: const TextStyle(fontFamily: 'monospace', fontSize: 10.0),\n                children: \u003cTextSpan\u003e[\n                  DartSyntaxHighlighter(style).format(_exampleCode),\n                ],\n              ),\n```\n\n# Full Example\n\ncheck Full Example code in [example/lib/main.dart](https://github.com/viztushar/syntax_highlighter/blob/master/example/lib/main.dart)\n\n```javascript\nimport 'package:flutter/material.dart';\nimport 'package:syntax_highlighter/syntax_highlighter.dart';\n\nvoid main() =\u003e runApp(MyApp());\n\nclass MyApp extends StatelessWidget {\n  // This widget is the root of your application.\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title: 'Syntax Highlighter Example',\n      theme: ThemeData(\n        primarySwatch: Colors.blue,\n      ),\n      home: MyHomePage(title: 'Syntax Highlighter Example'),\n    );\n  }\n}\n\nclass MyHomePage extends StatefulWidget {\n  MyHomePage({Key key, this.title}) : super(key: key);\n  final String title;\n\n  @override\n  _MyHomePageState createState() =\u003e _MyHomePageState();\n}\n\nclass _MyHomePageState extends State\u003cMyHomePage\u003e {\n  String _exampleCode =\n      \"class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() =\u003e _MyHomePageState();}\";\n\n  @override\n  Widget build(BuildContext context) {\n    final SyntaxHighlighterStyle style =\n        Theme.of(context).brightness == Brightness.dark\n            ? SyntaxHighlighterStyle.darkThemeStyle()\n            : SyntaxHighlighterStyle.lightThemeStyle();\n    return Scaffold(\n        appBar: AppBar(\n          title: Text(widget.title),\n        ),\n        body: SingleChildScrollView(\n          child: Padding(\n            padding: const EdgeInsets.all(16.0),\n            child: RichText(\n              text: TextSpan(\n                style: const TextStyle(fontFamily: 'monospace', fontSize: 10.0),\n                children: \u003cTextSpan\u003e[\n                  DartSyntaxHighlighter(style).format(_exampleCode),\n                ],\n              ),\n            ),\n          ),\n        ));\n  }\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviztushar%2Fsyntax_highlighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviztushar%2Fsyntax_highlighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviztushar%2Fsyntax_highlighter/lists"}