mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
30 lines
741 B
Dart
30 lines
741 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
Future<bool> showPromptDialog({
|
|
required BuildContext context,
|
|
required String title,
|
|
required String message,
|
|
String okText = "Ok",
|
|
String cancelText = "Cancel",
|
|
}) async {
|
|
return showDialog<bool>(
|
|
context: context,
|
|
builder: (context) {
|
|
return AlertDialog(
|
|
title: Text(title),
|
|
content: Text(message),
|
|
actions: [
|
|
OutlinedButton(
|
|
onPressed: () => Navigator.of(context).pop(false),
|
|
child: Text(cancelText),
|
|
),
|
|
FilledButton(
|
|
child: Text(okText),
|
|
onPressed: () => Navigator.of(context).pop(true),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
).then((value) => value ?? false);
|
|
}
|