-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Credit Card UI changes #122
Conversation
c317882
to
1229dc3
Compare
const SizedBox( | ||
height: 10, | ||
), | ||
const SizedBox(height: 10), | ||
Expanded( | ||
child: Padding( | ||
padding: const EdgeInsets.only(left: 16), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give horizontal padding here and remove padding from line number 326, I guess it will reflect same as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make changes
lib/credit_card_widget.dart
Outdated
@@ -280,13 +280,16 @@ class _CreditCardWidgetState extends State<CreditCardWidget> | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
children: <Widget>[ | |||
if (widget.bankName != null && widget.bankName!.isNotEmpty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion : We can make extension for checking null and not empty at same time . Like this,
extension NullableStringExtension on String? {
bool get isNullOrEmpty => this == null || (this?.isEmpty ?? false);
bool get isNotNullAndNotEmpty => this != null && (this?.isNotEmpty ?? false);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make changes
14e1f83
to
f728dc4
Compare
lib/credit_card_widget.dart
Outdated
maxLines: 1, | ||
overflow: TextOverflow.ellipsis, | ||
style: defaultTextStyle, | ||
if (widget.bankName?.isNotEmpty == true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can pass directly condition without comparing it. And nullable variable troubling then add default value false
child: Padding( | ||
padding: const EdgeInsets.only(right: 16, top: 16), | ||
child: Text( | ||
widget.bankName!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Null check
f728dc4
to
b49442a
Compare
Credit Card Example UI changes