Skip to content

Commit

Permalink
fixed justification issue
Browse files Browse the repository at this point in the history
  • Loading branch information
codegrue committed Jul 1, 2020
1 parent 06c0dd2 commit 738e08a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
51 changes: 30 additions & 21 deletions lib/widgets/card_settings_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,29 +104,38 @@ class CardSettingsField extends StatelessWidget {
}

Widget _buildLabelBlock(BuildContext context) {
return Expanded(
child: Container(
width: (contentOnNewLine)
? null
: labelWidth ?? CardSettings.of(context).labelWidth ?? 120.0,
padding: EdgeInsets.only(
right: CardSettings.of(context).labelPadding ?? 6.0),
child: Row(
children: <Widget>[
_buildLeftIcon(context),
_buildLabelSpacer(context),
Expanded(
child: Row(
children: <Widget>[
_buildLabelText(context),
_buildlabelRequiredIndicator(context),
],
),
var padding =
EdgeInsets.only(right: CardSettings.of(context).labelPadding ?? 6.0);

return (contentOnNewLine)
? Expanded(
child: Container(
padding: padding,
child: _buildLabelRow(context),
),
_buildLabelSuffix(context),
],
)
: Container(
width: labelWidth ?? CardSettings.of(context).labelWidth ?? 120.0,
padding: padding,
child: _buildLabelRow(context),
);
}

Row _buildLabelRow(BuildContext context) {
return Row(
children: <Widget>[
_buildLeftIcon(context),
_buildLabelSpacer(context),
Expanded(
child: Row(
children: <Widget>[
_buildLabelText(context),
_buildlabelRequiredIndicator(context),
],
),
),
),
_buildLabelSuffix(context),
],
);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: card_settings
description: A flutter package for building card based settings forms. This includes a library of pre-built form field widgets.
version: 1.9.9
version: 1.9.9+hotfix.1
homepage: https://github.com/codegrue/card_settings

dependencies:
Expand Down

0 comments on commit 738e08a

Please sign in to comment.