From f728cc6e66f9cfe814c4996ef0175d44dc4c147f Mon Sep 17 00:00:00 2001 From: randogoth Date: Fri, 21 Feb 2025 22:58:10 +0200 Subject: [PATCH] more cleanup --- lib/themes/day.dart | 24 +++++++++++++++--------- lib/themes/markdown.dart | 22 ++++++++++++++-------- lib/themes/night.dart | 20 +++++++++++++------- pubspec.lock | 2 +- pubspec.yaml | 1 + 5 files changed, 44 insertions(+), 25 deletions(-) diff --git a/lib/themes/day.dart b/lib/themes/day.dart index 7033e5f..da27690 100644 --- a/lib/themes/day.dart +++ b/lib/themes/day.dart @@ -1,7 +1,4 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - import 'package:flutter/material.dart'; -import 'package:flutter/painting.dart'; const TextTheme dayText = TextTheme( titleLarge: TextStyle(color: Color(0xff333333)), @@ -23,7 +20,7 @@ const TextTheme dayText = TextTheme( const dayTheme = { 'root': - TextStyle(backgroundColor: Color(0xffF6F4F1), color: Color(0xff333333)), + TextStyle(backgroundColor: Color(0xffF6F4F1), color: Color(0xff333333)), 'comment': TextStyle(color: Color(0xff969896)), 'meta': TextStyle(color: Color(0xff969896)), 'variable': TextStyle(color: Color(0xffdf5000)), @@ -48,12 +45,21 @@ const dayTheme = { 'selector-attr': TextStyle(color: Color(0xff6f42c1)), 'selector-pseudo': TextStyle(color: Color(0xff6f42c1)), 'addition': - TextStyle(color: Color(0xff55a532), backgroundColor: Color(0xffeaffea)), + TextStyle(color: Color(0xff55a532), backgroundColor: Color(0xffeaffea)), 'deletion': - TextStyle(color: Color(0xffbd2c00), backgroundColor: Color(0xffffecec)), + TextStyle(color: Color(0xffbd2c00), backgroundColor: Color(0xffffecec)), 'number': TextStyle(color: Color(0xff005cc5)), 'string': TextStyle(color: Color(0xff032f62)), - 'tag-hash': TextStyle(color: Colors.pinkAccent, fontStyle: FontStyle.italic, fontWeight: FontWeight.bold), - 'tag-plus': TextStyle(color: Colors.cyan, fontStyle: FontStyle.italic, fontWeight: FontWeight.bold), - 'tag-at': TextStyle(color: Colors.orange, fontStyle: FontStyle.italic, fontWeight: FontWeight.bold), + 'tag-hash': TextStyle( + color: Colors.pinkAccent, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.bold), + 'tag-plus': TextStyle( + color: Colors.cyan, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.bold), + 'tag-at': TextStyle( + color: Colors.orange, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.bold), }; diff --git a/lib/themes/markdown.dart b/lib/themes/markdown.dart index 42f1fe9..635d045 100644 --- a/lib/themes/markdown.dart +++ b/lib/themes/markdown.dart @@ -1,5 +1,4 @@ -import 'package:highlight/src/mode.dart'; -import 'package:highlight/src/common_modes.dart'; +import 'package:highlight/highlight.dart'; final markdown = Mode(refs: {}, aliases: [ "md", @@ -59,9 +58,16 @@ final markdown = Mode(refs: {}, aliases: [ ]), // Custom Tag Highlighting - Mode(className: "tag-hash", begin: "(?<=\\s|^)#[a-zA-Z0-9_]+", relevance: 10), // Magenta - Mode(className: "tag-plus", begin: "(?<=\\s|^)\\+[a-zA-Z0-9_]+", relevance: 10), // Cyan - Mode(className: "tag-at", begin: "(?<=\\s|^)@[a-zA-Z0-9_]+", relevance: 10), // Yellow - - -]); \ No newline at end of file + Mode( + className: "tag-hash", + begin: "(?<=\\s|^)#[a-zA-Z0-9_]+", + relevance: 10), // Magenta + Mode( + className: "tag-plus", + begin: "(?<=\\s|^)\\+[a-zA-Z0-9_]+", + relevance: 10), // Cyan + Mode( + className: "tag-at", + begin: "(?<=\\s|^)@[a-zA-Z0-9_]+", + relevance: 10), // Yellow +]); diff --git a/lib/themes/night.dart b/lib/themes/night.dart index 8f6bc79..815b51f 100644 --- a/lib/themes/night.dart +++ b/lib/themes/night.dart @@ -1,7 +1,4 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - import 'package:flutter/material.dart'; -import 'package:flutter/painting.dart'; const TextTheme nightText = TextTheme( titleLarge: TextStyle(color: Color(0xffc5c8c6)), @@ -50,10 +47,19 @@ const nightTheme = { 'keyword': TextStyle(color: Color(0xffb294bb)), 'selector-tag': TextStyle(color: Color(0xffb294bb)), 'root': - TextStyle(backgroundColor: Color(0xFF121212), color: Color(0xffc5c8c6)), + TextStyle(backgroundColor: Color(0xFF121212), color: Color(0xffc5c8c6)), 'emphasis': TextStyle(fontStyle: FontStyle.italic), 'strong': TextStyle(fontWeight: FontWeight.bold), - 'tag-hash': TextStyle(color: Colors.pinkAccent, fontStyle: FontStyle.italic, fontWeight: FontWeight.bold), - 'tag-plus': TextStyle(color: Colors.cyan, fontStyle: FontStyle.italic, fontWeight: FontWeight.bold), - 'tag-at': TextStyle(color: Colors.orange, fontStyle: FontStyle.italic, fontWeight: FontWeight.bold), + 'tag-hash': TextStyle( + color: Colors.pinkAccent, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.bold), + 'tag-plus': TextStyle( + color: Colors.cyan, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.bold), + 'tag-at': TextStyle( + color: Colors.orange, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.bold), }; diff --git a/pubspec.lock b/pubspec.lock index 533ba42..e599e15 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -217,7 +217,7 @@ packages: source: hosted version: "6.2.1" highlight: - dependency: transitive + dependency: "direct main" description: name: highlight sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21" diff --git a/pubspec.yaml b/pubspec.yaml index c27327f..3e5f11c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,6 +45,7 @@ dependencies: path_provider: ^2.1.5 permission_handler: ^11.4.0 shared_preferences: ^2.5.2 + highlight: ^0.7.0 dev_dependencies: flutter_test: