Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dart Package Medium Article
library custom_alert_box;
import 'package:flutter/material.dart';
class CustomAlertBox {
/// Bu şekilde döküman yorumları oluşturabilirsiniz kullanan kişiler için faydalı olur.
static Future showCustomAlertBox({
@required BuildContext context,
@required Widget willDisplayWidget,
}) {
assert(context != null, "context is null!!");
assert(willDisplayWidget != null, "willDisplayWidget is null!!");
return showDialog(
context: context,
builder: (context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(15)),
),
content: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
willDisplayWidget,
MaterialButton(
color: Colors.white30,
child: Text('close alert'),
onPressed: () {
Navigator.of(context).pop();
},
)
],
),
elevation: 10,
);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.