Line data Source code
1 : import 'package:widgetbook_generator/code_generators/instances/primary_instance.dart'; 2 : 3 : class StringInstance extends PrimaryInstance<String> { 4 6 : const StringInstance.value( 5 : String value, 6 4 : ) : super( 7 : value: value, 8 : ); 9 : 10 3 : @override 11 : String toCode() { 12 6 : return "'$value'"; 13 : } 14 : 15 3 : @override 16 : bool operator ==(Object other) { 17 : if (identical(this, other)) return true; 18 : 19 12 : return other is StringInstance && other.value == value; 20 : } 21 : 22 0 : @override 23 0 : int get hashCode => value.hashCode; 24 : 25 0 : @override 26 0 : String toString() => 'StringInstance(value: $value)'; 27 : }