parse method Null safety

  1. @override
Widget parse(
  1. Map<String, dynamic> map,
  2. BuildContext buildContext,
  3. ClickListener? listener
)
override

parse the json map into a flutter widget.

Implementation

@override
Widget parse(Map<String, dynamic> map, BuildContext buildContext,
    ClickListener? listener) {
  return Center(
    widthFactor: map.containsKey("widthFactor")
        ? map["widthFactor"]?.toDouble()
        : null,
    heightFactor: map.containsKey("heightFactor")
        ? map["heightFactor"]?.toDouble()
        : null,
    child: DynamicWidgetBuilder.buildFromMap(
        map["child"], buildContext, listener),
  );
}