costum1 static method
Implementation
static Widget costum1({
required String text,
Color? background,
required Function onPressed,
required Rx<bool> loadingStatus,
bool enabled = true,
}) {
Color foregroundColor = Colors.white;
return loadingStatus.value
? const CupertinoActivityIndicator()
: ElevatedButton(
onPressed: !enabled
? null
: () async {
if (!loadingStatus.value) {
await onPressed();
}
},
style: ElevatedButton.styleFrom(
backgroundColor: background, // Arka plan rengini belirleyin
foregroundColor: foregroundColor,
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 18),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10), // Kenar yarıçapını ayarlayın
),
),
child: Text(
text,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
);
}