pub.dev license flutter

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.

Libraries

kalertflutter