Line data Source code
1 : import 'package:widgetbook_generator/code_generators/instances/base_instance.dart'; 2 : 3 : /// An abstract representation of a instance creating a primary datatype like 4 : /// int, double, num, String or enums 5 : abstract class PrimaryInstance<T> extends BaseInstance { 6 : /// Creates a new instance of [PrimaryInstance] 7 15 : const PrimaryInstance({required this.value}); 8 : 9 : /// The value of the [PrimaryInstance] 10 : final T value; 11 : 12 0 : @override 13 0 : String toString() => 'PrimaryInstance(value: $value)'; 14 : 15 4 : @override 16 : bool operator ==(Object other) { 17 : if (identical(this, other)) return true; 18 : 19 16 : return other is PrimaryInstance<T> && other.value == value; 20 : } 21 : 22 0 : @override 23 0 : int get hashCode => value.hashCode; 24 : }