loading_dialog_plus 0.0.1
loading_dialog_plus: ^0.0.1 copied to clipboard
To be able to show loading dialog in Flutter.
import 'package:flutter/material.dart';
import 'package:loading_dialog_plus/loading_dialog_plus.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(title: const Text('Loading Dialog Demo')),
body: Center(
child: Builder(
builder: (context) {
return ElevatedButton(
onPressed: () async {
final loader = LoadingDialog(
buildContext: context,
barrierDismissible: false,
type: LoadingDialogType.dots,
title: "Title",
subtitle: "This is testing for the subtitle",
);
loader.show();
await Future.delayed(const Duration(seconds: 3));
loader.hide();
},
child: const Text('Show Loading Dialog'),
);
},
),
),
),
);
}
}