fix buttons UI (#548)

This commit is contained in:
Serhii 2022-10-20 01:18:39 +03:00 committed by GitHub
parent 1ba02af2b8
commit 9b4fc8f608
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,22 +24,19 @@ class PrimaryButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final content = ButtonTheme(
//minWidth: double.infinity,
//height: 52.0,
final content = SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: isDisabled
? (onDisabledPressed != null ? onDisabledPressed : null)
: onPressed,
// FIX-ME: Need to add style
// color: isDisabled ? color.withOpacity(0.5) : color,
//splashColor: Colors.transparent,
//highlightColor: Colors.transparent,
//disabledColor: color.withOpacity(0.5),
//shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(26.0),
//),
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color)),
? (onDisabledPressed != null ? onDisabledPressed : null) : onPressed,
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26.0),
),
),
overlayColor: MaterialStateProperty.all(Colors.transparent)),
child: Text(text,
textAlign: TextAlign.center,
style: TextStyle(
@ -80,17 +77,18 @@ class LoadingPrimaryButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ButtonTheme(
// FIX-ME: styles
//minWidth: double.infinity,
//height: 52.0,
return SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: (isLoading || isDisabled) ? null : onPressed,
//color: color,
//disabledColor: color.withOpacity(0.5),
//shape: RoundedRectangleBorder(
//borderRadius: BorderRadius.circular(26.0)),
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color)),
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26.0),
),
)),
child: isLoading
? CupertinoActivityIndicator(animating: true)
: Text(text,
@ -132,16 +130,17 @@ class PrimaryIconButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ButtonTheme(
// FIX-ME: styles
//minWidth: double.infinity,
//height: 52.0,
return SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: onPressed,
//color: color,
//shape: RoundedRectangleBorder(
// side: BorderSide(color: borderColor),
// borderRadius: BorderRadius.circular(radius)),
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
)),
child: Stack(
children: <Widget>[
Row(
@ -191,17 +190,17 @@ class PrimaryImageButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ButtonTheme(
minWidth: double.infinity,
return SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: onPressed,
// FIX-ME: Style
//color: color,
//shape: RoundedRectangleBorder(
// side: BorderSide(color: borderColor),
// borderRadius: BorderRadius.circular(26.0)),
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(color)),
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26.0),
),
)),
child:Center(
child: Row(
mainAxisSize: MainAxisSize.min,