@@ -4,6 +4,7 @@ import 'package:json_annotation/json_annotation.dart';
44import 'package:equatable/equatable.dart' ;
55
66import '../../../codelessly_api.dart' ;
7+ import '../../schema/flutter_prop.dart' ;
78
89part 'paint.g.dart' ;
910
@@ -130,6 +131,15 @@ class PaintModel with Equatable, SerializableMixin, FieldsHolder {
130131 /// translation, rotation, and skew.
131132 ///
132133 /// The identity transform is [[1, 0, 0] , [0, 1, 0] ].
134+ @FlutterProp (
135+ 'imageTransform' ,
136+ type: 'array' ,
137+ group: 'Image Fill' ,
138+ control: 'matrix' ,
139+ flutterParam: false ,
140+ a2ui: false ,
141+ note: 'Optional persisted affine image transform in a paint item.' ,
142+ )
133143 final List <List <num >>? imageTransform;
134144
135145 /// Memory bytes to load the image.
@@ -153,17 +163,55 @@ class PaintModel with Equatable, SerializableMixin, FieldsHolder {
153163
154164 /// The sizing behavior the image will use to fit inside its view.
155165 /// This is 1-1 with Flutter's [BoxFit] .
166+ @FlutterProp (
167+ 'fit' ,
168+ type: 'string' ,
169+ group: 'Image Fill' ,
170+ control: 'select' ,
171+ flutterParam: false ,
172+ a2ui: false ,
173+ note: 'Persisted image fill fit mode in a paint item.' ,
174+ )
156175 final Fit fit;
157176
158177 /// The alignment positioning of the image relative to its view.
159178 /// [-1, -1] being the top left corner of the view and [1, 1] being the bottom
160179 /// right corner of the view, and [0, 0] being the center of the view.
161180 ///
162181 /// This corresponds to Flutter's [Alignment] .
182+ @FlutterProp (
183+ 'alignment' ,
184+ type: 'object' ,
185+ group: 'Image Fill' ,
186+ control: 'alignment' ,
187+ flutterParam: false ,
188+ a2ui: false ,
189+ note: 'Persisted image alignment object in a paint item.' ,
190+ )
163191 final AlignmentModel alignment;
164192
165193 /// The image scale per-axis.
166- final double scaleX, scaleY;
194+ @FlutterProp (
195+ 'scaleX' ,
196+ type: 'number' ,
197+ group: 'Image Fill' ,
198+ control: 'number' ,
199+ flutterParam: false ,
200+ a2ui: false ,
201+ note: 'Persisted horizontal image scale or flip sign in a paint item.' ,
202+ )
203+ final double scaleX;
204+
205+ @FlutterProp (
206+ 'scaleY' ,
207+ type: 'number' ,
208+ group: 'Image Fill' ,
209+ control: 'number' ,
210+ flutterParam: false ,
211+ a2ui: false ,
212+ note: 'Persisted vertical image scale or flip sign in a paint item.' ,
213+ )
214+ final double scaleY;
167215
168216 /// Image scale.
169217 double get scale => min (scaleX, scaleY);
@@ -184,6 +232,15 @@ class PaintModel with Equatable, SerializableMixin, FieldsHolder {
184232 bool get isNonUniformScale => scaleX.abs () != scaleY.abs ();
185233
186234 /// Stores information about the crop of an image.
235+ @FlutterProp (
236+ 'cropData' ,
237+ type: 'object' ,
238+ group: 'Image Fill' ,
239+ control: 'crop' ,
240+ flutterParam: false ,
241+ a2ui: false ,
242+ note: 'Optional persisted crop object in a paint item.' ,
243+ )
187244 final CropData ? cropData;
188245
189246 /// URL of the cropped image.
@@ -199,6 +256,15 @@ class PaintModel with Equatable, SerializableMixin, FieldsHolder {
199256 final double ? sourceHeight;
200257
201258 /// Tile mode for image fill.
259+ @FlutterProp (
260+ 'imageRepeat' ,
261+ type: 'string' ,
262+ group: 'Image Fill' ,
263+ control: 'select' ,
264+ flutterParam: false ,
265+ a2ui: false ,
266+ note: 'Persisted repeat mode for an image paint item.' ,
267+ )
202268 final ImageRepeatEnum imageRepeat;
203269
204270 /// Color saturation of an image fill: 1 keeps the image's colors, 0 makes
0 commit comments