You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.2 KiB
44 lines
1.2 KiB
import 'package:flutter/material.dart'; |
|
import 'package:siopas/theme.dart'; |
|
|
|
class LoadingButton extends StatelessWidget { |
|
@override |
|
Widget build(BuildContext context) { |
|
return Container( |
|
height: 50, |
|
width: double.infinity, |
|
margin: EdgeInsets.only(top: 30), |
|
child: ElevatedButton( |
|
onPressed: null, // Menonaktifkan tombol saat sedang loading |
|
style: ElevatedButton.styleFrom( |
|
primary: primaryColor, |
|
shape: RoundedRectangleBorder( |
|
borderRadius: BorderRadius.circular(12), |
|
), |
|
), |
|
child: Stack( |
|
children: [ |
|
Center( |
|
child: Opacity( |
|
opacity: 0, // Menghilangkan teks saat sedang loading |
|
child: Text( |
|
'Loading', |
|
style: TextStyle( |
|
fontSize: 16, |
|
fontWeight: medium, |
|
color: primaryTextColor, |
|
), |
|
), |
|
), |
|
), |
|
Center( |
|
child: CircularProgressIndicator( |
|
valueColor: AlwaysStoppedAnimation<Color>(Colors.white), |
|
), |
|
), |
|
], |
|
), |
|
), |
|
); |
|
} |
|
}
|
|
|