From 71bf2edc448e7a00518d88e9f434b7e14eb129ff Mon Sep 17 00:00:00 2001 From: Roy Date: Fri, 20 Nov 2020 12:24:43 +0700 Subject: [PATCH] force fully cast type number to double --- README.md | 4 +- WIDGETS.md | 698 +++++++++--------- .../basic/align_widget_parser.dart | 4 +- .../basic/aspectratio_widget_parser.dart | 2 +- .../basic/baseline_widget_parser.dart | 8 +- .../basic/button_widget_parser.dart | 35 +- .../basic/center_widget_parser.dart | 4 +- .../basic/container_widget_parser.dart | 4 +- .../basic/icon_widget_parser.dart | 10 +- .../basic/image_widget_parser.dart | 12 +- .../basic/opacity_widget_parser.dart | 2 +- .../basic/placeholder_widget_parser.dart | 6 +- .../stack_positioned_widgets_parser.dart | 12 +- .../basic/text_widget_parser.dart | 2 +- .../basic/wrap_widget_parser.dart | 4 +- .../scrolling/gridview_widget_parser.dart | 8 +- .../scrolling/listview_widget_parser.dart | 4 +- lib/dynamic_widget/utils.dart | 14 +- 18 files changed, 443 insertions(+), 390 deletions(-) diff --git a/README.md b/README.md index d8d31d7..1d5bc34 100644 --- a/README.md +++ b/README.md @@ -122,11 +122,11 @@ class RaisedButtonParser extends WidgetParser { ? parseHexColor(map['disabledColor']) : null, disabledElevation: - map.containsKey('disabledElevation') ? map['disabledElevation'] : 0.0, + map.containsKey('disabledElevation') ? map['disabledElevation']?.toDouble() : 0.0, disabledTextColor: map.containsKey('disabledTextColor') ? parseHexColor(map['disabledTextColor']) : null, - elevation: map.containsKey('elevation') ? map['elevation'] : 0.0, + elevation: map.containsKey('elevation') ? map['elevation']?.toDouble() : 0.0, padding: map.containsKey('padding') ? parseEdgeInsetsGeometry(map['padding']) : null, diff --git a/WIDGETS.md b/WIDGETS.md index 95f3c28..55c90ec 100644 --- a/WIDGETS.md +++ b/WIDGETS.md @@ -1,472 +1,506 @@ # Dynamic Widget Manual + > Dynamic Widget Manual ## Table of contents -* [Container Widget](#container-widget) -* [Text Widget](#text-widget) -* [TextSpan](#textspan) -* [TextStyle](#textstyle) -* [RaisedButton Widget](#raisedbutton-widget) -* [Row Widget](#row-widget) -* [Column Widget](#column-widget) -* [AssetImage Widget](#assetimage-widget) -* [NetworkImage Widget](#networkimage-widget) -* [FileImage Widget](#fileimage-widget) -* [Placeholder Widget](#placeholder-widget) -* [GridView Widget](#gridview-widget) -* [ListView Widget](#listview-widget) -* [PageView Widget](#pageview-widget) -* [Expanded Widget](#expanded-widget) -* [Padding Widget](#padding-widget) -* [Center Widget](#center-widget) -* [Align Widget](#align-widget) -* [AspectRatio Widget](#aspectratio-widget) -* [FittedBox Widget](#fittedbox-widget) -* [Baseline Widget](#baseline-widget) -* [Stack Widget](#stack-widget) -* [Positioned Widget](#positioned-widget) -* [IndexedStack Widget](#indexedstack-widget) -* [ExpandedSizedBox Widget](#expandedsizedbox-widget) -* [SizedBox Widget](#sizedbox-widget) -* [Opacity Widget](#opacity-widget) -* [Wrap Widget](#wrap-widget) -* [ClipRRect Widget](#cliprrect-widget) -* [SafeArea Widget](#safearea-widget) -* [ListTile Widget](#listtile-widget) -* [SelectableText Widget](#selectabletext-widget) -* [Icon Widget](#icon-widget) -* [DropCapText Widget](#dropcaptext-widget) + +- [Container Widget](#container-widget) +- [Text Widget](#text-widget) +- [TextSpan](#textspan) +- [TextStyle](#textstyle) +- [RaisedButton Widget](#raisedbutton-widget) +- [Row Widget](#row-widget) +- [Column Widget](#column-widget) +- [AssetImage Widget](#assetimage-widget) +- [NetworkImage Widget](#networkimage-widget) +- [FileImage Widget](#fileimage-widget) +- [Placeholder Widget](#placeholder-widget) +- [GridView Widget](#gridview-widget) +- [ListView Widget](#listview-widget) +- [PageView Widget](#pageview-widget) +- [Expanded Widget](#expanded-widget) +- [Padding Widget](#padding-widget) +- [Center Widget](#center-widget) +- [Align Widget](#align-widget) +- [AspectRatio Widget](#aspectratio-widget) +- [FittedBox Widget](#fittedbox-widget) +- [Baseline Widget](#baseline-widget) +- [Stack Widget](#stack-widget) +- [Positioned Widget](#positioned-widget) +- [IndexedStack Widget](#indexedstack-widget) +- [ExpandedSizedBox Widget](#expandedsizedbox-widget) +- [SizedBox Widget](#sizedbox-widget) +- [Opacity Widget](#opacity-widget) +- [Wrap Widget](#wrap-widget) +- [ClipRRect Widget](#cliprrect-widget) +- [SafeArea Widget](#safearea-widget) +- [ListTile Widget](#listtile-widget) +- [SelectableText Widget](#selectabletext-widget) +- [Icon Widget](#icon-widget) +- [DropCapText Widget](#dropcaptext-widget) ## Container Widget + Container widget, here to see flutter [Container widget](https://docs.flutter.io/flutter/widgets/Container-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| alignment|Align the [child] within the container|String|One of the following string:
topLeft
topCenter
topRight
centerLeft
center
centerRight
bottomLeft
bottomCenter
bottomRight|"topLeft"| -| margin|Empty space to surround the [decoration] and [child].|String|left,top,right,bottom|"8,10,12,8"| -| padding|Empty space to inscribe inside the [decoration]. The [child], if any, isplaced inside this padding.|String|left,top,right,bottom|"8,10,12,8"| -| color|Container background color|String| "#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| width|Container width|double| |200| -| height|Container height|double| |200| -| constraints|Container constraints|BoxConstraints| {"minWidth":100, "maxWidth": 100, "minHeight": 100, "maxHeight": 100}
9999999999 would be the value of **double.infinity** |200| -| child|The [child] contained by the container.|Widget| | | -| click_event|Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. |String| |"route://productDetail?goods_id=123"| +| property | definition | type | value | sample | +| ----------- | ---------------------------------------------------------------------------------------------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | +| alignment | Align the [child] within the container | String | One of the following string:
topLeft
topCenter
topRight
centerLeft
center
centerRight
bottomLeft
bottomCenter
bottomRight | "topLeft" | +| margin | Empty space to surround the [decoration] and [child]. | String | left,top,right,bottom | "8,10,12,8" | +| padding | Empty space to inscribe inside the [decoration]. The [child], if any, isplaced inside this padding. | String | left,top,right,bottom | "8,10,12,8" | +| color | Container background color | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| width | Container width | double | | 200 | +| height | Container height | double | | 200 | +| constraints | Container constraints | BoxConstraints | {"minWidth":100, "maxWidth": 100, "minHeight": 100, "maxHeight": 100}
9999999999 would be the value of **double.infinity** | 200 | +| child | The [child] contained by the container. | Widget | | | +| click_event | Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. | String | | "route://productDetail?goods_id=123" | ## Text Widget + Text widget, here to see flutter [Text widget](https://docs.flutter.io/flutter/widgets/Text-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| data|The text to display|String| |"I am a text"| -| textAlign|How the text should be aligned horizontally.|String|One of the following string:
left (default)
right
center
justify
start
end|"left"| -| overflow|How visual overflow should be handled.|String|One of the following string:
ellipsis (default)
clip
fade|"ellipsis"| -| maxLines|An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to overflow. |int| |3| -| semanticsLabel|An alternative semantics label for this text.|String| || -| softWrap|Whether the text should break at soft line breaks.|bool| |true| -| textDirection|The directionality of the text.|String| One of the following string:
ltr (default)
rtl |"ltr"| -| textScaleFactor|The number of font pixels for each logical pixel.|double| | | -| textSpan|The text to display as a TextSpan. |TextSpan| | | +| property | definition | type | value | sample | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------- | ------------- | +| data | The text to display | String | | "I am a text" | +| textAlign | How the text should be aligned horizontally. | String | One of the following string:
left (default)
right
center
justify
start
end | "left" | +| overflow | How visual overflow should be handled. | String | One of the following string:
ellipsis (default)
clip
fade | "ellipsis" | +| maxLines | An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to overflow. | int | | 3 | +| semanticsLabel | An alternative semantics label for this text. | String | | | +| softWrap | Whether the text should break at soft line breaks. | bool | | true | +| textDirection | The directionality of the text. | String | One of the following string:
ltr (default)
rtl | "ltr" | +| textScaleFactor | The number of font pixels for each logical pixel. | double | | | +| textSpan | The text to display as a TextSpan. | TextSpan | | | ## TextSpan + TextSpan, here to see flutter [TextSpan](https://docs.flutter.io/flutter/painting/TextSpan-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| recognizer |Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. Currently only supports TapGestureRecognizer |String| |"route://productDetail?goods_id=123"| -| text|The text contained in the span.|String| |"I am a text"| -| style|The style to apply to the text and the children.|TextStyle| | {"color": "#00FFFF", "fontSize": 26.0}| -| children|Additional spans to include as children. |List<TextSpan>| | | +| property | definition | type | value | sample | +| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ----- | -------------------------------------- | +| recognizer | Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. Currently only supports TapGestureRecognizer | String | | "route://productDetail?goods_id=123" | +| text | The text contained in the span. | String | | "I am a text" | +| style | The style to apply to the text and the children. | TextStyle | | {"color": "#00FFFF", "fontSize": 26.0} | +| children | Additional spans to include as children. | List<TextSpan> | | | ## TextStyle + TextStyle, here to see flutter [TextStyle](https://docs.flutter.io/flutter/painting/TextStyle-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| color|The color to use when painting the text.|String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| debugLabel|A human-readable description of this text style. |String| | | -| decoration|The name of the decoration. |String| One of the following string: none (default)
lineThrough
overline
underline | "underline" | -| fontFamily|The name of the font to use when painting the text (e.g., Roboto). If the font is defined in a package, this will be prefixed with 'packages/package_name/' (e.g. 'packages/cool_fonts/Roboto'). The prefixing is done by the constructor when the package argument is provided.|String| | | -| fontSize|The size of glyphs (in logical pixels) to use when painting the text. |double| | | -| fontStyle|The typeface variant to use when drawing the letters (e.g., italics). |String|One of the following string: italic (default)
normal | "italic" | -| fontWeight|The typeface thickness to use when painting the text (e.g., bold). |String|One of the following string: w100
w200
w300
w400
w500
w600
w700
w800
w900
normal (default)
bold | "bold" | +| property | definition | type | value | sample | +| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | +| color | The color to use when painting the text. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| debugLabel | A human-readable description of this text style. | String | | | +| decoration | The name of the decoration. | String | One of the following string: none (default)
lineThrough
overline
underline | "underline" | +| fontFamily | The name of the font to use when painting the text (e.g., Roboto). If the font is defined in a package, this will be prefixed with 'packages/package_name/' (e.g. 'packages/cool_fonts/Roboto'). The prefixing is done by the constructor when the package argument is provided. | String | | | +| fontSize | The size of glyphs (in logical pixels) to use when painting the text. | double | | | +| fontStyle | The typeface variant to use when drawing the letters (e.g., italics). | String | One of the following string: italic (default)
normal | "italic" | +| fontWeight | The typeface thickness to use when painting the text (e.g., bold). | String | One of the following string: w100
w200
w300
w400
w500
w600
w700
w800
w900
normal (default)
bold | "bold" | ## RaisedButton Widget + RaisedButton widget, here to see flutter [RaisedButton widget](https://docs.flutter.io/flutter/widgets/Text-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| color|The button's fill color, displayed by its Material, while it is in its default (unpressed, enabled) state. |String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| disabledColor|The fill color of the button when the button is disabled. |String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| disabledElevation|The elevation for the button's Material when the button is not enabled.|double| | | -| disabledTextColor|The color to use for this button's text when the button is disabled.|String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| elevation|The z-coordinate at which to place this button. This controls the size of the shadow below the raised button.|double| | | -| padding|The internal padding for the button's child.|String|left,top,right,bottom|"8,10,12,8"| -| splashColor|The splash color of the button's InkWell.|String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| textColor|The color to use for this button's text.|String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| child|The button's label.|Widget| | | -| click_event|Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. |String| |"route://productDetail?goods_id=123"| +| property | definition | type | value | sample | +| ----------------- | ------------------------------------------------------------------------------------------------------------- | ------ | ------------------------ | ------------------------------------ | +| color | The button's fill color, displayed by its Material, while it is in its default (unpressed, enabled) state. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| disabledColor | The fill color of the button when the button is disabled. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| disabledElevation | The elevation for the button's Material when the button is not enabled. | double | | | +| disabledTextColor | The color to use for this button's text when the button is disabled. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| elevation | The z-coordinate at which to place this button. This controls the size of the shadow below the raised button. | double | | | +| padding | The internal padding for the button's child. | String | left,top,right,bottom | "8,10,12,8" | +| splashColor | The splash color of the button's InkWell. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| textColor | The color to use for this button's text. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| child | The button's label. | Widget | | | +| click_event | Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. | String | | "route://productDetail?goods_id=123" | ## Row Widget + Row widget, here to see flutter [Row widget](https://docs.flutter.io/flutter/widgets/Row-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| crossAxisAlignment|How the children should be placed along the cross axis.|String|One of the following string:
center (default)
start
end
stretch
baseline| | -| mainAxisAlignment|How the children should be placed along the main axis. |String|One of the following string:
start (default)
end
center
spaceBetween
spaceAround
spaceEvenly| | -| mainAxisSize|How much space should be occupied in the main axis.|String| One of the following string:
max (default)
min | | -| textBaseline|If aligning items according to their baseline, which baseline to use.|String|One of the following string:
ideographic (default)
alphabetic| | -| textDirection|Determines the order to lay children out horizontally and how to interpret start and end in the horizontal direction.|String| One of the following string:
ltr (default)
rtl | | -| verticalDirection|Determines the order to lay children out vertically and how to interpret start and end in the vertical direction.|String|One of the following string:
down (default)
up| | -| children|The widgets below this widget in the tree. |List<TextSpan>| | | +| property | definition | type | value | sample | +| ------------------ | --------------------------------------------------------------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------- | ------ | +| crossAxisAlignment | How the children should be placed along the cross axis. | String | One of the following string:
center (default)
start
end
stretch
baseline | | +| mainAxisAlignment | How the children should be placed along the main axis. | String | One of the following string:
start (default)
end
center
spaceBetween
spaceAround
spaceEvenly | | +| mainAxisSize | How much space should be occupied in the main axis. | String | One of the following string:
max (default)
min | | +| textBaseline | If aligning items according to their baseline, which baseline to use. | String | One of the following string:
ideographic (default)
alphabetic | | +| textDirection | Determines the order to lay children out horizontally and how to interpret start and end in the horizontal direction. | String | One of the following string:
ltr (default)
rtl | | +| verticalDirection | Determines the order to lay children out vertically and how to interpret start and end in the vertical direction. | String | One of the following string:
down (default)
up | | +| children | The widgets below this widget in the tree. | List<TextSpan> | | | ## Column Widget + Column widget, here to see flutter [Column widget](https://docs.flutter.io/flutter/widgets/Column-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| crossAxisAlignment|How the children should be placed along the cross axis.|String|One of the following string:
center (default)
start
end
stretch
baseline| | -| mainAxisAlignment|How the children should be placed along the main axis. |String|One of the following string:
start (default)
end
center
spaceBetween
spaceAround
spaceEvenly| | -| mainAxisSize|How much space should be occupied in the main axis.|String| One of the following string:
max (default)
min | | -| textBaseline|If aligning items according to their baseline, which baseline to use.|String|One of the following string:
ideographic (default)
alphabetic| | -| textDirection|Determines the order to lay children out horizontally and how to interpret start and end in the horizontal direction.|String| One of the following string:
ltr (default)
rtl | | -| verticalDirection|Determines the order to lay children out vertically and how to interpret start and end in the vertical direction.|String|One of the following string:
down (default)
up| | -| children|The widgets below this widget in the tree. |List<TextSpan>| | | +| property | definition | type | value | sample | +| ------------------ | --------------------------------------------------------------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------- | ------ | +| crossAxisAlignment | How the children should be placed along the cross axis. | String | One of the following string:
center (default)
start
end
stretch
baseline | | +| mainAxisAlignment | How the children should be placed along the main axis. | String | One of the following string:
start (default)
end
center
spaceBetween
spaceAround
spaceEvenly | | +| mainAxisSize | How much space should be occupied in the main axis. | String | One of the following string:
max (default)
min | | +| textBaseline | If aligning items according to their baseline, which baseline to use. | String | One of the following string:
ideographic (default)
alphabetic | | +| textDirection | Determines the order to lay children out horizontally and how to interpret start and end in the horizontal direction. | String | One of the following string:
ltr (default)
rtl | | +| verticalDirection | Determines the order to lay children out vertically and how to interpret start and end in the vertical direction. | String | One of the following string:
down (default)
up | | +| children | The widgets below this widget in the tree. | List<TextSpan> | | | ## AssetImage Widget + AssetImage widget, here to see flutter [Asset Image widget](https://docs.flutter.io/flutter/widgets/Image-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| name|The picture asset name|String||'images/cat.png' | -| semanticLabel|A Semantic description of the image. |String|| | -| excludeFromSemantics|Whether to exclude this image from semantics. |bool| | | -| scale||double| | | -| width|If non-null, require the image to have this width. |double| | | -| height|If non-null, require the image to have this height.|double| | | -| color|If non-null, this color is blended with each image pixel using colorBlendMode. |String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| blendMode|Used to combine color with this image. |String| enum values, please see enum BlendMode | 'srcIn' | -| boxFit|How to inscribe the image into the space allocated during layout. |String| enum values, please see enum BoxFit | 'none' | -| alignment|How to align the image within its bounds.|String|enum values, please see enum Alignment, default value is Alignment.center. |"center"| -| repeat|How to paint any portions of the layout bounds not covered by the image.|String| enum values, please see enum ImageRepeat, default value is ImageRepeat.noRepeat. | 'noRepeat'| -| centerSlice|The center slice for a nine-patch image.|String|left,top,right,bottom|"8,10,12,8"| -| matchTextDirection|Whether to paint the image in the direction of the TextDirection.|bool| | | -| gaplessPlayback|Whether to continue showing the old image (true), or briefly show nothing (false), when the image provider changes.|bool| | | -| filterQuality|Used to set the FilterQuality of the image.|String|enum values, please see enum FilterQuality, default value is FilterQuality.low. |"low"| -| click_event|Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. |String| |"route://productDetail?goods_id=123"| +| property | definition | type | value | sample | +| -------------------- | ------------------------------------------------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------------- | ------------------------------------ | +| name | The picture asset name | String | | 'images/cat.png' | +| semanticLabel | A Semantic description of the image. | String | | | +| excludeFromSemantics | Whether to exclude this image from semantics. | bool | | | +| scale | | double | | | +| width | If non-null, require the image to have this width. | double | | | +| height | If non-null, require the image to have this height. | double | | | +| color | If non-null, this color is blended with each image pixel using colorBlendMode. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| blendMode | Used to combine color with this image. | String | enum values, please see enum BlendMode | 'srcIn' | +| boxFit | How to inscribe the image into the space allocated during layout. | String | enum values, please see enum BoxFit | 'none' | +| alignment | How to align the image within its bounds. | String | enum values, please see enum Alignment, default value is Alignment.center. | "center" | +| repeat | How to paint any portions of the layout bounds not covered by the image. | String | enum values, please see enum ImageRepeat, default value is ImageRepeat.noRepeat. | 'noRepeat' | +| centerSlice | The center slice for a nine-patch image. | String | left,top,right,bottom | "8,10,12,8" | +| matchTextDirection | Whether to paint the image in the direction of the TextDirection. | bool | | | +| gaplessPlayback | Whether to continue showing the old image (true), or briefly show nothing (false), when the image provider changes. | bool | | | +| filterQuality | Used to set the FilterQuality of the image. | String | enum values, please see enum FilterQuality, default value is FilterQuality.low. | "low" | +| click_event | Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. | String | | "route://productDetail?goods_id=123" | ## NetworkImage Widget + NetworkImage widget, here to see flutter [Network Image widget](https://docs.flutter.io/flutter/widgets/Image-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| src|The picture url|String||'http://www.google.com/logo.png' | -| semanticLabel|A Semantic description of the image. |String|| | -| excludeFromSemantics|Whether to exclude this image from semantics. |bool| | | -| scale||double| | | -| width|If non-null, require the image to have this width. |double| | | -| height|If non-null, require the image to have this height.|double| | | -| color|If non-null, this color is blended with each image pixel using colorBlendMode. |String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| blendMode|Used to combine color with this image. |String| enum values, please see enum BlendMode | 'srcIn' | -| boxFit|How to inscribe the image into the space allocated during layout. |String| enum values, please see enum BoxFit | 'none' | -| alignment|How to align the image within its bounds.|String|enum values, please see enum Alignment, default value is Alignment.center. |"center"| -| repeat|How to paint any portions of the layout bounds not covered by the image.|String| enum values, please see enum ImageRepeat, default value is ImageRepeat.noRepeat. | 'noRepeat'| -| centerSlice|The center slice for a nine-patch image.|String|left,top,right,bottom|"8,10,12,8"| -| matchTextDirection|Whether to paint the image in the direction of the TextDirection.|bool| | | -| gaplessPlayback|Whether to continue showing the old image (true), or briefly show nothing (false), when the image provider changes.|bool| | | -| filterQuality|Used to set the FilterQuality of the image.|String|enum values, please see enum FilterQuality, default value is FilterQuality.low. |"low"| -| click_event|Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. |String| |"route://productDetail?goods_id=123"| +| property | definition | type | value | sample | +| -------------------- | ------------------------------------------------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------------- | ------------------------------------ | +| src | The picture url | String | | 'http://www.google.com/logo.png' | +| semanticLabel | A Semantic description of the image. | String | | | +| excludeFromSemantics | Whether to exclude this image from semantics. | bool | | | +| scale | | double | | | +| width | If non-null, require the image to have this width. | double | | | +| height | If non-null, require the image to have this height. | double | | | +| color | If non-null, this color is blended with each image pixel using colorBlendMode. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| blendMode | Used to combine color with this image. | String | enum values, please see enum BlendMode | 'srcIn' | +| boxFit | How to inscribe the image into the space allocated during layout. | String | enum values, please see enum BoxFit | 'none' | +| alignment | How to align the image within its bounds. | String | enum values, please see enum Alignment, default value is Alignment.center. | "center" | +| repeat | How to paint any portions of the layout bounds not covered by the image. | String | enum values, please see enum ImageRepeat, default value is ImageRepeat.noRepeat. | 'noRepeat' | +| centerSlice | The center slice for a nine-patch image. | String | left,top,right,bottom | "8,10,12,8" | +| matchTextDirection | Whether to paint the image in the direction of the TextDirection. | bool | | | +| gaplessPlayback | Whether to continue showing the old image (true), or briefly show nothing (false), when the image provider changes. | bool | | | +| filterQuality | Used to set the FilterQuality of the image. | String | enum values, please see enum FilterQuality, default value is FilterQuality.low. | "low" | +| click_event | Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. | String | | "route://productDetail?goods_id=123" | ## FileImage Widget + FileImage widget, here to see flutter [File Image widget](https://docs.flutter.io/flutter/widgets/Image-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| filePath|The picture file path|String||'/sdcard/logo.png' | -| semanticLabel|A Semantic description of the image. |String|| | -| excludeFromSemantics|Whether to exclude this image from semantics. |bool| | | -| scale||double| | | -| width|If non-null, require the image to have this width. |double| | | -| height|If non-null, require the image to have this height.|double| | | -| color|If non-null, this color is blended with each image pixel using colorBlendMode. |String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| blendMode|Used to combine color with this image. |String| enum values, please see enum BlendMode | 'srcIn' | -| boxFit|How to inscribe the image into the space allocated during layout. |String| enum values, please see enum BoxFit | 'none' | -| alignment|How to align the image within its bounds.|String|enum values, please see enum Alignment, default value is Alignment.center. |"center"| -| repeat|How to paint any portions of the layout bounds not covered by the image.|String| enum values, please see enum ImageRepeat, default value is ImageRepeat.noRepeat. | 'noRepeat'| -| centerSlice|The center slice for a nine-patch image.|String|left,top,right,bottom|"8,10,12,8"| -| matchTextDirection|Whether to paint the image in the direction of the TextDirection.|bool| | | -| gaplessPlayback|Whether to continue showing the old image (true), or briefly show nothing (false), when the image provider changes.|bool| | | -| filterQuality|Used to set the FilterQuality of the image.|String|enum values, please see enum FilterQuality, default value is FilterQuality.low. |"low"| -| click_event|Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. |String| |"route://productDetail?goods_id=123"| +| property | definition | type | value | sample | +| -------------------- | ------------------------------------------------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------------- | ------------------------------------ | +| filePath | The picture file path | String | | '/sdcard/logo.png' | +| semanticLabel | A Semantic description of the image. | String | | | +| excludeFromSemantics | Whether to exclude this image from semantics. | bool | | | +| scale | | double | | | +| width | If non-null, require the image to have this width. | double | | | +| height | If non-null, require the image to have this height. | double | | | +| color | If non-null, this color is blended with each image pixel using colorBlendMode. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| blendMode | Used to combine color with this image. | String | enum values, please see enum BlendMode | 'srcIn' | +| boxFit | How to inscribe the image into the space allocated during layout. | String | enum values, please see enum BoxFit | 'none' | +| alignment | How to align the image within its bounds. | String | enum values, please see enum Alignment, default value is Alignment.center. | "center" | +| repeat | How to paint any portions of the layout bounds not covered by the image. | String | enum values, please see enum ImageRepeat, default value is ImageRepeat.noRepeat. | 'noRepeat' | +| centerSlice | The center slice for a nine-patch image. | String | left,top,right,bottom | "8,10,12,8" | +| matchTextDirection | Whether to paint the image in the direction of the TextDirection. | bool | | | +| gaplessPlayback | Whether to continue showing the old image (true), or briefly show nothing (false), when the image provider changes. | bool | | | +| filterQuality | Used to set the FilterQuality of the image. | String | enum values, please see enum FilterQuality, default value is FilterQuality.low. | "low" | +| click_event | Url route string, for example: "route://productDetail?goods_id=123" for navigating to product detail page. | String | | "route://productDetail?goods_id=123" | ## Placeholder Widget + Placeholder widget, here to see flutter [Placeholder widget](https://docs.flutter.io/flutter/widgets/Placeholder-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| color|The color to draw the placeholder box.|String|"#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| strokeWidth|The width of the lines in the placeholder box. |double|| | -| fallbackWidth|The width to use when the placeholder is in a situation with an unbounded width.|double| | | -| fallbackHeight|The height to use when the placeholder is in a situation with an unbounded height. |double| | | +| property | definition | type | value | sample | +| -------------- | ---------------------------------------------------------------------------------- | ------ | ------------------------ | ------------------------ | +| color | The color to draw the placeholder box. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| strokeWidth | The width of the lines in the placeholder box. | double | | | +| fallbackWidth | The width to use when the placeholder is in a situation with an unbounded width. | double | | | +| fallbackHeight | The height to use when the placeholder is in a situation with an unbounded height. | double | | | ## GridView Widget + GridView widget, here to see flutter [GridView widget](https://docs.flutter.io/flutter/widgets/GridView-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| crossAxisCount|a fixed number of tiles in the cross axis.|int||| -| scrollDirection|The axis along which the scroll view scrolls. |String|enum values, please see enum Axis, default value is Axis.vertical.| "vertical" | -| reverse|Whether the scroll view scrolls in the reading direction.|bool| default value is false | | -| shrinkWrap|Whether the extent of the scroll view in the scrollDirection should be determined by the contents being viewed.|bool| default value is false | | -| cacheExtent|The viewport has an area before and after the visible area to cache items that are about to become visible when the user scrolls.|double| default value is 0.0 | | -| padding|The amount of space by which to inset the children.|String|left,top,right,bottom|"8,10,12,8"| -| mainAxisSpacing| The number of logical pixels between each child along the main axis.|double||| -| crossAxisSpacing| The number of logical pixels between each child along the cross axis.|double||| -| childAspectRatio| The ratio of the cross-axis to the main-axis extent of each child.|double||| -| children|The widgets below this widget in the tree. |List<Widget>| | | -| pageSize| ListView load more item count for next page|double||this will be append to load more url| -| loadMoreUrl| When listview scroll to bottom, it will do the request. The response of this url should be a json array of widget|String||| -| isDemo| used in the demo, if true, will do the fake request|bool||the default value is false| +| property | definition | type | value | sample | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------ | ------------------------------------ | +| crossAxisCount | a fixed number of tiles in the cross axis. | int | | | +| scrollDirection | The axis along which the scroll view scrolls. | String | enum values, please see enum Axis, default value is Axis.vertical. | "vertical" | +| reverse | Whether the scroll view scrolls in the reading direction. | bool | default value is false | | +| shrinkWrap | Whether the extent of the scroll view in the scrollDirection should be determined by the contents being viewed. | bool | default value is false | | +| cacheExtent | The viewport has an area before and after the visible area to cache items that are about to become visible when the user scrolls. | double | default value is 0.0 | | +| padding | The amount of space by which to inset the children. | String | left,top,right,bottom | "8,10,12,8" | +| mainAxisSpacing | The number of logical pixels between each child along the main axis. | double | | | +| crossAxisSpacing | The number of logical pixels between each child along the cross axis. | double | | | +| childAspectRatio | The ratio of the cross-axis to the main-axis extent of each child. | double | | | +| children | The widgets below this widget in the tree. | List<Widget> | | | +| pageSize | ListView load more item count for next page | int | | this will be append to load more url | +| loadMoreUrl | When listview scroll to bottom, it will do the request. The response of this url should be a json array of widget | String | | | +| isDemo | used in the demo, if true, will do the fake request | bool | | the default value is false | ## ListView Widget + ListView widget, here to see flutter [ListView widget](https://docs.flutter.io/flutter/widgets/ListView-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| scrollDirection|The axis along which the scroll view scrolls. |String|enum values, please see enum Axis, default value is Axis.vertical.| "vertical" | -| reverse|Whether the scroll view scrolls in the reading direction.|bool| default value is false | | -| shrinkWrap|Whether the extent of the scroll view in the scrollDirection should be determined by the contents being viewed.|bool| default value is false | | -| cacheExtent|The viewport has an area before and after the visible area to cache items that are about to become visible when the user scrolls.|double| default value is 0.0 | | -| padding|The amount of space by which to inset the children.|String|left,top,right,bottom|"8,10,12,8"| -| itemExtent| If non-null, forces the children to have the given extent in the scroll direction.|double||| -| pageSize| ListView load more item count for next page|double||this will be append to load more url| -| loadMoreUrl| When listview scroll to bottom, it will do the request. The response of this url should be a json array of widget|String||| -| isDemo| used in the demo, if true, will do the fake request|bool||the default value is false| -| children|The widgets below this widget in the tree. |List<Widget>| | | +| property | definition | type | value | sample | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------ | ------------------------------------ | +| scrollDirection | The axis along which the scroll view scrolls. | String | enum values, please see enum Axis, default value is Axis.vertical. | "vertical" | +| reverse | Whether the scroll view scrolls in the reading direction. | bool | default value is false | | +| shrinkWrap | Whether the extent of the scroll view in the scrollDirection should be determined by the contents being viewed. | bool | default value is false | | +| cacheExtent | The viewport has an area before and after the visible area to cache items that are about to become visible when the user scrolls. | double | default value is 0.0 | | +| padding | The amount of space by which to inset the children. | String | left,top,right,bottom | "8,10,12,8" | +| itemExtent | If non-null, forces the children to have the given extent in the scroll direction. | double | | | +| pageSize | ListView load more item count for next page | int | | this will be append to load more url | +| loadMoreUrl | When listview scroll to bottom, it will do the request. The response of this url should be a json array of widget | String | | | +| isDemo | used in the demo, if true, will do the fake request | bool | | the default value is false | +| children | The widgets below this widget in the tree. | List<Widget> | | | ## PageView Widget + PageView widget, here to see flutter [PageView widget](https://docs.flutter.io/flutter/widgets/PageView-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| scrollDirection|The axis along which the scroll view scrolls. |String|enum values, please see enum Axis, default value is Axis.vertical.| "vertical" | -| reverse|Whether the scroll view scrolls in the reading direction.|bool| default value is false | | -| pageSnapping|Set to false to disable page snapping, useful for custom scroll behavior.|bool|default value is true|| -| children|The widgets below this widget in the tree. |List<Widget>| | | +| property | definition | type | value | sample | +| --------------- | ------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------ | ---------- | +| scrollDirection | The axis along which the scroll view scrolls. | String | enum values, please see enum Axis, default value is Axis.vertical. | "vertical" | +| reverse | Whether the scroll view scrolls in the reading direction. | bool | default value is false | | +| pageSnapping | Set to false to disable page snapping, useful for custom scroll behavior. | bool | default value is true | | +| children | The widgets below this widget in the tree. | List<Widget> | | | ## Expanded Widget + Expanded widget, here to see flutter [Expanded widget](https://docs.flutter.io/flutter/widgets/Expanded-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| child|child widget |Widget|| | -| flex|The flex factor to use for this child|int| default value is 1 | | +| property | definition | type | value | sample | +| -------- | ------------------------------------- | ------ | ------------------ | ------ | +| child | child widget | Widget | | | +| flex | The flex factor to use for this child | int | default value is 1 | | ## Padding Widget + Padding widget, here to see flutter [Padding widget](https://docs.flutter.io/flutter/widgets/Padding-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| child|child widget |Widget|| | -| padding|The amount of space by which to inset the child.|String|left,top,right,bottom|"8,10,12,8"| +| property | definition | type | value | sample | +| -------- | ------------------------------------------------ | ------ | --------------------- | ----------- | +| child | child widget | Widget | | | +| padding | The amount of space by which to inset the child. | String | left,top,right,bottom | "8,10,12,8" | ## Center Widget + Center widget, here to see flutter [Center widget](https://docs.flutter.io/flutter/widgets/Center-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| child|child widget |Widget|| | -| widthFactor|If non-null, sets its width to the child's width multiplied by this factor.|double||| -| heightFactor|If non-null, sets its height to the child's height multiplied by this factor. |double||| +| property | definition | type | value | sample | +| ------------ | ----------------------------------------------------------------------------- | ------ | ----- | ------ | +| child | child widget | Widget | | | +| widthFactor | If non-null, sets its width to the child's width multiplied by this factor. | double | | | +| heightFactor | If non-null, sets its height to the child's height multiplied by this factor. | double | | | ## Align Widget + Align widget, here to see flutter [Align widget](https://docs.flutter.io/flutter/widgets/Align-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| alignment|How to align the child. |String|enum values, please see enum Alignment, default value is Alignment.center.| | -| child|child widget |Widget|| | -| widthFactor|If non-null, sets its width to the child's width multiplied by this factor.|double||| -| heightFactor|If non-null, sets its height to the child's height multiplied by this factor. |double||| +| property | definition | type | value | sample | +| ------------ | ----------------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------- | ------ | +| alignment | How to align the child. | String | enum values, please see enum Alignment, default value is Alignment.center. | | +| child | child widget | Widget | | | +| widthFactor | If non-null, sets its width to the child's width multiplied by this factor. | double | | | +| heightFactor | If non-null, sets its height to the child's height multiplied by this factor. | double | | | ## AspectRatio Widget + AspectRatio widget, here to see flutter [AspectRatio widget](https://docs.flutter.io/flutter/widgets/AspectRatio-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| aspectRatio|The aspect ratio to attempt to use. |double|| | -| child|child widget |Widget|| | +| property | definition | type | value | sample | +| ----------- | ----------------------------------- | ------ | ----- | ------ | +| aspectRatio | The aspect ratio to attempt to use. | double | | | +| child | child widget | Widget | | | ## FittedBox Widget + FittedBox widget, here to see flutter [FittedBox widget](https://docs.flutter.io/flutter/widgets/FittedBox-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| alignment|How to align the child within its parent's bounds. |String|enum values, please see enum Alignment, default value is Alignment.center.| | -| fit|How to inscribe the child into the space allocated during layout. |String|enum values, please see enum BoxFit, default value is BoxFit.contain.| | -| child|child widget |Widget|| | +| property | definition | type | value | sample | +| --------- | ----------------------------------------------------------------- | ------ | -------------------------------------------------------------------------- | ------ | +| alignment | How to align the child within its parent's bounds. | String | enum values, please see enum Alignment, default value is Alignment.center. | | +| fit | How to inscribe the child into the space allocated during layout. | String | enum values, please see enum BoxFit, default value is BoxFit.contain. | | +| child | child widget | Widget | | | ## Baseline Widget + Baseline widget, here to see flutter [Baseline widget](https://docs.flutter.io/flutter/widgets/Baseline-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| baseline|The number of logical pixels from the top of this box at which to position the child's baseline. |double| | | -| baselineType|The type of baseline to use for positioning the child. |String|enum values, please see enum TextBaseline, default value is TextBaseline.ideographic.| | -| child|child widget |Widget|| | +| property | definition | type | value | sample | +| ------------ | ------------------------------------------------------------------------------------------------ | ------ | ------------------------------------------------------------------------------------- | ------ | +| baseline | The number of logical pixels from the top of this box at which to position the child's baseline. | double | | | +| baselineType | The type of baseline to use for positioning the child. | String | enum values, please see enum TextBaseline, default value is TextBaseline.ideographic. | | +| child | child widget | Widget | | | ## Stack Widget + Stack widget, here to see flutter [Stack widget](https://docs.flutter.io/flutter/widgets/Stack-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| alignment|How to align the non-positioned and partially-positioned children in the stack.|String|enum values, please see enum Alignment, default value is Alignment.center. |"center"| -| fit|How to size the non-positioned children in the stack. |String|enum values, please see enum StackFit, default value is StackFit.loose.| | -| clipBehavior|The content will be clipped (or not) according to this option. |String|enum values, please see enum Clip, default value is Clip.hardEdge.| | -| textDirection|The text direction with which to resolve alignment. |String|enum values, please see enum TextDirection| | -| children|list of Widget |List<Widget>|| | +| property | definition | type | value | sample | +| ------------- | ------------------------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------- | -------- | +| alignment | How to align the non-positioned and partially-positioned children in the stack. | String | enum values, please see enum Alignment, default value is Alignment.center. | "center" | +| fit | How to size the non-positioned children in the stack. | String | enum values, please see enum StackFit, default value is StackFit.loose. | | +| clipBehavior | The content will be clipped (or not) according to this option. | String | enum values, please see enum Clip, default value is Clip.hardEdge. | | +| textDirection | The text direction with which to resolve alignment. | String | enum values, please see enum TextDirection | | +| children | list of Widget | List<Widget> | | | ## Positioned Widget + Positioned widget, here to see flutter [Positioned widget](https://docs.flutter.io/flutter/widgets/Positioned-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| bottom|The distance that the child's bottom edge is inset from the bottom of the stack.|double| || -| height |The child's height.|double| || -| left |The distance that the child's left edge is inset from the left of the stack.|double| || -| right |The distance that the child's right edge is inset from the right of the stack. |double| || -| top|The distance that the child's top edge is inset from the top of the stack. |double| || -| width |The child's width.|double| || -| child|The widget below this widget in the tree. |Widget|| | +| property | definition | type | value | sample | +| -------- | -------------------------------------------------------------------------------- | ------ | ----- | ------ | +| bottom | The distance that the child's bottom edge is inset from the bottom of the stack. | double | | | +| height | The child's height. | double | | | +| left | The distance that the child's left edge is inset from the left of the stack. | double | | | +| right | The distance that the child's right edge is inset from the right of the stack. | double | | | +| top | The distance that the child's top edge is inset from the top of the stack. | double | | | +| width | The child's width. | double | | | +| child | The widget below this widget in the tree. | Widget | | | ## IndexedStack Widget + IndexedStack widget, here to see flutter [IndexedStack widget](https://docs.flutter.io/flutter/widgets/IndexedStack-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| index |The index of the child to show.|int| || -| alignment|How to align the non-positioned and partially-positioned children in the stack.|String|enum values, please see enum Alignment, default value is Alignment.center. |"center"| -| textDirection|The text direction with which to resolve alignment. |String|enum values, please see enum TextDirection| | -| children|list of Widget |List<Widget>|| | +| property | definition | type | value | sample | +| ------------- | ------------------------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------- | -------- | +| index | The index of the child to show. | int | | | +| alignment | How to align the non-positioned and partially-positioned children in the stack. | String | enum values, please see enum Alignment, default value is Alignment.center. | "center" | +| textDirection | The text direction with which to resolve alignment. | String | enum values, please see enum TextDirection | | +| children | list of Widget | List<Widget> | | | ## ExpandedSizedBox Widget + ExpandedSizedBox widget, here to see flutter [ExpandedSizedBox widget](https://docs.flutter.io/flutter/widgets/SizedBox-class.html) definition. It's a shortcut of **SizedBox.expand**. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| child|The widget below this widget in the tree. |Widget|| | +| property | definition | type | value | sample | +| -------- | ----------------------------------------- | ------ | ----- | ------ | +| child | The widget below this widget in the tree. | Widget | | | ## SizedBox Widget + SizedBox widget, here to see flutter [SizedBox widget](https://docs.flutter.io/flutter/widgets/SizedBox-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| width |If non-null, requires the child to have exactly this width.|double| || -| height |If non-null, requires the child to have exactly this height.|double| || -| child|The widget below this widget in the tree. |Widget|| | +| property | definition | type | value | sample | +| -------- | ------------------------------------------------------------ | ------ | ----- | ------ | +| width | If non-null, requires the child to have exactly this width. | double | | | +| height | If non-null, requires the child to have exactly this height. | double | | | +| child | The widget below this widget in the tree. | Widget | | | ## Opacity Widget + Opacity widget, here to see flutter [Opacity widget](https://docs.flutter.io/flutter/widgets/Opacity-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| alwaysIncludeSemantics |Whether the semantic information of the children is always included.|bool| || -| opacity |The fraction to scale the child's alpha value.|double| || -| child|The widget below this widget in the tree. |Widget|| | +| property | definition | type | value | sample | +| ---------------------- | -------------------------------------------------------------------- | ------ | ----- | ------ | +| alwaysIncludeSemantics | Whether the semantic information of the children is always included. | bool | | | +| opacity | The fraction to scale the child's alpha value. | double | | | +| child | The widget below this widget in the tree. | Widget | | | ## Wrap Widget + Wrap widget, here to see flutter [Wrap widget](https://docs.flutter.io/flutter/widgets/Wrap-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| alignment |How the children within a run should be placed in the main axis.|String|enum values, please see enum WrapAlignment, default value is WrapAlignment.start. |"start"| -| crossAxisAlignment |How the children within a run should be aligned relative to each other in the cross axis.|String|enum values, please see enum WrapCrossAlignment, default value is WrapCrossAlignment.start. |"start"| -| direction |The direction to use as the main axis.|String|enum values, please see enum Axis, default value is Axis.horizontal. |"horizontal"| -| runAlignment |How the runs themselves should be placed in the cross axis. |String|enum values, please see enum WrapAlignment, default value is WrapAlignment.start. |"start"| -| runSpacing |The fraction to scale the child's alpha value.|double| |0.0| -| spacing |How much space to place between children in a run in the main axis.|double| |0.0| -| textDirection |Determines the order to lay children out horizontally and how to interpret start and end in the horizontal direction.|String|enum values, please see enum TextDirection, default value is null. |null| -| verticalDirection |Determines the order to lay children out vertically and how to interpret start and end in the vertical direction. |String|enum values, please see enum VerticalDirection, default value is VerticalDirection.down. |"down"| -| children|The widgets below this widget in the tree. |List<Widget>| | | +| property | definition | type | value | sample | +| ------------------ | --------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------- | ------------ | +| alignment | How the children within a run should be placed in the main axis. | String | enum values, please see enum WrapAlignment, default value is WrapAlignment.start. | "start" | +| crossAxisAlignment | How the children within a run should be aligned relative to each other in the cross axis. | String | enum values, please see enum WrapCrossAlignment, default value is WrapCrossAlignment.start. | "start" | +| direction | The direction to use as the main axis. | String | enum values, please see enum Axis, default value is Axis.horizontal. | "horizontal" | +| runAlignment | How the runs themselves should be placed in the cross axis. | String | enum values, please see enum WrapAlignment, default value is WrapAlignment.start. | "start" | +| runSpacing | The fraction to scale the child's alpha value. | double | | 0.0 | +| spacing | How much space to place between children in a run in the main axis. | double | | 0.0 | +| textDirection | Determines the order to lay children out horizontally and how to interpret start and end in the horizontal direction. | String | enum values, please see enum TextDirection, default value is null. | null | +| verticalDirection | Determines the order to lay children out vertically and how to interpret start and end in the vertical direction. | String | enum values, please see enum VerticalDirection, default value is VerticalDirection.down. | "down" | +| children | The widgets below this widget in the tree. | List<Widget> | | | ## ClipRRect Widget + ClipRRect, here to see flutter [ClipRRect](https://api.flutter.dev/flutter/widgets/ClipRRect-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| borderRadius|The border radius of the rounded corners. |String| |"topLeft,topRight,bottomLeft,bottomRight"| -| clipBehavior|Controls how to clip (default to "antiAlias")|String|enum values, please see enum Clip, default value is antiAlias. | "hardEdge"| -| child|The widget below this widget in the tree. |Widget|| | +| property | definition | type | value | sample | +| ------------ | --------------------------------------------- | ------ | -------------------------------------------------------------- | ----------------------------------------- | +| borderRadius | The border radius of the rounded corners. | String | | "topLeft,topRight,bottomLeft,bottomRight" | +| clipBehavior | Controls how to clip (default to "antiAlias") | String | enum values, please see enum Clip, default value is antiAlias. | "hardEdge" | +| child | The widget below this widget in the tree. | Widget | | | ## SafeArea Widget + SafeArea, here to see flutter [SafeArea](https://api.flutter.dev/flutter/widgets/SafeArea-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| bottom |Whether to avoid system intrusions on the bottom side of the screen.|bool| true or false, default is true|true| -| right |Whether to avoid system intrusions on the right.|bool| true or false, default is true|true| -| top |Whether to avoid system intrusions at the top of the screen, typically the system status bar.|bool| true or false, default is true|true| -| left |Whether to avoid system intrusions on the left.|bool| true or false, default is true|true| -| minimum |This minimum padding to apply.|String|left,top,right,bottom|"8,10,12,8"| -| child|The widget below this widget in the tree. |Widget|| | +| property | definition | type | value | sample | +| -------- | --------------------------------------------------------------------------------------------- | ------ | ------------------------------ | ----------- | +| bottom | Whether to avoid system intrusions on the bottom side of the screen. | bool | true or false, default is true | true | +| right | Whether to avoid system intrusions on the right. | bool | true or false, default is true | true | +| top | Whether to avoid system intrusions at the top of the screen, typically the system status bar. | bool | true or false, default is true | true | +| left | Whether to avoid system intrusions on the left. | bool | true or false, default is true | true | +| minimum | This minimum padding to apply. | String | left,top,right,bottom | "8,10,12,8" | +| child | The widget below this widget in the tree. | Widget | | | ## ListTile Widget + ListTile, here to see flutter [ListTile](https://api.flutter.dev/flutter/material/ListTile-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| contentPadding |The tile's internal padding.|String| left,top,right,bottom|"8,10,12,8"| -| dense |Whether this list tile is part of a vertically dense list.|bool| true or false, default is false|true| -| enabled |Whether this list tile is interactive.|bool| true or false, default is true|true| -| isThreeLine |Whether this list tile is intended to display three lines of text.|bool| true or false, default is false|true| -| leading |A widget to display before the title.|Widget||| -| tapEvent |tap event |String||route://goToProductDetail| -| selected |If this tile is also enabled then icons and text are rendered with the same color.|bool| true or false, default is false|true| -| subtitle |Additional content displayed below the title.|Widget||| -| title |The primary content of the list tile.|Widget||| -| trailing |A widget to display after the title.|Widget||| +| property | definition | type | value | sample | +| -------------- | ---------------------------------------------------------------------------------- | ------ | ------------------------------- | ------------------------- | +| contentPadding | The tile's internal padding. | String | left,top,right,bottom | "8,10,12,8" | +| dense | Whether this list tile is part of a vertically dense list. | bool | true or false, default is false | true | +| enabled | Whether this list tile is interactive. | bool | true or false, default is true | true | +| isThreeLine | Whether this list tile is intended to display three lines of text. | bool | true or false, default is false | true | +| leading | A widget to display before the title. | Widget | | | +| tapEvent | tap event | String | | route://goToProductDetail | +| selected | If this tile is also enabled then icons and text are rendered with the same color. | bool | true or false, default is false | true | +| subtitle | Additional content displayed below the title. | Widget | | | +| title | The primary content of the list tile. | Widget | | | +| trailing | A widget to display after the title. | Widget | | | ## SelectableText Widget + SelectableText, here to see flutter [SelectableText](https://api.flutter.dev/flutter/material/SelectableText-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| data|The text to display|String| |"I am a text"| -| textAlign|How the text should be aligned horizontally.|String|One of the following string:
left (default)
right
center
justify
start
end|"left"| -| maxLines|An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to overflow. |int| |3| -| textDirection|The directionality of the text.|String| One of the following string:
ltr (default)
rtl |"ltr"| -| textSpan|The text to display as a TextSpan. |TextSpan| | | +| property | definition | type | value | sample | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------- | ------------- | +| data | The text to display | String | | "I am a text" | +| textAlign | How the text should be aligned horizontally. | String | One of the following string:
left (default)
right
center
justify
start
end | "left" | +| maxLines | An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to overflow. | int | | 3 | +| textDirection | The directionality of the text. | String | One of the following string:
ltr (default)
rtl | "ltr" | +| textSpan | The text to display as a TextSpan. | TextSpan | | | ## Icon Widget + Icon, here to see flutter [Icon](https://api.flutter.dev/flutter/widgets/Icon-class.html) definition. Supported json properties: -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| data|The icon to display. The available icons are described |String| |"fa.google" : font_awesome_flutter lib's icon, "favorite" : flutter's icon| -| size|The size of the icon in logical pixels. |double||12.0| -| color|The color to use when drawing the icon.|String| "#AARRGGBB" or "#RRGGBB"|"#FF00FF"
"#00FF00FF"| -| semanticLabel|Semantic label for the icon.|String| || -| textDirection|The text direction to use for rendering the icon.|String| One of the following string:
ltr (default)
rtl |"ltr"| +| property | definition | type | value | sample | +| ------------- | ------------------------------------------------------ | ------ | ----------------------------------------------------- | -------------------------------------------------------------------------- | +| data | The icon to display. The available icons are described | String | | "fa.google" : font_awesome_flutter lib's icon, "favorite" : flutter's icon | +| size | The size of the icon in logical pixels. | double | | 12.0 | +| color | The color to use when drawing the icon. | String | "#AARRGGBB" or "#RRGGBB" | "#FF00FF"
"#00FF00FF" | +| semanticLabel | Semantic label for the icon. | String | | | +| textDirection | The text direction to use for rendering the icon. | String | One of the following string:
ltr (default)
rtl | "ltr" | ## DropCapText Widget -DropCapText, Supported json properties: - -| property | definition | type | value | sample | -| ---| ---| --- | ---| ---| -| data|The text to display |String| ||"I am a text"| -| selectable|Text can be selected |bool||| -| mode|Drop cap mode|String| One of the following string:
inside (default)
upwards
aside
baseline |"#FF00FF"
"#00FF00FF"| -| style|The style to apply to the text and the children.|TextStyle| | {"color": "#00FFFF", "fontSize": 26.0}| -| dropCapStyle|The drop cap letter style|TextStyle| | {"color": "#00FFFF", "fontSize": 26.0}| -| textAlign|How the text should be aligned horizontally.|String|One of the following string:
left (default)
right
center
justify
start
end|"left"| -| dropCap|The drop cap |Widget | {"width":216.1,"height":162.1,"child":{"type":"NetworkImage","src":"https://b.appsimg.com/upload/momin/2019/01/23/101/1548249269085.png ","click_event" : "route://productDetail?goods_id=123"}}| -| dropCapStyle|The drop cap padding|String|left,top,right,bottom|"8,10,12,8"| -| dropCapChars|The drop cap chars length|int||1| -| forceNoDescent|forceNoDescent|bool||| -| parseInlineMarkdown|if parse markdown |bool||| -| textDirection|The directionality of the text.|String| One of the following string:
ltr (default)
rtl |"ltr"| -| overflow|How visual overflow should be handled.|String|One of the following string:
ellipsis (default)
clip
fade|"ellipsis"| -| maxLines|An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to overflow. |int| One of the following string:
start (default)
end|"end"| -| dropCapPosition|drop cap position |String| |3| - +DropCapText, Supported json properties: + +| property | definition | type | value | sample | +| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------- | +| data | The text to display | String | | | "I am a text" | +| selectable | Text can be selected | bool | | | +| mode | Drop cap mode | String | One of the following string:
inside (default)
upwards
aside
baseline | "#FF00FF"
"#00FF00FF" | +| style | The style to apply to the text and the children. | TextStyle | | {"color": "#00FFFF", "fontSize": 26.0} | +| dropCapStyle | The drop cap letter style | TextStyle | | {"color": "#00FFFF", "fontSize": 26.0} | +| textAlign | How the text should be aligned horizontally. | String | One of the following string:
left (default)
right
center
justify
start
end | "left" | +| dropCap | The drop cap | Widget | {"width":216.1,"height":162.1,"child":{"type":"NetworkImage","src":"https://b.appsimg.com/upload/momin/2019/01/23/101/1548249269085.png ","click_event" : "route://productDetail?goods_id=123"}} | +| dropCapStyle | The drop cap padding | String | left,top,right,bottom | "8,10,12,8" | +| dropCapChars | The drop cap chars length | int | | 1 | +| forceNoDescent | forceNoDescent | bool | | | +| parseInlineMarkdown | if parse markdown | bool | | | +| textDirection | The directionality of the text. | String | One of the following string:
ltr (default)
rtl | "ltr" | +| overflow | How visual overflow should be handled. | String | One of the following string:
ellipsis (default)
clip
fade | "ellipsis" | +| maxLines | An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to overflow. | int | One of the following string:
start (default)
end | "end" | +| dropCapPosition | drop cap position | String | | 3 | diff --git a/lib/dynamic_widget/basic/align_widget_parser.dart b/lib/dynamic_widget/basic/align_widget_parser.dart index 5d70469..b57047b 100644 --- a/lib/dynamic_widget/basic/align_widget_parser.dart +++ b/lib/dynamic_widget/basic/align_widget_parser.dart @@ -10,9 +10,9 @@ class AlignWidgetParser extends WidgetParser { alignment: map.containsKey("alignment") ? parseAlignment(map["alignment"]) : Alignment.center, - widthFactor: map.containsKey("widthFactor") ? map["widthFactor"] : null, + widthFactor: map.containsKey("widthFactor") ? map["widthFactor"]?.toDouble() : null, heightFactor: - map.containsKey("heightFactor") ? map["heightFactor"] : null, + map.containsKey("heightFactor") ? map["heightFactor"]?.toDouble() : null, child: DynamicWidgetBuilder.buildFromMap( map["child"], buildContext, listener), ); diff --git a/lib/dynamic_widget/basic/aspectratio_widget_parser.dart b/lib/dynamic_widget/basic/aspectratio_widget_parser.dart index 88b8ef6..fb5a800 100644 --- a/lib/dynamic_widget/basic/aspectratio_widget_parser.dart +++ b/lib/dynamic_widget/basic/aspectratio_widget_parser.dart @@ -6,7 +6,7 @@ class AspectRatioWidgetParser extends WidgetParser { Widget parse(Map map, BuildContext buildContext, ClickListener listener) { return AspectRatio( - aspectRatio: map["aspectRatio"], + aspectRatio: map["aspectRatio"]?.toDouble(), child: DynamicWidgetBuilder.buildFromMap( map["child"], buildContext, listener), ); diff --git a/lib/dynamic_widget/basic/baseline_widget_parser.dart b/lib/dynamic_widget/basic/baseline_widget_parser.dart index 11e736f..4ebb990 100644 --- a/lib/dynamic_widget/basic/baseline_widget_parser.dart +++ b/lib/dynamic_widget/basic/baseline_widget_parser.dart @@ -6,7 +6,7 @@ class BaselineWidgetParser extends WidgetParser { Widget parse(Map map, BuildContext buildContext, ClickListener listener) { return Baseline( - baseline: map["baseline"], + baseline: map["baseline"]?.toDouble(), baselineType: map["baselineType"] == "alphabetic" ? TextBaseline.alphabetic : TextBaseline.ideographic, @@ -24,8 +24,10 @@ class BaselineWidgetParser extends WidgetParser { return { "type": widgetName, "baseline": realWidget.baseline, - "baselineType" : realWidget.baselineType == TextBaseline.alphabetic ? "alphabetic":"ideographic", - "child":DynamicWidgetBuilder.export(realWidget.child, buildContext) + "baselineType": realWidget.baselineType == TextBaseline.alphabetic + ? "alphabetic" + : "ideographic", + "child": DynamicWidgetBuilder.export(realWidget.child, buildContext) }; } diff --git a/lib/dynamic_widget/basic/button_widget_parser.dart b/lib/dynamic_widget/basic/button_widget_parser.dart index d79c638..8bfb383 100644 --- a/lib/dynamic_widget/basic/button_widget_parser.dart +++ b/lib/dynamic_widget/basic/button_widget_parser.dart @@ -14,12 +14,14 @@ class RaisedButtonParser extends WidgetParser { disabledColor: map.containsKey('disabledColor') ? parseHexColor(map['disabledColor']) : null, - disabledElevation: - map.containsKey('disabledElevation') ? map['disabledElevation'] : 0.0, + disabledElevation: map.containsKey('disabledElevation') + ? map['disabledElevation']?.toDouble() + : 0.0, disabledTextColor: map.containsKey('disabledTextColor') ? parseHexColor(map['disabledTextColor']) : null, - elevation: map.containsKey('elevation') ? map['elevation'] : 0.0, + elevation: + map.containsKey('elevation') ? map['elevation']?.toDouble() : 0.0, padding: map.containsKey('padding') ? parseEdgeInsetsGeometry(map['padding']) : null, @@ -48,16 +50,27 @@ class RaisedButtonParser extends WidgetParser { return { "type": widgetName, - "color": realWidget.color != null ? realWidget.color.value.toRadixString(16):null, - "disabledColor" : realWidget.disabledColor !=null? realWidget.disabledColor.value.toRadixString(16):null, + "color": realWidget.color != null + ? realWidget.color.value.toRadixString(16) + : null, + "disabledColor": realWidget.disabledColor != null + ? realWidget.disabledColor.value.toRadixString(16) + : null, "disabledElevation": realWidget.disabledElevation, - "disabledTextColor": realWidget.disabledTextColor!=null ?realWidget.disabledTextColor.value.toRadixString(16):null, + "disabledTextColor": realWidget.disabledTextColor != null + ? realWidget.disabledTextColor.value.toRadixString(16) + : null, "elevation": realWidget.elevation, - "padding": padding !=null ? "${padding.left},${padding.top},${padding.right},${padding.bottom}" : null, - "splashColor": realWidget.splashColor!=null ? realWidget.splashColor.value.toRadixString(16) : null, - "textColor": realWidget.textColor!=null?realWidget.textColor.value.toRadixString(16):null, - "child":DynamicWidgetBuilder.export(realWidget.child, buildContext) - + "padding": padding != null + ? "${padding.left},${padding.top},${padding.right},${padding.bottom}" + : null, + "splashColor": realWidget.splashColor != null + ? realWidget.splashColor.value.toRadixString(16) + : null, + "textColor": realWidget.textColor != null + ? realWidget.textColor.value.toRadixString(16) + : null, + "child": DynamicWidgetBuilder.export(realWidget.child, buildContext) }; } diff --git a/lib/dynamic_widget/basic/center_widget_parser.dart b/lib/dynamic_widget/basic/center_widget_parser.dart index 298322c..4279aef 100644 --- a/lib/dynamic_widget/basic/center_widget_parser.dart +++ b/lib/dynamic_widget/basic/center_widget_parser.dart @@ -6,9 +6,9 @@ class CenterWidgetParser extends WidgetParser { Widget parse(Map map, BuildContext buildContext, ClickListener listener) { return Center( - widthFactor: map.containsKey("widthFactor") ? map["widthFactor"] : null, + widthFactor: map.containsKey("widthFactor") ? map["widthFactor"]?.toDouble() : null, heightFactor: - map.containsKey("heightFactor") ? map["heightFactor"] : null, + map.containsKey("heightFactor") ? map["heightFactor"]?.toDouble() : null, child: DynamicWidgetBuilder.buildFromMap( map["child"], buildContext, listener), ); diff --git a/lib/dynamic_widget/basic/container_widget_parser.dart b/lib/dynamic_widget/basic/container_widget_parser.dart index f223aa6..11becab 100644 --- a/lib/dynamic_widget/basic/container_widget_parser.dart +++ b/lib/dynamic_widget/basic/container_widget_parser.dart @@ -25,8 +25,8 @@ class ContainerWidgetParser extends WidgetParser { padding: padding, color: color, margin: margin, - width: map['width'], - height: map['height'], + width: map['width']?.toDouble(), + height: map['height']?.toDouble(), constraints: constraints, child: child, ); diff --git a/lib/dynamic_widget/basic/icon_widget_parser.dart b/lib/dynamic_widget/basic/icon_widget_parser.dart index ac9eeaf..048b5ed 100644 --- a/lib/dynamic_widget/basic/icon_widget_parser.dart +++ b/lib/dynamic_widget/basic/icon_widget_parser.dart @@ -11,7 +11,7 @@ class IconWidgetParser extends WidgetParser { map.containsKey('data') ? getIconUsingPrefix(name: map['data']) : Icons.android, - size: map.containsKey("size") ? map['size'] : null, + size: map.containsKey("size") ? map['size']?.toDouble() : null, color: map.containsKey('color') ? parseHexColor(map['color']) : null, semanticLabel: map.containsKey('semanticLabel') ? map['semanticLabel'] : null, @@ -31,9 +31,13 @@ class IconWidgetParser extends WidgetParser { "type": widgetName, "data": exportIconGuessFavorMaterial(realWidget.icon), "size": realWidget.size, - "color": realWidget.color!=null?realWidget.color.value.toRadixString(16):null, + "color": realWidget.color != null + ? realWidget.color.value.toRadixString(16) + : null, "semanticLabel": realWidget.semanticLabel, - "textDirection": realWidget.textDirection!=null? exportTextDirection(realWidget.textDirection):null, + "textDirection": realWidget.textDirection != null + ? exportTextDirection(realWidget.textDirection) + : null, }; } diff --git a/lib/dynamic_widget/basic/image_widget_parser.dart b/lib/dynamic_widget/basic/image_widget_parser.dart index 9fa05fa..1a93dfa 100644 --- a/lib/dynamic_widget/basic/image_widget_parser.dart +++ b/lib/dynamic_widget/basic/image_widget_parser.dart @@ -14,9 +14,9 @@ class AssetImageWidgetParser extends WidgetParser { bool excludeFromSemantics = map.containsKey('excludeFromSemantics') ? map['excludeFromSemantics'] : false; - double scale = map.containsKey("scale") ? map['scale'] : null; - double width = map.containsKey('width') ? map['width'] : null; - double height = map.containsKey('height') ? map['height'] : null; + double scale = map.containsKey("scale") ? map['scale']?.toDouble() : null; + double width = map.containsKey('width') ? map['width']?.toDouble() : null; + double height = map.containsKey('height') ? map['height']?.toDouble() : null; Color color = map.containsKey('color') ? parseHexColor(map['color']) : null; BlendMode blendMode = map.containsKey('blendMode') ? parseBlendMode(map['blendMode']) : null; @@ -184,9 +184,9 @@ class NetworkImageWidgetParser extends WidgetParser { bool excludeFromSemantics = map.containsKey('excludeFromSemantics') ? map['excludeFromSemantics'] : false; - double scale = map.containsKey("scale") ? map['scale'] : 1.0; - double width = map.containsKey('width') ? map['width'] : null; - double height = map.containsKey('height') ? map['height'] : null; + double scale = map.containsKey("scale") ? map['scale']?.toDouble() : 1.0; + double width = map.containsKey('width') ? map['width']?.toDouble() : null; + double height = map.containsKey('height') ? map['height']?.toDouble() : null; Color color = map.containsKey('color') ? parseHexColor(map['color']) : null; BlendMode blendMode = map.containsKey('blendMode') ? parseBlendMode(map['blendMode']) : null; diff --git a/lib/dynamic_widget/basic/opacity_widget_parser.dart b/lib/dynamic_widget/basic/opacity_widget_parser.dart index 44c198e..e7a45b0 100644 --- a/lib/dynamic_widget/basic/opacity_widget_parser.dart +++ b/lib/dynamic_widget/basic/opacity_widget_parser.dart @@ -6,7 +6,7 @@ class OpacityWidgetParser extends WidgetParser { Widget parse(Map map, BuildContext buildContext, ClickListener listener) { return Opacity( - opacity: map["opacity"], + opacity: map["opacity"]?.toDouble(), alwaysIncludeSemantics: map.containsKey("alwaysIncludeSemantics") ? map["alwaysIncludeSemantics"] : false, diff --git a/lib/dynamic_widget/basic/placeholder_widget_parser.dart b/lib/dynamic_widget/basic/placeholder_widget_parser.dart index 8716352..fcdba56 100644 --- a/lib/dynamic_widget/basic/placeholder_widget_parser.dart +++ b/lib/dynamic_widget/basic/placeholder_widget_parser.dart @@ -10,11 +10,11 @@ class PlaceholderWidgetParser extends WidgetParser { color: map.containsKey('color') ? parseHexColor(map['color']) : const Color(0xFF455A64), - strokeWidth: map.containsKey('strokeWidth') ? map['strokeWidth'] : 2.0, + strokeWidth: map.containsKey('strokeWidth') ? map['strokeWidth']?.toDouble() : 2.0, fallbackWidth: - map.containsKey('fallbackWidth') ? map['fallbackWidth'] : 400.0, + map.containsKey('fallbackWidth') ? map['fallbackWidth']?.toDouble() : 400.0, fallbackHeight: - map.containsKey('fallbackHeight') ? map['fallbackHeight'] : 400.0, + map.containsKey('fallbackHeight') ? map['fallbackHeight']?.toDouble() : 400.0, ); } diff --git a/lib/dynamic_widget/basic/stack_positioned_widgets_parser.dart b/lib/dynamic_widget/basic/stack_positioned_widgets_parser.dart index 26d2f0b..2e978a0 100644 --- a/lib/dynamic_widget/basic/stack_positioned_widgets_parser.dart +++ b/lib/dynamic_widget/basic/stack_positioned_widgets_parser.dart @@ -9,12 +9,12 @@ class PositionedWidgetParser extends WidgetParser { return Positioned( child: DynamicWidgetBuilder.buildFromMap( map["child"], buildContext, listener), - top: map.containsKey("top") ? map["top"] : null, - right: map.containsKey("right") ? map["right"] : null, - bottom: map.containsKey("bottom") ? map["bottom"] : null, - left: map.containsKey("left") ? map["left"] : null, - width: map.containsKey("width") ? map["width"] : null, - height: map.containsKey("height") ? map["height"] : null, + top: map.containsKey("top") ? map["top"]?.toDouble() : null, + right: map.containsKey("right") ? map["right"]?.toDouble() : null, + bottom: map.containsKey("bottom") ? map["bottom"]?.toDouble() : null, + left: map.containsKey("left") ? map["left"]?.toDouble() : null, + width: map.containsKey("width") ? map["width"]?.toDouble() : null, + height: map.containsKey("height") ? map["height"]?.toDouble() : null, ); } diff --git a/lib/dynamic_widget/basic/text_widget_parser.dart b/lib/dynamic_widget/basic/text_widget_parser.dart index 91c9d3a..92aa039 100644 --- a/lib/dynamic_widget/basic/text_widget_parser.dart +++ b/lib/dynamic_widget/basic/text_widget_parser.dart @@ -14,7 +14,7 @@ class TextWidgetParser implements WidgetParser { String semanticsLabel = map['semanticsLabel']; bool softWrap = map['softWrap']; String textDirectionString = map['textDirection']; - double textScaleFactor = map['textScaleFactor']; + double textScaleFactor = map['textScaleFactor']?.toDouble(); var textSpan; var textSpanParser = TextSpanParser(); if (map.containsKey("textSpan")) { diff --git a/lib/dynamic_widget/basic/wrap_widget_parser.dart b/lib/dynamic_widget/basic/wrap_widget_parser.dart index 2424f89..a236e85 100644 --- a/lib/dynamic_widget/basic/wrap_widget_parser.dart +++ b/lib/dynamic_widget/basic/wrap_widget_parser.dart @@ -13,11 +13,11 @@ class WrapWidgetParser extends WidgetParser { alignment: map.containsKey("alignment") ? parseWrapAlignment(map["alignment"]) : WrapAlignment.start, - spacing: map.containsKey("spacing") ? map["spacing"] : 0.0, + spacing: map.containsKey("spacing") ? map["spacing"]?.toDouble() : 0.0, runAlignment: map.containsKey("runAlignment") ? parseWrapAlignment(map["runAlignment"]) : WrapAlignment.start, - runSpacing: map.containsKey("runSpacing") ? map["runSpacing"] : 0.0, + runSpacing: map.containsKey("runSpacing") ? map["runSpacing"]?.toDouble() : 0.0, crossAxisAlignment: map.containsKey("crossAxisAlignment") ? parseWrapCrossAlignment(map["crossAxisAlignment"]) : WrapCrossAlignment.start, diff --git a/lib/dynamic_widget/scrolling/gridview_widget_parser.dart b/lib/dynamic_widget/scrolling/gridview_widget_parser.dart index 5c306b4..d6ed8c9 100644 --- a/lib/dynamic_widget/scrolling/gridview_widget_parser.dart +++ b/lib/dynamic_widget/scrolling/gridview_widget_parser.dart @@ -20,16 +20,16 @@ class GridViewWidgetParser extends WidgetParser { bool reverse = map.containsKey("reverse") ? map['reverse'] : false; bool shrinkWrap = map.containsKey("shrinkWrap") ? map["shrinkWrap"] : false; double cacheExtent = - map.containsKey("cacheExtent") ? map["cacheExtent"] : 0.0; + map.containsKey("cacheExtent") ? map["cacheExtent"]?.toDouble() : 0.0; EdgeInsetsGeometry padding = map.containsKey('padding') ? parseEdgeInsetsGeometry(map['padding']) : null; double mainAxisSpacing = - map.containsKey('mainAxisSpacing') ? map['mainAxisSpacing'] : 0.0; + map.containsKey('mainAxisSpacing') ? map['mainAxisSpacing']?.toDouble() : 0.0; double crossAxisSpacing = - map.containsKey('crossAxisSpacing') ? map['crossAxisSpacing'] : 0.0; + map.containsKey('crossAxisSpacing') ? map['crossAxisSpacing']?.toDouble() : 0.0; double childAspectRatio = - map.containsKey('childAspectRatio') ? map['childAspectRatio'] : 1.0; + map.containsKey('childAspectRatio') ? map['childAspectRatio']?.toDouble() : 1.0; var children = DynamicWidgetBuilder.buildWidgets( map['children'], buildContext, listener); diff --git a/lib/dynamic_widget/scrolling/listview_widget_parser.dart b/lib/dynamic_widget/scrolling/listview_widget_parser.dart index 05fe812..2a46554 100644 --- a/lib/dynamic_widget/scrolling/listview_widget_parser.dart +++ b/lib/dynamic_widget/scrolling/listview_widget_parser.dart @@ -19,11 +19,11 @@ class ListViewWidgetParser extends WidgetParser { var reverse = map.containsKey("reverse") ? map['reverse'] : false; var shrinkWrap = map.containsKey("shrinkWrap") ? map["shrinkWrap"] : false; - var cacheExtent = map.containsKey("cacheExtent") ? map["cacheExtent"] : 0.0; + var cacheExtent = map.containsKey("cacheExtent") ? map["cacheExtent"]?.toDouble() : 0.0; var padding = map.containsKey('padding') ? parseEdgeInsetsGeometry(map['padding']) : null; - var itemExtent = map.containsKey("itemExtent") ? map["itemExtent"] : null; + var itemExtent = map.containsKey("itemExtent") ? map["itemExtent"]?.toDouble() : null; var children = DynamicWidgetBuilder.buildWidgets( map['children'], buildContext, listener); var pageSize = map.containsKey("pageSize") ? map["pageSize"] : 10; diff --git a/lib/dynamic_widget/utils.dart b/lib/dynamic_widget/utils.dart index 56ed176..5614214 100644 --- a/lib/dynamic_widget/utils.dart +++ b/lib/dynamic_widget/utils.dart @@ -235,7 +235,7 @@ TextStyle parseTextStyle(Map map) { String debugLabel = map['debugLabel']; String decoration = map['decoration']; String fontFamily = map['fontFamily']; - double fontSize = map['fontSize']; + double fontSize = map['fontSize']?.toDouble(); String fontWeight = map['fontWeight']; FontStyle fontStyle = 'italic' == map['fontStyle'] ? FontStyle.italic : FontStyle.normal; @@ -311,7 +311,7 @@ BoxConstraints parseBoxConstraints(Map map) { if (map != null) { if (map.containsKey('minWidth')) { - var minWidthValue = map['minWidth']; + var minWidthValue = map['minWidth']?.toDouble(); if (minWidthValue != null) { if (minWidthValue >= infinity) { @@ -323,7 +323,7 @@ BoxConstraints parseBoxConstraints(Map map) { } if (map.containsKey('maxWidth')) { - var maxWidthValue = map['maxWidth']; + var maxWidthValue = map['maxWidth']?.toDouble(); if (maxWidthValue != null) { if (maxWidthValue >= infinity) { @@ -335,7 +335,7 @@ BoxConstraints parseBoxConstraints(Map map) { } if (map.containsKey('minHeight')) { - var minHeightValue = map['minHeight']; + var minHeightValue = map['minHeight']?.toDouble(); if (minHeightValue != null) { if (minHeightValue >= infinity) { @@ -347,7 +347,7 @@ BoxConstraints parseBoxConstraints(Map map) { } if (map.containsKey('maxHeight')) { - var maxHeightValue = map['maxHeight']; + var maxHeightValue = map['maxHeight']?.toDouble(); if (maxHeightValue != null) { if (maxHeightValue >= infinity) { @@ -1032,8 +1032,8 @@ DropCap parseDropCap(Map map, BuildContext buildContext, return null; } return DropCap( - width: map['width'], - height: map['height'], + width: map['width']?.toDouble(), + height: map['height']?.toDouble(), child: DynamicWidgetBuilder.buildFromMap(map["child"], buildContext, listener), );