20 lines
794 B
Dart
20 lines
794 B
Dart
import 'package:flutter/material.dart';
|
|
class PrimaryButton extends StatelessWidget {
|
|
final String label;
|
|
final VoidCallback onTap;
|
|
final bool busy;
|
|
const PrimaryButton({super.key, required this.label, required this.onTap, this.busy = false});
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SizedBox(
|
|
width: double.infinity,
|
|
child: ElevatedButton(
|
|
onPressed: busy ? null : onTap,
|
|
style: ElevatedButton.styleFrom(padding: const EdgeInsets.symmetric(vertical: 14), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12))),
|
|
child: busy ? const SizedBox(height: 18, width: 18, child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white)) : Text(label, style: const TextStyle(fontSize: 16)),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|