30 lines
753 B
Dart
30 lines
753 B
Dart
import 'package:em2rp/utils/colors.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class LoginButtonWidget extends StatelessWidget {
|
|
final bool isLoading;
|
|
final VoidCallback onPressed;
|
|
|
|
const LoginButtonWidget({
|
|
super.key,
|
|
required this.isLoading,
|
|
required this.onPressed,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ElevatedButton(
|
|
onPressed: isLoading ? null : onPressed,
|
|
style: ElevatedButton.styleFrom(
|
|
padding: const EdgeInsets.symmetric(vertical: 15),
|
|
textStyle: const TextStyle(fontSize: 18),
|
|
),
|
|
child: isLoading
|
|
? const CircularProgressIndicator(
|
|
color: AppColors.blanc,
|
|
)
|
|
: const Text('Se connecter'),
|
|
);
|
|
}
|
|
}
|