Skip to content

TutorialsAndroid/KAlertFlutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KAlertFlutter

A lightweight and easy-to-use alert dialog package for Flutter.

KAlertFlutter provides simple helper methods to display alert dialogs and confirm dialogs using a clean API. It is designed to reduce boilerplate code when working with Flutter dialogs.


✨ Features

  • Simple alert dialog
  • Confirm dialog with boolean result
  • Clean and minimal API
  • Lightweight and dependency-free
  • Uses native Flutter Material dialogs

📦 Installation

Add the package to your project:

dependencies:
  kalertflutter: ^1.0.0

Then run:

flutter pub get

🚀 Usage

Import the package:

import 'package:kalertflutter/kalertflutter.dart';

📘 Show Alert Dialog

Display a simple alert dialog:

KAlert.show(
  context,
  "Saved successfully!",
);

With custom title:

KAlert.show(
  context,
  "Profile updated successfully!",
  title: "Success",
);

📘 Show Confirm Dialog

Display a confirmation dialog and receive user response:

bool? result = await KAlert.confirm(
  context,
  "Delete this file?",
);

Example with result handling:

bool? result = await KAlert.confirm(
  context,
  "Delete this file?",
);

if (result == true) {
  print("User confirmed");
} else {
  print("User cancelled");
}

🛠 Example

ElevatedButton(
  onPressed: () {
    KAlert.show(context, "Hello from KAlertFlutter!");
  },
  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.

About

KAlertFlutter is a lightweight, modern, and professional alert dialog package for Flutter. It is inspired by the native Android Java library KAlertDialog and brings a similar beautiful dialog experience to Flutter apps.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors