32 lines
911 B
Dart
32 lines
911 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class LoadingDialog extends StatelessWidget {
|
|
static void show(BuildContext context, {Key key}) => showDialog<void>(
|
|
context: context,
|
|
useRootNavigator: false,
|
|
barrierDismissible: false,
|
|
builder: (_) => LoadingDialog(key: key),
|
|
).then((_) => FocusScope.of(context).requestFocus(FocusNode()));
|
|
|
|
static void hide(BuildContext context) => Navigator.pop(context);
|
|
|
|
LoadingDialog({Key key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return WillPopScope(
|
|
onWillPop: () async => false,
|
|
child: Center(
|
|
child: Card(
|
|
child: Container(
|
|
width: 80,
|
|
height: 80,
|
|
padding: EdgeInsets.all(12.0),
|
|
child: CircularProgressIndicator(backgroundColor: Colors.transparent,),
|
|
color: Colors.transparent,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |