|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import 'package:flutter/material.dart';
- import 'package:loading_indicator/loading_indicator.dart';
-
- class LoadingDialog extends StatelessWidget {
- final String message;
-
- const LoadingDialog({Key key, this.message}) : super(key: key);
-
- @override
- Widget build(BuildContext context) {
- return GestureDetector(
- onTap: () {
- Navigator.pop(context);
- },
- child: Scaffold(
- backgroundColor: Colors.transparent,
- body: Center(
- child: UnconstrainedBox(
- child: Container(
- padding: EdgeInsets.all(10),
- decoration: BoxDecoration(
- color: Colors.white, borderRadius: BorderRadius.circular(8)),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Container(
- width: 80,
- height: 80,
- child: LoadingIndicator(
- indicatorType: Indicator.ballSpinFadeLoader,
- color: Colors.redAccent,
- ),
- ),
- message == null || message == ''
- ? Container()
- : Container(
- margin: EdgeInsets.only(top: 8),
- child: Text(
- message,
- style: TextStyle(fontSize: 14),
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ),
- );
- }
- }
|