{"id":13550030,"url":"https://github.com/baderouaich/flutter_syntax_view","last_synced_at":"2025-04-04T16:14:12.919Z","repository":{"id":54390860,"uuid":"183788615","full_name":"baderouaich/flutter_syntax_view","owner":"baderouaich","description":"Flutter Syntax Highlighter","archived":false,"fork":false,"pushed_at":"2025-03-09T18:29:38.000Z","size":1605,"stargazers_count":98,"open_issues_count":7,"forks_count":30,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T15:10:25.708Z","etag":null,"topics":["code-highlighter","dart","flutter","flutter-package","syntax-highlighting"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baderouaich.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-27T15:15:29.000Z","updated_at":"2025-03-16T13:52:44.000Z","dependencies_parsed_at":"2024-06-19T03:04:18.155Z","dependency_job_id":"35c2a59f-0204-4506-84e8-af78f0b20712","html_url":"https://github.com/baderouaich/flutter_syntax_view","commit_stats":{"total_commits":25,"total_committers":3,"mean_commits":8.333333333333334,"dds":"0.16000000000000003","last_synced_commit":"c9805a2ab2102d5238cb652f7eb560682b39e229"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baderouaich%2Fflutter_syntax_view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baderouaich%2Fflutter_syntax_view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baderouaich%2Fflutter_syntax_view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baderouaich%2Fflutter_syntax_view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baderouaich","download_url":"https://codeload.github.com/baderouaich/flutter_syntax_view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208144,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["code-highlighter","dart","flutter","flutter-package","syntax-highlighting"],"created_at":"2024-08-01T12:01:28.256Z","updated_at":"2025-04-04T16:14:12.898Z","avatar_url":"https://github.com/baderouaich.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# flutter_syntax_view\n\nFlutter Syntax Highlighter\n\n## Basic Usage\n\n```dart\nclass HomePage extends StatelessWidget {\n  const HomePage({super.key});\n\n  final String code = \"\"\"\n// Importing core libraries\nimport 'dart:math';\nint fibonacci(int n) {\n  if (n == 0 || n == 1) return n;\n  return fibonacci(n - 1) + fibonacci(n - 2);\n}          \nfinal int result = fibonacci(20);\n/* and there \n    you have it! */\n\"\"\";\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      body: Center(\n        child: SyntaxView(\n            code: code, // Code text\n            syntax: Syntax.DART, // Language\n            syntaxTheme: SyntaxTheme.vscodeDark(), // Theme\n            fontSize: 12.0, // Font size\n            withZoom: true, // Enable/Disable zoom icon controls\n            withLinesCount: true, // Enable/Disable line number\n            expanded: false, // Enable/Disable container expansion\n            selectable: true // Enable/Disable code text selection\n            ),\n      ),\n    );\n  }\n}\n```\n\n## Create a Custom SyntaxTheme\n\n```dart\nclass AppColors{\n\n  static const Color backgroundColor = Color(0xff1A1A19);\n  static const Color linesCountColor = Color(0xffEFE9D5);\n  static const Color commentStyle    = Color(0xffEEDF7A);\n  static const Color zoomIconColor   = Color(0xff77CDFF);\n  static const Color stringStyle     = Color(0xffF87A53);\n  static const Color baseStyle       = Color(0xffF5F5F5);\n  static const Color keywordStyle    = Color(0xffCAE0BC);\n  static const Color classStyle      = Color(0xffB9E5E8);\n\n}\n\nclass HomePage extends StatelessWidget {\n   HomePage({super.key});\n\n static const String code = r\"\"\"\nimport 'dart:math' as math;\n\n// Coffee class is the best!\nclass Coffee {\n  late int _temperature;\n\n  void heat() =\u003e _temperature = 100;\n  void chill() =\u003e _temperature = -5;\n\n  void sip() {\n    final bool isTooHot = math.max(37, _temperature) \u003e 37;\n    if (isTooHot)\n      print(\"myyy liiips!\");\n    else\n      print(\"mmmmm refreshing!\");\n  }\n\n  int? get temperature =\u003e temperature;\n}\nvoid main() {\n  var coffee = Coffee();\n  coffee.heat();\n  coffee.sip();\n  coffee.chill();\n  coffee.sip();\n}\n/* And there\n        you have it */\"\"\";\n\n\n  final SyntaxTheme myCustomTheme = SyntaxTheme.standard().copyWith(\n    backgroundColor : AppColors.backgroundColor,\n    linesCountColor : AppColors.linesCountColor,\n    commentStyle    : const TextStyle(color: AppColors.commentStyle),\n    zoomIconColor   : AppColors.zoomIconColor,\n    stringStyle     :  const TextStyle(color: AppColors.stringStyle),\n    baseStyle       : const TextStyle(color: AppColors.baseStyle),\n    keywordStyle    :  const TextStyle(color: AppColors.keywordStyle),\n    punctuationStyle:  const TextStyle(color: AppColors.keywordStyle),\n    classStyle      :  const TextStyle(color: AppColors.classStyle),\n  );\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      body: Center(\n        child: SyntaxView(\n            code: code, // Code text\n            syntax: Syntax.DART, // Language\n            syntaxTheme: myCustomTheme, // Theme\n            fontSize: 12.0, // Font size\n            withZoom: true, // Enable/Disable zoom icon controls\n            withLinesCount: true, // Enable/Disable line number\n            expanded: false, // Enable/Disable container expansion\n            selectable: true // Enable/Disable code text selection\n          ),\n      ),\n    );\n  }\n}\n```\n\n## Supported Syntax\n\n- [x] Dart\n- [x] C\n- [x] C++\n- [x] Java\n- [x] Kotlin\n- [x] Swift\n- [x] JavaScript\n- [x] YAML\n- [x] Rust\n- [x] Lua\n- [x] Python\n\n## Themes\n\n\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/ayuDark.png\"\u003e \u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/ayuLight.png\"\u003e\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/dracula.png\"\u003e\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/gravityDark.png\"\u003e\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/gravityLight.png\"\u003e\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/monokaiSublime.png\"\u003e\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/obsidian.png\"\u003e\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/oceanSunset.png\"\u003e\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/standard.png\"\u003e\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/vscodeDark.png\"\u003e\u003cimg width=\"270\" src=\"https://raw.githubusercontent.com/baderouaich/flutter_syntax_view/master/theme_shots/vscodeLight.png\"\u003e\n\n\n## Installing\n\n[Package](https://pub.dartlang.org/packages/flutter_syntax_view)\n\n\n## Contributing\n\n- if you are familiar with Regular Expressions in Dart and would like contribute in adding further syntax support. it will be very appreciated!\n\n\n## Contributors ✨\nThanks goes to these wonderful people!\u003cbr\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ca href=\"https://github.com/rodydavis\"\u003e\n      \u003cimg width=\"50\" height=\"50\" src=\"https://github.com/rodydavis.png\"\u003e\n    \u003c/a\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ca href=\"https://github.com/LuodiJackShen\"\u003e\n      \u003cimg width=\"50\" height=\"50\" src=\"https://github.com/LuodiJackShen.png\"\u003e\n    \u003c/a\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ca href=\"https://github.com/luodijack\"\u003e\n      \u003cimg width=\"50\" height=\"50\" src=\"https://github.com/luodijack.png\"\u003e\n    \u003c/a\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ca href=\"https://github.com/marwenx\"\u003e\n      \u003cimg width=\"50\" height=\"50\" src=\"https://github.com/marwenx.png\"\u003e\n    \u003c/a\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ca href=\"https://github.com/shyam1s15\"\u003e\n      \u003cimg width=\"50\" height=\"50\" src=\"https://github.com/shyam1s15.png\"\u003e\n    \u003c/a\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ca href=\"https://github.com/jhon2520\"\u003e\n      \u003cimg width=\"50\" height=\"50\" src=\"https://github.com/jhon2520.png\"\u003e\n    \u003c/a\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ca href=\"https://github.com/Binozo\"\u003e\n      \u003cimg width=\"50\" height=\"50\" src=\"https://github.com/Binozo.png\"\u003e\n    \u003c/a\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ca href=\"https://github.com/lebao3105\"\u003e\n      \u003cimg width=\"50\" height=\"50\" src=\"https://github.com/lebao3105.png\"\u003e\n    \u003c/a\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## Features and bugs\n\nIf you face any problems feel free to open an issue at the [issue tracker][tracker]. If you feel the library is missing a feature, please raise a ticket on Github. Pull request are also welcome.\n\n[tracker]: https://github.com/baderouaich/flutter_syntax_view/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaderouaich%2Fflutter_syntax_view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaderouaich%2Fflutter_syntax_view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaderouaich%2Fflutter_syntax_view/lists"}