alert_dialog_box_v1 0.0.1 alert_dialog_box_v1: ^0.0.1 copied to clipboard
A flutter library to show alert dialog box with custom design and decoration.
Alert Dialog Box #
alert_dialog_box
An Alert Dialog Box package is allows developers to easily create and display alert dialogs with custom design. Emerge dialogs are used to display important information or messages to the user and often include a call to action, such as a button to confirm or dismiss the dialog. ✨
Installation #
Create a new project with the command
flutter create MyApp
Add
alert_dialog_box: ...
to your pubspec.yaml
of your flutter project.
OR
run
flutter pub add alert_dialog_box
in your project's root directory.
In your library add the following import:
import 'package:alert_dialog_box/alert_dialog_box_v1.dart';
For help getting started with Flutter, view the online documentation.
Usage #
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Alert Dialog Box',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(children: [
],),
)
);
}
}
Constructor #
Basic
Parameter | Default | Description | Required |
---|---|---|---|
title | - | Alert dialog title. | True |
message | - | Body message of Alert dialog. | True |
onConfirmPressed | - | On Confirm callback function. | false |
onCancelPressed | - | On Cancel callback function. | false |
isDismissible | false | Set true to have a dismissable alert | false |
isOkButtonAlertDialog | false | Set true to have a Ok button alert | false |