dartlangeditorflutterflutter-appsflutter-examplesflutter-packageflutter-widgetquillquill-deltaquilljsreactquillrich-textrich-text-editorwysiwygwysiwyg-editor
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
594 B
23 lines
594 B
4 years ago
|
import 'package:flutter_quill/models/documents/attribute.dart';
|
||
|
|
||
|
/* Collection of style attributes */
|
||
|
class Style {
|
||
|
final Map<String, Attribute> _attributes;
|
||
|
|
||
|
Style.attr(this._attributes);
|
||
|
|
||
|
Style() : _attributes = <String, Attribute>{};
|
||
|
|
||
|
static Style fromJson(Map<String, dynamic> attributes) {
|
||
|
if (attributes == null) {
|
||
|
return Style();
|
||
|
}
|
||
|
|
||
|
Map<String, Attribute> result = attributes.map((String key, dynamic value) {
|
||
|
var attr = Attribute.fromKeyValue(key, value);
|
||
|
return MapEntry<String, Attribute>(key, attr);
|
||
|
});
|
||
|
return Style.attr(result);
|
||
|
}
|
||
|
}
|