Skip to content

Commit

Permalink
fix: ensure hierarchy is reflected accurately
Browse files Browse the repository at this point in the history
  • Loading branch information
Daeluse committed Jan 6, 2022
1 parent 78fa883 commit d090b11
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
40 changes: 21 additions & 19 deletions packages/frankenstein/lib/frankenstein.dart
Expand Up @@ -100,41 +100,43 @@ class ZZ extends StatelessWidget {
);
}

// Creates the Widget based on the hierarchy noted above. Please remember that the order is reversed since
// children are composed from the bottom up.
@override
Widget build(BuildContext context) {
// Local property to store the composed Widget return
Widget _child = child;

// If the margin argument is not null, build the outside Padding
if (margin != null) {
_child = _buildPadding(_child, margin!);
}

// If the decoration argument is not null, built the DecoratedBox
if (decoration != null) {
_child = _buildDecoratedBox(_child);
// If the flex argument is not null, build the Expanded; otherwise if the width or height arguments are not null, build the SizedBox
if (flex != null) {
_child = _buildExpanded(_child);
} else if (width != null || height != null) {
_child = _buildSizedBox(_child);
}

// If the padding argument is not null, build the inside Padding
if (padding != null) {
_child = _buildPadding(_child, padding!);
// If the canScroll argument is true, build the SingleChildScrollView
if (canScroll != null && canScroll == true) {
_child = _buildScrollView(_child);
}

// If the onTap argument is not null, build the GestureDetector
if (onTap != null) {
_child = _buildGestureDetector(_child);
}

// If the canScroll argument is true, build the SingleChildScrollView
if (canScroll != null && canScroll == true) {
_child = _buildScrollView(_child);
// If the padding argument is not null, build the inside Padding
if (padding != null) {
_child = _buildPadding(_child, padding!);
}

// If the flex argument is not null, build the Expanded; otherwise if the width or height arguments are not null, build the SizedBox
if (flex != null) {
_child = _buildExpanded(_child);
} else if (width != null || height != null) {
_child = _buildSizedBox(_child);
// If the decoration argument is not null, built the DecoratedBox
if (decoration != null) {
_child = _buildDecoratedBox(_child);
}

// If the margin argument is not null, build the outside Padding
if (margin != null) {
_child = _buildPadding(_child, margin!);
}

// Return the composed Widget
Expand Down
2 changes: 1 addition & 1 deletion packages/frankenstein/pubspec.yaml
Expand Up @@ -16,7 +16,7 @@ repository: https://github.com/loyalfiasco/Frankenstein
# This version is used _only_ for the Runner app, which is used if you just do
# a `flutter run` or a `flutter make-host-app-editable`. It has no impact
# on any other native host app that you embed your Flutter project into.
version: 1.0.4
version: 1.0.5

environment:
sdk: ">=2.15.0 <3.0.0"
Expand Down

0 comments on commit d090b11

Please sign in to comment.