https://github.com/brunojurkovic/flat_dialog
A simple, flat, and effective way of displaying common dialogs!
https://github.com/brunojurkovic/flat_dialog
Last synced: 7 months ago
JSON representation
A simple, flat, and effective way of displaying common dialogs!
- Host: GitHub
- URL: https://github.com/brunojurkovic/flat_dialog
- Owner: BrunoJurkovic
- License: mit
- Created: 2020-06-28T15:27:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-08T21:34:35.000Z (over 5 years ago)
- Last Synced: 2025-01-29T23:17:34.858Z (8 months ago)
- Language: Dart
- Homepage:
- Size: 214 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# **flat_dialog**
Modified, more updated fork of [rflutter_alert](https://pub.dev/packages/rflutter_alert).
FlatDialog is a simple method of creating various popup dialogs in Flutter.
# Features
- Simple animations
- Production ready dialog styles
- Recyclable and reusable dialogs
- Flat, easy to understand and beautiful# Let's begin!
1. **Add dependency to your app:**
```yaml
dependencies:
flat_dialog: ^1.0.0
```2. **Use some of our ready dialogs!**
```dart
Future throwErrorDialog(BuildContext context) {
return FlatDialog(
context: context,
type: DialogType.error, // We have more of these!
title: "ERROR",
desc: "We can't reach our server :(, try again later.",
buttons: [
FlatDialogButton(
width: 150,
onPressed: () => Navigator.pop(context),
child: const Text(
"Oh no!",
style: TextStyle(color: Colors.white, fontSize: 20),
),
)
],
).show();
}
```3. **Customize your new flat dialog (with `style`)!**
```dart
AlertStyle(
animationStyle: AnimationStyle.fromTop, // How the dialog animates
closeButtonVisible: false, // Does the [x] in the corner appear?
isTapDismiss: true, // If you click outside the dialog, does it close?
descStyle: TextStyle(fontWeight: FontWeight.bold), // How does the text look?
animationDuration: const Duration(milliseconds: 400), // How long does the animation last?
alertBorder: RoundedRectangleBorder( // Do you want a border around the dialog?
borderRadius: BorderRadius.circular(0.0),
side: BorderSide(
color: Colors.grey,
),
),
titleStyle: TextStyle(
color: Colors.red, // What color is the [title] text?
),
boxConstraints: const BoxConstraints.expand( // Do you want constraints?
width: 300,
),
);
```4. **Check out the example project for even more features!**
# Want to contribute?
- Open a pull request
- Make a new issue on GitHub.Giant thank you to [Ratel](https://ratel.com.tr/ "Ratel") and [İzzet Öztürk](https://tr.linkedin.com/in/paltimoz "İzzet Öztürk") for providing the base for this project <3.