Skip to content

Commit

Permalink
Fixed code parameter bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
deven98 committed Jun 2, 2019
1 parent fd37abf commit f0dc9b6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/widget_builder_utilities/widgets/align_model.dart
Expand Up @@ -47,7 +47,7 @@ class AlignModel extends ModelWidget {
child: ${children[0]?.toCode() ?? "Container()"},
widthFactor: ${double.tryParse(params["widthFactor"].toString()) ?? null},
heightFactor: ${double.tryParse(params["heightFactor"].toString()) ?? null},
alignment: ${params["alignment"] ?? "Alignment.center"},
alignment: Alignment.${params["alignment"].alignment ?? "center"},
)''';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/widget_builder_utilities/widgets/card_view_model.dart
Expand Up @@ -43,7 +43,7 @@ class CardViewModel extends ModelWidget {
return '''Card(
child: ${children[0]?.toCode() ?? 'Container()'},
elevation: ${params["elevation"] ?? 2.0},
color: ${params["color"].shade500 ?? Colors.white},
color: ${params["color"]?.shade500 ?? Colors.white},
)''';
}

Expand Down
4 changes: 2 additions & 2 deletions lib/widget_builder_utilities/widgets/container_model.dart
Expand Up @@ -51,9 +51,9 @@ class ContainerModel extends ModelWidget {
child: ${children[0]?.toCode() ?? 'Container()'},
width: ${double.tryParse(params["width"])},
height: ${double.tryParse(params["height"])},
alignment: ${params["alignment"]},
alignment: Alignment.${params["alignment"]?.alignment ?? "center"},
decoration: BoxDecoration(
color: ${params["color"].shade500},
color: ${params["color"]?.shade500},
),
)''';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/widget_builder_utilities/widgets/fitted_box_model.dart
Expand Up @@ -41,7 +41,7 @@ class FittedBoxModel extends ModelWidget {
String toCode() {
return '''FittedBox(
child: ${children[0]?.toCode() ?? 'Container()'},
alignment: ${params["alignment"] ?? Alignment.center},
alignment: Alignment.${params["alignment"].alignment ?? 'center'},
fit: ${params["fit"] ?? BoxFit.contain},
)''';
}
Expand Down
Expand Up @@ -36,7 +36,7 @@ class FlatButtonModel extends ModelWidget {
return '''FlatButton(
child: ${children[0]?.toCode() ?? 'Container()'},
onPressed: () {},
color: ${params["color"].shade500},
color: ${params["color"]?.shade500},
)''';
}
}
2 changes: 1 addition & 1 deletion lib/widget_builder_utilities/widgets/text_model.dart
Expand Up @@ -52,7 +52,7 @@ class TextModel extends ModelWidget {
'${params["text"] ?? ""}',
style: TextStyle(
fontSize: ${double.tryParse(params["fontSize"]) ?? 14.0},
color: ${params["color"].shade500 ?? Colors.black},
color: ${params["color"]?.shade500 ?? Colors.black},
fontStyle: ${params["fontStyle"] ?? FontStyle.normal}
),
)''';
Expand Down

0 comments on commit f0dc9b6

Please sign in to comment.