
< /p>
Код выхода:
Код: Выделить всё
class LogOut extends StatelessWidget {
const LogOut({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async{
print("pressed back button");
return false;
},
child: _showLoaderDialog(context),
);
}
_showLoaderDialog(BuildContext context){
AlertDialog alert=AlertDialog(
content: new Row(
children: [
CircularProgressIndicator(),
Container(margin: EdgeInsets.only(left: 7),child:Text("Logging out..." )),
],),
);
showDialog(barrierDismissible: false,
context:context,
builder:(BuildContext context){
return alert;
},
);
}
}
Подробнее здесь: https://stackoverflow.com/questions/711 ... in-flutter
Мобильная версия