Line data Source code
1 : import 'package:meta/meta.dart'; 2 : import 'package:widgetbook_generator/code_generators/properties/property.dart'; 3 : 4 : @immutable 5 : class StringProperty extends Property { 6 4 : StringProperty({ 7 : required String key, 8 : required this.value, 9 4 : }) : super( 10 : key: key, 11 : ); 12 : 13 : final String value; 14 : 15 2 : @override 16 : String valueToCode() { 17 4 : return "'$value'"; 18 : } 19 : 20 2 : @override 21 : bool operator ==(Object other) { 22 : if (identical(this, other)) return true; 23 : 24 14 : return other is StringProperty && other.value == value && other.key == key; 25 : } 26 : 27 0 : @override 28 0 : int get hashCode => value.hashCode ^ key.hashCode; 29 : }