fixed dark theme bugs
This commit is contained in:
@@ -52,10 +52,11 @@ class LoginMobilePage extends StatelessWidget {
|
||||
|
||||
if (viewModel.isLoading)
|
||||
BaseButton(
|
||||
isEnabled: false,
|
||||
onPressed: null,
|
||||
isLoading: true,
|
||||
)
|
||||
isEnabled: false,
|
||||
onPressed: null,
|
||||
isLoading: true,
|
||||
textColor: AppColors.white,
|
||||
)
|
||||
else
|
||||
BaseButton(
|
||||
isEnabled: viewModel.isLoginEnabled,
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/theme/colors.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
|
||||
class BaseButton extends StatelessWidget {
|
||||
final bool isEnabled;
|
||||
final VoidCallback? onPressed;
|
||||
final String? text;
|
||||
final Color? textColor;
|
||||
final Color? backgroundColor;
|
||||
final Color? borderColor;
|
||||
final double? borderWidth;
|
||||
final double? borderRadius;
|
||||
final double? elevation;
|
||||
final double? width;
|
||||
final bool isLoading;
|
||||
|
||||
const BaseButton({
|
||||
required this.isEnabled,
|
||||
required this.onPressed,
|
||||
this.text,
|
||||
this.textColor,
|
||||
this.backgroundColor,
|
||||
this.borderColor,
|
||||
this.borderWidth,
|
||||
this.borderRadius,
|
||||
this.elevation,
|
||||
this.width,
|
||||
this.isLoading = false,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return isLoading
|
||||
? Container(
|
||||
width: double.infinity,
|
||||
height: 55.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.mainBlue,
|
||||
borderRadius: BorderRadius.circular(28.0.w()),
|
||||
),
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: 30.0.w(),
|
||||
height: 30.0.w(),
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 4.0,
|
||||
color: AppColors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox(
|
||||
width: width ?? double.infinity,
|
||||
height: 55.0.h(),
|
||||
child: ElevatedButton(
|
||||
onPressed: isEnabled ? onPressed : null,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
backgroundColor ??
|
||||
(isEnabled ? AppColors.mainBlue : AppColors.backgroundColor),
|
||||
foregroundColor: textColor ?? AppColors.backgroundColor,
|
||||
elevation: elevation ?? 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadius ?? 28.0.w()),
|
||||
side: BorderSide(
|
||||
color: borderColor ?? Colors.transparent,
|
||||
width: borderWidth ?? 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
text ?? AppStrings.loginButton,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: textColor ?? AppColors.backgroundColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export 'login_button.dart';
|
||||
export '../../shared/base_button.dart';
|
||||
export 'login_logo.dart';
|
||||
export 'login_textfield.dart';
|
||||
export 'login_title.dart';
|
||||
|
||||
Reference in New Issue
Block a user