We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f194f1 commit 974def2Copy full SHA for 974def2
lib/style.dart
@@ -1,6 +1,7 @@
1
import 'dart:ui';
2
3
import 'package:flutter/material.dart';
4
+import 'package:flutter_html/src/css_parser.dart';
5
6
///This class represents all the available CSS attributes
7
///for this package.
@@ -214,6 +215,15 @@ class Style {
214
215
}
216
217
218
+ static Map<String, Style> fromCSS(String css) {
219
+ final declarations = parseExternalCSS(css);
220
+ Map<String, Style> styleMap = {};
221
+ declarations.forEach((key, value) {
222
+ styleMap[key] = declarationsToStyle(value);
223
+ });
224
+ return styleMap;
225
+ }
226
+
227
TextStyle generateTextStyle() {
228
return TextStyle(
229
backgroundColor: backgroundColor,
0 commit comments