custom_alert_dialog_package 0.0.1 custom_alert_dialog_package: ^0.0.1 copied to clipboard
To Show Alert Dialog
import 'package:custom_alert_dialog_package/custom_alert_dialog_package.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const Home(),
);
}
}
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
child: MaterialButton(
color: Colors.red,
child: Text("Click me"),
onPressed: () {
CustomAlertDialog.showAlertDialog(
context: context,
displayWidget: Text("It worked!!"),
);
},
),
),
),
);
}
}