Files
nearby_service/example_full/lib/uikit/action_dialog.dart
T

34 lines
813 B
Dart

import 'package:flutter/material.dart';
import 'package:nearby_service_example_full/uikit/action_button.dart';
class ActionDialog {
ActionDialog._();
static Future<bool?> show(
BuildContext context, {
required String title,
required String subtitle,
}) {
return showDialog<bool>(
context: context,
builder: (context) {
return AlertDialog(
title: Text(title),
content: Text(subtitle),
actions: [
ActionButton(
onTap: () => Navigator.of(context).pop(true),
title: 'Yes',
),
ActionButton(
onTap: () => Navigator.of(context).pop(false),
title: 'No',
type: ActionType.warning,
),
],
);
},
);
}
}