Line data Source code
1 : import 'package:widgetbook_annotation/widgetbook_annotation.dart'; 2 : import 'package:widgetbook_generator/code_generators/instances/device_size_instance.dart'; 3 : import 'package:widgetbook_generator/code_generators/instances/instance.dart'; 4 : import 'package:widgetbook_generator/code_generators/properties/property.dart'; 5 : 6 : /// An instance for [Resolution] 7 : class ResolutionInstance extends Instance { 8 : /// Creates a new instance of [ResolutionInstance] 9 3 : ResolutionInstance({ 10 : required Resolution resolution, 11 3 : }) : super( 12 : name: 'Resolution', 13 3 : properties: [ 14 3 : Property( 15 : key: 'nativeSize', 16 3 : instance: DeviceSizeInstance( 17 3 : deviceSize: resolution.nativeSize, 18 : ), 19 : ), 20 3 : Property.double( 21 : key: 'scaleFactor', 22 3 : value: resolution.scaleFactor, 23 : ) 24 : ], 25 : ); 26 : }