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