This package allow indicating async process on modal screen after tap button
You can use Flutter default buttons, and also custom widget.
Below, you can use button type.
- ElevatedButton
- OutlinedButton
- TextButton
- IconButton
import 'package:loading_modal_button/loading_modal_button.dart';
LoadingModalButton(
onPressed: () async {
// async process
},
),LoadingModalButton(
buttonType: ButtonType.outlined,
// You can choose [ButtonType.elevated], [ButtonType.outlined], [ButtonType.text]
onPressed: () async {
},
), LoadingModalButton(
onPressed: () async {
await Future.delayed(const Duration(seconds: 1));
},
afterAsync: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('SnackBar'),
),
);
},
),