feat:login page done

This commit is contained in:
jahongireshonqulov
2025-10-28 19:41:05 +05:00
parent 4c652c2b47
commit cdec9980af
16 changed files with 324 additions and 67 deletions

View File

@@ -1,12 +1,10 @@
import '../../../../food_delivery_client.dart';
class AppButton extends StatelessWidget {
const AppButton({
super.key,
required this.name,
required this.onPressed,
this.onPressed,
this.margin,
this.backgroundColor,
this.borderRadius,
@@ -16,10 +14,11 @@ class AppButton extends StatelessWidget {
this.action,
this.trailing,
this.mainAxisAlignment,
this.isLoading = false,
});
final String name;
final VoidCallback onPressed;
final VoidCallback? onPressed;
final EdgeInsets? margin;
final Color? backgroundColor;
final Color? textColor;
@@ -28,6 +27,7 @@ class AppButton extends StatelessWidget {
final double? height;
final Widget? action;
final Widget? trailing;
final bool isLoading;
final MainAxisAlignment? mainAxisAlignment;
@override
@@ -45,16 +45,28 @@ class AppButton extends StatelessWidget {
color: backgroundColor ?? AppColors.c000000,
borderRadius: BorderRadius.circular(borderRadius ?? 0),
),
child: Row(
mainAxisAlignment: mainAxisAlignment ?? MainAxisAlignment.center,
children: [
action ?? AppUtils.kSizedBox,
Text(name, style: AppTextStyles.size16Bold.copyWith(
color: AppColors.cFFFFFF
)),
trailing ?? AppUtils.kSizedBox,
],
),
child: isLoading
? Center(
child: CircularProgressIndicator.adaptive(
padding: EdgeInsets.all(2),
valueColor: AlwaysStoppedAnimation(AppColors.cFFFFFF),
backgroundColor: AppColors.cFFFFFF,
),
)
: Row(
mainAxisAlignment:
mainAxisAlignment ?? MainAxisAlignment.center,
children: [
action ?? AppUtils.kSizedBox,
Text(
name,
style: AppTextStyles.size16Bold.copyWith(
color: AppColors.cFFFFFF,
),
),
trailing ?? AppUtils.kSizedBox,
],
),
),
);
}