kalertflutter 1.2.0
kalertflutter: ^1.2.0 copied to clipboard
Flutter alert dialog library with success, error, warning, info, confirm, and prompt dialogs.
KAlertFlutter #
A lightweight, modern alert dialog package for Flutter.
KAlertFlutter provides success, error, warning, info, confirm, and prompt dialogs using a clean and simple API. It helps reduce boilerplate code when working with dialogs in Flutter apps.
π pub.dev package: https://pub.dev/packages/kalertflutter
β€οΈ Support the Project #
If you find KAlertFlutter useful, please consider supporting the project:
β Star this repository
π Report issues
π‘ Suggest new features
And donβt forget to follow me on Instagram for more developer content:
πΈ https://instagram.com/coderx09
Thanks for your support! π
β¨ Features #
β Success dialog
β Error dialog
β Warning dialog
β Info dialog
β Confirm dialog with boolean response
β Prompt dialog with input field
β Clean enum-based API
β Rounded modern UI dialogs
β Lightweight and dependency-free
β Uses native Flutter Material dialogs
π¦ Installation #
Add the package:
dependencies:
kalertflutter: ^1.2.0
Then run:
flutter pub get
π Usage #
Import the package:
import 'package:kalertflutter/kalertflutter.dart';
π Show Alert Dialog #
KAlert.show(
context,
title: "Success",
message: "Saved successfully!",
type: KAlertType.success,
);
Supported dialog types:
success
error
warning
info
Example:
KAlert.show(
context,
title: "Error",
message: "Something went wrong!",
type: KAlertType.error,
);
π Confirm Dialog #
bool? result = await KAlert.confirm(
context,
title: "Delete file?",
message: "This action cannot be undone",
);
if (result == true) {
print("User confirmed");
}
π Prompt Dialog (User Input) #
String? value = await KAlert.prompt(
context,
title: "Enter your name",
);
print(value);
π Example #
ElevatedButton(
onPressed: () {
KAlert.show(
context,
title: "Hello",
message: "Welcome to KAlertFlutter",
type: KAlertType.info,
);
},
child: const Text("Show Alert"),
);
π Repository #
GitHub:
https://github.com/TutorialsAndroid/KAlertFlutter
Issues and feature requests are welcome.
π License #
MIT License
Free for personal and commercial use.