costum1 method
Implementation
Widget costum1({
required String text,
required Function onPressed,
required bool loadingStatus,
Color? background,
bool enabled = true,
}) {
Color foregroundColor = Colors.white;
return loadingStatus
? const CupertinoActivityIndicator()
: ElevatedButton(
onPressed: !enabled
? null
: () async {
if (!loadingStatus) {
await onPressed();
}
},
style: ElevatedButton.styleFrom(
backgroundColor: background,
foregroundColor: foregroundColor,
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 18),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
child: Text(
text,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
color:
!enabled ? const Color.fromARGB(255, 211, 211, 211) : null,
),
),
);
}