43 lines
1.3 KiB
Dart
43 lines
1.3 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
|
import 'main.dart';
|
|
|
|
class Dialogs{
|
|
static bool showing = false;
|
|
static BuildContext? context;
|
|
static List<Widget> popupsOpened=[];
|
|
static waiting( String title){
|
|
showing=true;
|
|
context=navigatorKey.currentContext;
|
|
if(context!=null) {
|
|
return showDialog(
|
|
context: context!,
|
|
barrierDismissible: false,
|
|
routeSettings: const RouteSettings(name: "Progress"),
|
|
builder: (BuildContext context) {
|
|
return AlertDialog(
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
|
|
backgroundColor: Color(0xaa101010),
|
|
title: Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
SpinKitChasingDots(color: Colors.green),
|
|
Expanded(child: Text(title,textAlign: TextAlign.center,)),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
static hide(){
|
|
showing=false;
|
|
Navigator.of(navigatorKey.currentContext!).popUntil((route){
|
|
return route.settings.name!="Progress";
|
|
});
|
|
}
|
|
} |