feat: login page
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
|
||||
import '../../../common/theme/theme.dart';
|
||||
import '../spacer/spacer.dart';
|
||||
|
||||
part 'elevated_button.dart';
|
||||
@@ -0,0 +1,67 @@
|
||||
part of 'button.dart';
|
||||
|
||||
class AppElevatedButton extends StatelessWidget {
|
||||
const AppElevatedButton({
|
||||
super.key,
|
||||
required this.text,
|
||||
required this.isLoading,
|
||||
required this.onPressed,
|
||||
this.height = 50,
|
||||
});
|
||||
|
||||
final String text;
|
||||
final bool isLoading;
|
||||
final Function()? onPressed;
|
||||
final double height;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: height,
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(colors: AppColor.primaryGradient),
|
||||
borderRadius: BorderRadius.circular(AppValue.radius),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.primaryWithOpacity(0.3),
|
||||
blurRadius: 15,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: onPressed,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.transparent,
|
||||
shadowColor: Colors.transparent,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: isLoading
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Loading',
|
||||
style: AppStyle.lg.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColor.white,
|
||||
),
|
||||
),
|
||||
SpaceWidth(8),
|
||||
SpinKitCircle(color: AppColor.white, size: 24.0),
|
||||
],
|
||||
)
|
||||
: Text(
|
||||
text,
|
||||
style: AppStyle.lg.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColor.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user