53 lines
1.3 KiB
Dart
Raw Normal View History

2025-08-27 15:07:49 +07:00
part of 'button.dart';
class AppElevatedButton extends StatelessWidget {
const AppElevatedButton({
super.key,
required this.onPressed,
required this.title,
this.width = double.infinity,
this.height = 48.0,
2025-09-18 08:01:49 +07:00
this.isLoading = false,
2025-08-27 15:07:49 +07:00
});
final Function()? onPressed;
final String title;
final double width;
final double height;
2025-09-18 08:01:49 +07:00
final bool isLoading;
2025-08-27 15:07:49 +07:00
@override
Widget build(BuildContext context) {
return SizedBox(
width: width,
height: height,
child: ElevatedButton(
onPressed: onPressed,
2025-09-18 08:01:49 +07:00
child: isLoading
? Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SpinKitFadingCircle(color: AppColor.white, size: 24),
SizedBox(width: 8),
Text(
'Loading',
style: AppStyle.lg.copyWith(
color: AppColor.white,
fontWeight: FontWeight.w700,
),
),
],
)
: Text(
title,
style: AppStyle.lg.copyWith(
color: AppColor.white,
fontWeight: FontWeight.w700,
),
),
2025-08-27 15:07:49 +07:00
),
);
}
}