popupWAITING method
Implementation
Object popupWAITING(BuildContext context) async {
GameSocket s = GameSocket();
return showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) => WillPopScope(
onWillPop: () async => false,
child: AlertDialog(
backgroundColor: Theme.of(context).colorScheme.tertiary,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(15)),
),
contentPadding: EdgeInsets.all(defaultWidth * 0.05),
content: SizedBox(
width: defaultWidth * 0.85,
child: Column(mainAxisSize: MainAxisSize.min, children: [
Text(
"Código de la partida:",
style: TextStyle(
fontSize: 19,
color: Theme.of(context).colorScheme.primary,
),
),
SizedBox(height: defaultWidth * 0.05),
GestureDetector(
onTap: () =>
Clipboard.setData(ClipboardData(text: GameSocket().room))
.then((_) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text("Código de partida copiado.")));
}),
child: Container(
padding: EdgeInsets.symmetric(
vertical: defaultWidth * 0.03,
horizontal: defaultWidth * 0.03,
),
width: defaultWidth * 0.7,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Theme.of(context).colorScheme.primary,
width: 1.25,
),
borderRadius: const BorderRadius.all(Radius.circular(8)),
), // copied successfully
child: Row(children: [
SizedBox(
width: defaultWidth * 0.55,
child: Center(
child: Text(
s.room,
style: TextStyle(
fontSize: 19,
color: Theme.of(context).colorScheme.primary,
),
),
),
),
const Icon(Icons.copy),
]),
),
),
SizedBox(height: defaultWidth * 0.05),
SizedBox(
height: defaultWidth * 0.3,
child: Image.asset('images/waiting.gif'),
),
SizedBox(height: defaultWidth * 0.05),
playButton(context, "Cancelar", () => cancelSearch()),
]),
),
),
),
);
}