Line data Source code
1 : import 'package:meta/meta.dart'; 2 : import 'package:widgetbook_annotation/widgetbook_annotation.dart'; 3 : import 'package:widgetbook_generator/code_generators/instances/device_type_instance.dart'; 4 : import 'package:widgetbook_generator/code_generators/instances/instance.dart'; 5 : import 'package:widgetbook_generator/code_generators/instances/resolution_instance.dart'; 6 : import 'package:widgetbook_generator/code_generators/properties/property.dart'; 7 : 8 : @immutable 9 : class DeviceInstance extends Instance { 10 1 : DeviceInstance({ 11 : required Device device, 12 1 : }) : super( 13 : name: 'Device', 14 1 : properties: [ 15 1 : Property.string( 16 : key: 'name', 17 1 : value: device.name, 18 : ), 19 1 : Property( 20 : key: 'resolution', 21 1 : instance: ResolutionInstance( 22 1 : resolution: device.resolution, 23 : ), 24 : ), 25 1 : Property( 26 : key: 'type', 27 1 : instance: DeviceTypeInstance( 28 1 : deviceType: device.type, 29 : ), 30 : ), 31 : ], 32 : ); 33 : }