@@ -111,15 +111,13 @@ class Svg {
111
111
112
112
final List <Drawable > children = svg.children
113
113
.whereType <XmlElement >()
114
- .map (
115
- (XmlNode child) => parseSvgElement (
116
- child,
117
- definitions,
118
- viewBox.viewBoxRect,
119
- style,
120
- key,
121
- ),
122
- )
114
+ .map ((XmlNode child) => parseSvgElement (
115
+ child,
116
+ definitions,
117
+ viewBox.viewBoxRect,
118
+ style,
119
+ key,
120
+ ))
123
121
.toList ();
124
122
return DrawableRoot (
125
123
viewBox,
@@ -153,16 +151,17 @@ class SvgPicture extends StatefulWidget {
153
151
///
154
152
/// A custom `placeholderBuilder` can be specified for cases where decoding or
155
153
/// acquiring data may take a noticeably long time, e.g. for a network picture.
156
- const SvgPicture (this .pictureProvider,
157
- {Key key,
158
- this .width,
159
- this .height,
160
- this .fit = BoxFit .contain,
161
- this .alignment = Alignment .center,
162
- this .matchTextDirection = false ,
163
- this .allowDrawingOutsideViewBox = false ,
164
- this .placeholderBuilder})
165
- : super (key: key);
154
+ const SvgPicture (
155
+ this .pictureProvider, {
156
+ Key key,
157
+ this .width,
158
+ this .height,
159
+ this .fit = BoxFit .contain,
160
+ this .alignment = Alignment .center,
161
+ this .matchTextDirection = false ,
162
+ this .allowDrawingOutsideViewBox = false ,
163
+ this .placeholderBuilder,
164
+ }) : super (key: key);
166
165
167
166
/// Instantiates a widget that renders an SVG picture from an [AssetBundle] .
168
167
///
@@ -239,20 +238,21 @@ class SvgPicture extends StatefulWidget {
239
238
/// scale is present.
240
239
/// * <https://flutter.io/assets-and-images/>, an introduction to assets in
241
240
/// Flutter.
242
- SvgPicture .asset (String assetName,
243
- {Key key,
244
- this .matchTextDirection = false ,
245
- AssetBundle bundle,
246
- String package,
247
- this .width,
248
- this .height,
249
- this .fit = BoxFit .contain,
250
- this .alignment = Alignment .center,
251
- this .allowDrawingOutsideViewBox = false ,
252
- this .placeholderBuilder,
253
- Color color,
254
- BlendMode colorBlendMode = BlendMode .srcIn})
255
- : pictureProvider = ExactAssetPicture (
241
+ SvgPicture .asset (
242
+ String assetName, {
243
+ Key key,
244
+ this .matchTextDirection = false ,
245
+ AssetBundle bundle,
246
+ String package,
247
+ this .width,
248
+ this .height,
249
+ this .fit = BoxFit .contain,
250
+ this .alignment = Alignment .center,
251
+ this .allowDrawingOutsideViewBox = false ,
252
+ this .placeholderBuilder,
253
+ Color color,
254
+ BlendMode colorBlendMode = BlendMode .srcIn,
255
+ }) : pictureProvider = ExactAssetPicture (
256
256
allowDrawingOutsideViewBox == true
257
257
? svgByteDecoderOutsideViewBox
258
258
: svgByteDecoder,
@@ -289,19 +289,20 @@ class SvgPicture extends StatefulWidget {
289
289
///
290
290
/// An optional `headers` argument can be used to send custom HTTP headers
291
291
/// with the image request.
292
- SvgPicture .network (String url,
293
- {Key key,
294
- Map <String , String > headers,
295
- this .width,
296
- this .height,
297
- this .fit = BoxFit .contain,
298
- this .alignment = Alignment .center,
299
- this .matchTextDirection = false ,
300
- this .allowDrawingOutsideViewBox = false ,
301
- this .placeholderBuilder,
302
- Color color,
303
- BlendMode colorBlendMode = BlendMode .srcIn})
304
- : pictureProvider = NetworkPicture (
292
+ SvgPicture .network (
293
+ String url, {
294
+ Key key,
295
+ Map <String , String > headers,
296
+ this .width,
297
+ this .height,
298
+ this .fit = BoxFit .contain,
299
+ this .alignment = Alignment .center,
300
+ this .matchTextDirection = false ,
301
+ this .allowDrawingOutsideViewBox = false ,
302
+ this .placeholderBuilder,
303
+ Color color,
304
+ BlendMode colorBlendMode = BlendMode .srcIn,
305
+ }) : pictureProvider = NetworkPicture (
305
306
allowDrawingOutsideViewBox == true
306
307
? svgByteDecoderOutsideViewBox
307
308
: svgByteDecoder,
@@ -335,18 +336,19 @@ class SvgPicture extends StatefulWidget {
335
336
///
336
337
/// On Android, this may require the
337
338
/// `android.permission.READ_EXTERNAL_STORAGE` permission.
338
- SvgPicture .file (File file,
339
- {Key key,
340
- this .width,
341
- this .height,
342
- this .fit = BoxFit .contain,
343
- this .alignment = Alignment .center,
344
- this .matchTextDirection = false ,
345
- this .allowDrawingOutsideViewBox = false ,
346
- this .placeholderBuilder,
347
- Color color,
348
- BlendMode colorBlendMode = BlendMode .srcIn})
349
- : pictureProvider = FilePicture (
339
+ SvgPicture .file (
340
+ File file, {
341
+ Key key,
342
+ this .width,
343
+ this .height,
344
+ this .fit = BoxFit .contain,
345
+ this .alignment = Alignment .center,
346
+ this .matchTextDirection = false ,
347
+ this .allowDrawingOutsideViewBox = false ,
348
+ this .placeholderBuilder,
349
+ Color color,
350
+ BlendMode colorBlendMode = BlendMode .srcIn,
351
+ }) : pictureProvider = FilePicture (
350
352
allowDrawingOutsideViewBox == true
351
353
? svgByteDecoderOutsideViewBox
352
354
: svgByteDecoder,
@@ -376,18 +378,19 @@ class SvgPicture extends StatefulWidget {
376
378
///
377
379
/// The `color` and `colorBlendMode` arguments, if specified, will be used to set a
378
380
/// [ColorFilter] on any [Paint] s created for this drawing.
379
- SvgPicture .memory (Uint8List bytes,
380
- {Key key,
381
- this .width,
382
- this .height,
383
- this .fit = BoxFit .contain,
384
- this .alignment = Alignment .center,
385
- this .matchTextDirection = false ,
386
- this .allowDrawingOutsideViewBox = false ,
387
- this .placeholderBuilder,
388
- Color color,
389
- BlendMode colorBlendMode = BlendMode .srcIn})
390
- : pictureProvider = MemoryPicture (
381
+ SvgPicture .memory (
382
+ Uint8List bytes, {
383
+ Key key,
384
+ this .width,
385
+ this .height,
386
+ this .fit = BoxFit .contain,
387
+ this .alignment = Alignment .center,
388
+ this .matchTextDirection = false ,
389
+ this .allowDrawingOutsideViewBox = false ,
390
+ this .placeholderBuilder,
391
+ Color color,
392
+ BlendMode colorBlendMode = BlendMode .srcIn,
393
+ }) : pictureProvider = MemoryPicture (
391
394
allowDrawingOutsideViewBox == true
392
395
? svgByteDecoderOutsideViewBox
393
396
: svgByteDecoder,
@@ -417,18 +420,19 @@ class SvgPicture extends StatefulWidget {
417
420
///
418
421
/// The `color` and `colorBlendMode` arguments, if specified, will be used to set a
419
422
/// [ColorFilter] on any [Paint] s created for this drawing.
420
- SvgPicture .string (String bytes,
421
- {Key key,
422
- this .width,
423
- this .height,
424
- this .fit = BoxFit .contain,
425
- this .alignment = Alignment .center,
426
- this .matchTextDirection = false ,
427
- this .allowDrawingOutsideViewBox = false ,
428
- this .placeholderBuilder,
429
- Color color,
430
- BlendMode colorBlendMode = BlendMode .srcIn})
431
- : pictureProvider = StringPicture (
423
+ SvgPicture .string (
424
+ String bytes, {
425
+ Key key,
426
+ this .width,
427
+ this .height,
428
+ this .fit = BoxFit .contain,
429
+ this .alignment = Alignment .center,
430
+ this .matchTextDirection = false ,
431
+ this .allowDrawingOutsideViewBox = false ,
432
+ this .placeholderBuilder,
433
+ Color color,
434
+ BlendMode colorBlendMode = BlendMode .srcIn,
435
+ }) : pictureProvider = StringPicture (
432
436
allowDrawingOutsideViewBox == true
433
437
? svgStringDecoderOutsideViewBox
434
438
: svgStringDecoder,
0 commit comments