Skip to content

Instantly share code, notes, and snippets.

@onatcipli
Created June 15, 2019 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onatcipli/fa4d7d9c33d07067de62241dae98b5ea to your computer and use it in GitHub Desktop.
Save onatcipli/fa4d7d9c33d07067de62241dae98b5ea to your computer and use it in GitHub Desktop.
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