|
- import 'package:flutter/material.dart';
-
- class LoadingDialog {
- static void showLoadingDialog(BuildContext context) {
- showDialog(
- context: context,
- barrierDismissible: false,
- builder: (context) {
- return WillPopScope(
- onWillPop: () async => false,
- child: Opacity(
- opacity: 1,
- child: Stack(
- children: <Widget>[
- Align(
- alignment: Alignment.center,
- child: Container(
- decoration: new BoxDecoration(
- color: Colors.white,
- borderRadius:
- new BorderRadius.all(Radius.circular(16.0))),
- width: 80.0,
- height: 80.0),
- ),
- Container(
- alignment: Alignment.center,
- child: FlutterLogo(
- size: 25,
- ),
- ),
- Container(
- alignment: Alignment.center,
- child: SizedBox(
- child: CircularProgressIndicator(
- strokeWidth: 2.0,
- ),
- width: 60.0,
- height: 60.0,
- ),
- )
- ],
- )),
- );
- });
- }
-
- static void hideLoadingDialog(BuildContext context) {
- Navigator.pop(context, "");
- }
- }
|