alert_craft
alert_craft is a Flutter package for managing various types of overlays and alerts in your Flutter application. It provides a simple API for displaying alert dialogs, loading dialogs, selection dialogs, toast messages, and custom widgets.
Features
- Show Alert Dialog: Display customizable alert dialogs.
- Show Loading Dialog: Show a loading indicator.
- Show Selection Dialog: Display a dialog with selectable options.
- Show Toast Message: Show non-intrusive toast messages.
- Show Custom Dialog: Display custom widgets in dialogs.
- Close Alert: Close the currently displayed overlay or alert.
Installation
Add alert_craft to your pubspec.yaml file:
dependencies:
alert_craft: ^0.0.15
Türkçe Açıklama
alert_craft, Flutter uygulamanızda çeşitli overlay ve uyarı tiplerini yönetmek için geliştirilmiş bir pakettir. Basit bir API ile alert dialog, loading dialog, seçim dialogu, toast mesajı ve özel widget dialogları gösterebilirsiniz.
Özellikler
- Uyarı Diyaloğu Göster: Özelleştirilebilir uyarı dialogları gösterin.
- Yükleme Diyaloğu Göster: Yüklenme göstergesi açın.
- Seçim Diyaloğu Göster: Seçim yapılabilen dialog açın.
- Toast Mesajı Göster: Kısa süreli bilgi mesajları gösterin.
- Özel Dialog Göster: Dialog içinde özel widget gösterin.
- Uyarıyı Kapat: Açık olan overlay veya alert’i kapatın.
Kurulum
pubspec.yaml dosyanıza ekleyin:
dependencies:
alert_craft: ^0.2.8
Examples
Show Alert Dialog
AlertManager().showAlert(
type: AlertType.warning,
title: 'Alert Title',
description: 'This is an alert description.',
buttonText: 'OK',
theme: AlertTheme(
backgroundColor: Colors.black,
buttonStyle: ElevatedButton.styleFrom(
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
),
);
Show Loading Dialog
AlertManager().showLoading(
message: "Loading...",
);
// To close:
AlertManager().close();
Show Selection Dialog
AlertManager().showSelection(
type: AlertType.warning,
title: 'Select Option',
description: 'Please choose an option.',
leftText: 'Cancel',
rightText: 'Continue',
onLeft: () => AlertManager().close(),
onRight: () {
// Continue action
AlertManager().close();
},
);
Show Toast Message
AlertManager().showToast(
type: AlertType.info,
message: 'This is a toast message.',
);
Show Custom Dialog
AlertManager().showCustom(
child: MyCustomWidget(),
);
Show Custom Alert
AlertManager().showCustom(
child: MyCustomAlertWidget(),
);
Close Alert
AlertManager().close();
Libraries
- alert_craft
- core/alert_localization
- core/alert_theme
- core/responsive
- enums/alert_type
- managers/alert_manager
- models/alert_config
- models/custom_config
- models/loading_config
- models/selection_config
- models/toast_config
- overlays/overlay_service
- widgets/alert_dialog
- widgets/custom_dialog
- widgets/loading_dialog
- widgets/selection_dialog
- widgets/toast_message