A feature-rich, highly customizable dialog package for Flutter applications.
- 🎨 Fully Customizable UI – Modify colors, fonts, and layouts.
- ⚡ Smooth Animations – Built-in transitions for a better UX.
- 🖱️ Hover Effects – Interactive UI elements.
- 🌈 Multiple Button Support – Add as many actions as needed.
- 🎚️ Size Customization – Adjust width, height, and padding.
- 🕒 Animation Control – Customize animation duration & style.
- 🎮 Interactive Examples – Ready-to-use examples for quick setup.
Add the dependency in your pubspec.yaml:
dependencies:
xdialog: ^1.0.0Then, run:
flutter pub getTo display a simple confirmation dialog:
import 'package:flutter/material.dart';
import 'package:xdialog/xdialog.dart';
void showBasicDialog(BuildContext context) {
XDialog.show(
context: context,
title: const Text('Confirmation'),
message: const Text('Are you sure?'),
positiveButtonText: 'Yes',
negativeButtonText: 'No',
);
}import 'package:flutter/material.dart';
import 'package:xdialog/xdialog.dart';
void showImageDialog(BuildContext context) {
XDialog.show(
context: context,
title: const Text('Image Preview'),
message: const Text('This is an example with an image.'),
image: Image.network('https://via.placeholder.com/150'),
positiveButtonText: 'OK',
);
}XDialog.show(
context: context,
title: const Text('Custom Size'),
message: const Text('You can control the size.'),
width: 300,
height: 200,
);XDialog.show(
context: context,
title: const Text('Styled Buttons'),
message: const Text('Different button styles.'),
positiveButtonText: 'Confirm',
negativeButtonText: 'Cancel',
positiveButtonStyle: ElevatedButton.styleFrom(backgroundColor: Colors.green),
negativeButtonStyle: TextButton.styleFrom(foregroundColor: Colors.red),
);- Add dark mode support.
- Support for icon-based buttons.
- More transition effects.
This project is licensed under the MIT License.
Feel free to submit pull requests or open issues for suggestions and improvements.
Happy coding! 🚀