# RFlutter Alert
RFlutter Alert is super customizable and easy-to-use alert/popup dialogs for Flutter. You may create reusable alert styles or add buttons as much as you want with ease.
[![Version](https://img.shields.io/badge/version-2.0.4-blue.svg)](https://pub.dartlang.org/packages/rflutter_alert)
<p align="center">
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_V1.0.2.gif">
</p>
<p>
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_V1.0.2.png" width="200">
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_basic_V1.0.2.png" width="200">
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_buttons_V1.0.2.png" width="200">
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_custom_V1.0.2.png" width="200">
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_error_V1.0.2.png" width="200">
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_icon_V1.0.2.png" width="200">
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_style_V1.0.2.png" width="200">
</p>
## Features
- Single line basic alert
- Adding buttons dynamically (as much as you want)
- Predefined beautiful alert styles (success, error, warning, info)
- Reusable alert styles
- Super customizable
- Change animation (fromTop, fromBottom, fromRight, fromLeft, grow, shrink) & Custom Animation
- Set animation duration
- Show/hide close button
- Set overlay tap to dismiss
- Assign Title and desc styles
- Change dialog border style
## Getting started
You must add the library as a dependency to your project.
```yaml
dependencies:
rflutter_alert: ^2.0.4
```
You can also reference the git repo directly if you want:
```yaml
dependencies:
rflutter_alert:
git: git://github.com/RatelHub/rflutter_alert.git
```
You should then run `flutter packages get`
## Example Project
There is a detailed example project in the `example` folder. You can directly run and play on it. There are code snippets from example project below.
## Basic Alert
```dart
Alert(context: context, title: "RFLUTTER", desc: "Flutter is awesome.").show();
```
## Alert with Button
```dart
Alert(
context: context,
type: AlertType.error,
title: "RFLUTTER ALERT",
desc: "Flutter is more awesome with RFlutter Alert.",
buttons: [
DialogButton(
child: Text(
"COOL",
style: TextStyle(color: Colors.white, fontSize: 20),
),
onPressed: () => Navigator.pop(context),
width: 120,
)
],
).show();
```
## Alert with Buttons
```dart
Alert(
context: context,
type: AlertType.warning,
title: "RFLUTTER ALERT",
desc: "Flutter is more awesome with RFlutter Alert.",
buttons: [
DialogButton(
child: Text(
"FLAT",
style: TextStyle(color: Colors.white, fontSize: 20),
),
onPressed: () => Navigator.pop(context),
color: Color.fromRGBO(0, 179, 134, 1.0),
),
DialogButton(
child: Text(
"GRADIENT",
style: TextStyle(color: Colors.white, fontSize: 20),
),
onPressed: () => Navigator.pop(context),
gradient: LinearGradient(colors: [
Color.fromRGBO(116, 116, 191, 1.0),
Color.fromRGBO(52, 138, 199, 1.0)
]),
)
],
).show();
```
## Alert with Style
### AlertStyle
Use the `AlertStyle` class to customize.
```dart
var alertStyle = AlertStyle(
animationType: AnimationType.fromTop,
isCloseButton: false,
isOverlayTapDismiss: false,
descStyle: TextStyle(fontWeight: FontWeight.bold),
descTextAlign: TextAlign.start,
animationDuration: Duration(milliseconds: 400),
alertBorder: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0),
side: BorderSide(
color: Colors.grey,
),
),
titleStyle: TextStyle(
color: Colors.red,
),
alertAlignment: Alignment.topCenter,
);
```
And assign your `AlertStyle` object to Alert's `style` field.
```dart
Alert(
context: context,
style: alertStyle,
type: AlertType.info,
title: "RFLUTTER ALERT",
desc: "Flutter is more awesome with RFlutter Alert.",
buttons: [
DialogButton(
child: Text(
"COOL",
style: TextStyle(color: Colors.white, fontSize: 20),
),
onPressed: () => Navigator.pop(context),
color: Color.fromRGBO(0, 179, 134, 1.0),
radius: BorderRadius.circular(0.0),
),
],
).show();
```
## Alert with Custom Image
```dart
Alert(
context: context,
title: "RFLUTTER ALERT",
desc: "Flutter is better with RFlutter Alert.",
image: Image.asset("assets/success.png"),
).show();
```
## Alert with Custom Content
```dart
Alert(
context: context,
title: "LOGIN",
content: Column(
children: <Widget>[
TextField(
decoration: InputDecoration(
icon: Icon(Icons.account_circle),
labelText: 'Username',
),
),
TextField(
obscureText: true,
decoration: InputDecoration(
icon: Icon(Icons.lock),
labelText: 'Password',
),
),
],
),
buttons: [
DialogButton(
onPressed: () => Navigator.pop(context),
child: Text(
"LOGIN",
style: TextStyle(color: Colors.white, fontSize: 20),
),
)
]).show();
```
## Contributions
* If you **found a bug**, open an issue.
* If you **have a feature request**, open an issue.
* If you **want to contribute**, submit a pull request.
## Version compatability
See CHANGELOG for all breaking (and non-breaking) changes.
<hr/>
Made with ❤ by <a href="https://ratel.com.tr">Ratel</a>
</p>
没有合适的资源?快使用搜索试试~ 我知道了~
RFlutterAlert是用于Flutter的超级可定制且易于使用.zip
共85个文件
png:39个
dart:9个
xml:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 148 浏览量
2023-04-05
13:00:37
上传
评论
收藏 238KB ZIP 举报
温馨提示
RFlutterAlert是用于Flutter的超级可定制且易于使用.zip
资源推荐
资源详情
资源评论
收起资源包目录
RFlutterAlert是用于Flutter的超级可定制且易于使用.zip (85个子文件)
rflutter_alert-master
lib
src
constants.dart 782B
dialog_button.dart 2KB
animation_transition.dart 3KB
alert.dart 10KB
alert_style.dart 3KB
rflutter_alert.dart 379B
pubspec.lock 3KB
assets
images
3.0x
icon_warning.png 17KB
icon_error.png 19KB
close.png 734B
icon_success.png 20KB
icon_info.png 18KB
icon_warning.png 4KB
icon_error.png 5KB
close.png 316B
2.0x
icon_warning.png 10KB
icon_error.png 11KB
close.png 514B
icon_success.png 12KB
icon_info.png 11KB
icon_success.png 5KB
icon_info.png 4KB
LICENSE 1KB
.metadata 307B
CHANGELOG.md 2KB
test
rflutter_alert_test.dart 288B
.gitignore 217B
example
lib
main.dart 11KB
assets
success.png 9KB
android
gradle.properties 75B
gradle
wrapper
gradle-wrapper.properties 232B
app
src
main
java
com
example
example
MainActivity.java 139B
res
mipmap-xxhdpi
ic_launcher.png 1KB
mipmap-hdpi
ic_launcher.png 544B
mipmap-mdpi
ic_launcher.png 442B
mipmap-xxxhdpi
ic_launcher.png 1KB
mipmap-xhdpi
ic_launcher.png 721B
values
styles.xml 591B
drawable
normal_background.xml 434B
launch_background.xml 434B
AndroidManifest.xml 2KB
build.gradle 2KB
build.gradle 470B
settings.gradle 484B
.metadata 303B
test
widget_test.dart 1KB
ios
Runner.xcworkspace
contents.xcworkspacedata 152B
Flutter
AppFrameworkInfo.plist 773B
Debug.xcconfig 30B
Release.xcconfig 30B
Runner
Base.lproj
Main.storyboard 2KB
LaunchScreen.storyboard 2KB
AppDelegate.h 103B
AppDelegate.m 424B
main.m 226B
Info.plist 1KB
Assets.xcassets
LaunchImage.imageset
Contents.json 391B
LaunchImage@3x.png 68B
LaunchImage@2x.png 68B
LaunchImage.png 68B
README.md 336B
AppIcon.appiconset
Icon-App-1024x1024@1x.png 11KB
Icon-App-60x60@3x.png 4KB
Icon-App-40x40@2x.png 2KB
Icon-App-29x29@1x.png 1KB
Icon-App-40x40@3x.png 3KB
Contents.json 2KB
Icon-App-40x40@1x.png 1KB
Icon-App-20x20@2x.png 1KB
Icon-App-20x20@1x.png 564B
Icon-App-60x60@2x.png 3KB
Icon-App-76x76@1x.png 2KB
Icon-App-29x29@3x.png 2KB
Icon-App-83.5x83.5@2x.png 4KB
Icon-App-20x20@3x.png 2KB
Icon-App-76x76@2x.png 3KB
Icon-App-29x29@2x.png 2KB
Runner.xcodeproj
xcshareddata
xcschemes
Runner.xcscheme 3KB
project.pbxproj 21KB
project.xcworkspace
contents.xcworkspacedata 152B
.gitignore 1KB
README.md 5KB
pubspec.yaml 521B
README.md 6KB
pubspec.yaml 452B
共 85 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功