mobileapplicationPassvault/lib/view_pages/alertbox.dart

31 lines
802 B
Dart
Raw Normal View History

2024-04-12 05:23:32 +00:00
import 'package:flutter/material.dart';
class CustomAlertBox extends StatefulWidget {
final String message; // Add a message parameter to the constructor
const CustomAlertBox(
{super.key, required this.message}); // Update the constructor
@override
// ignore: library_private_types_in_public_api
_CustomAlertBoxState createState() => _CustomAlertBoxState();
}
class _CustomAlertBoxState extends State<CustomAlertBox> {
@override
Widget build(BuildContext context) {
return AlertDialog(
// title: const Text('Alert'),
content: Text(widget.message), // Use the message parameter
actions: [
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('OK'),
),
],
);
}
}