Skip to content

Commit d5c23a7

Browse files
committed
Update readme
1 parent d546d3b commit d5c23a7

File tree

5 files changed

+124
-17
lines changed

5 files changed

+124
-17
lines changed

README.md

+57-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# RFlutter Alert
22
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.
33

4-
[![Version](https://img.shields.io/badge/version-1.0.1-blue.svg)](https://pub.dartlang.org/packages/rflutter_alert)
4+
[![Version](https://img.shields.io/badge/version-1.0.2-blue.svg)](https://pub.dartlang.org/packages/rflutter_alert)
55

66
<p>
7-
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert.gif">
7+
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_V1.0.2.gif">
88
</p>
99

1010
<p>
11-
<img src="https://ratel.com.tr/hub/rflutter_alert_success.png" width="200">
12-
<img src="https://ratel.com.tr/hub/rflutter_alert_error.png" width="200">
13-
<img src="https://ratel.com.tr/hub/rflutter_alert_warning.png" width="200">
14-
<img src="https://ratel.com.tr/hub/rflutter_alert_info.png" width="200">
11+
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_V1.0.2.png" width="200">
12+
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_basic_V1.0.2.png" width="200">
13+
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_buttons_V1.0.2.png" width="200">
14+
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_custom_V1.0.2.png" width="200">
15+
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_error_V1.0.2.png" width="200">
16+
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_icon_V1.0.2.png" width="200">
17+
<img src="https://github.com/ozibrahim/files/raw/master/rflutter_alert_style_V1.0.2.png" width="200">
1518
</p>
1619

1720
## Features
@@ -32,7 +35,7 @@ RFlutter Alert is super customizable and easy-to-use alert/popup dialogs for Flu
3235
You must add the library as a dependency to your project.
3336
```yaml
3437
dependencies:
35-
rflutter_alert: ^1.0.1
38+
rflutter_alert: ^1.0.2
3639
```
3740
3841
You can also reference the git repo directly if you want:
@@ -157,6 +160,53 @@ And assing your `AlertStyle` object to Alert's `style` field.
157160
],
158161
).show();
159162
```
163+
164+
## Alert with Custom Image
165+
166+
```dart
167+
Alert(
168+
context: context,
169+
title: "RFLUTTER ALERT",
170+
desc: "Flutter is better with RFlutter Alert.",
171+
image: Image.asset("assets/success.png"),
172+
).show();
173+
```
174+
175+
## Alert with Custom Content
176+
177+
```dart
178+
Alert(
179+
context: context,
180+
title: "LOGIN",
181+
content: Column(
182+
children: <Widget>[
183+
TextField(
184+
decoration: InputDecoration(
185+
icon: Icon(Icons.account_circle),
186+
labelText: 'Username',
187+
),
188+
),
189+
TextField(
190+
obscureText: true,
191+
decoration: InputDecoration(
192+
icon: Icon(Icons.lock),
193+
labelText: 'Password',
194+
),
195+
),
196+
],
197+
),
198+
buttons: [
199+
DialogButton(
200+
onPressed: () => Navigator.pop(context),
201+
child: Text(
202+
"LOGIN",
203+
style: TextStyle(color: Colors.white, fontSize: 20),
204+
),
205+
)
206+
]).show();
207+
```
208+
209+
160210
## Contributions
161211
* If you **found a bug**, open an issue.
162212
* If you **have a feature request**, open an issue.

example/README.md

+57-1
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,22 @@ class PopupDialog extends StatelessWidget {
4242
RaisedButton(
4343
child: Text('Alert with Style'),
4444
onPressed: () => _onAlertWithStylePressed(context),
45-
)
45+
),
46+
RaisedButton(
47+
child: Text('Alert with Custom Image'),
48+
onPressed: () => _onAlertWithCustomImagePressed(context),
49+
),
50+
RaisedButton(
51+
child: Text('Alert with Custom Content'),
52+
onPressed: () => _onAlertWithCustomContentPressed(context),
53+
),
4654
],
4755
),
4856
),
4957
);
5058
}
5159
60+
// The easiest way for creating RFlutter Alert
5261
_onBasicAlertPressed(context) {
5362
Alert(
5463
context: context,
@@ -57,6 +66,7 @@ class PopupDialog extends StatelessWidget {
5766
.show();
5867
}
5968
69+
// Alert with single button.
6070
_onAlertButtonPressed(context) {
6171
Alert(
6272
context: context,
@@ -76,6 +86,7 @@ class PopupDialog extends StatelessWidget {
7686
).show();
7787
}
7888
89+
// Alert with multiple and custom buttons
7990
_onAlertButtonsPressed(context) {
8091
Alert(
8192
context: context,
@@ -106,7 +117,9 @@ class PopupDialog extends StatelessWidget {
106117
).show();
107118
}
108119
120+
// Advanced using of alerts
109121
_onAlertWithStylePressed(context) {
122+
// Reusable alert style
110123
var alertStyle = AlertStyle(
111124
animationType: AnimationType.fromTop,
112125
isCloseButton: false,
@@ -124,6 +137,7 @@ class PopupDialog extends StatelessWidget {
124137
),
125138
);
126139
140+
// Alert dialog using custom alert style
127141
Alert(
128142
context: context,
129143
style: alertStyle,
@@ -143,6 +157,48 @@ class PopupDialog extends StatelessWidget {
143157
],
144158
).show();
145159
}
160+
161+
// Alert custom images
162+
_onAlertWithCustomImagePressed(context) {
163+
Alert(
164+
context: context,
165+
title: "RFLUTTER ALERT",
166+
desc: "Flutter is more awesome with RFlutter Alert.",
167+
image: Image.asset("assets/success.png"),
168+
).show();
169+
}
170+
// Alert custom content
171+
_onAlertWithCustomContentPressed(context) {
172+
Alert(
173+
context: context,
174+
title: "LOGIN",
175+
content: Column(
176+
children: <Widget>[
177+
TextField(
178+
decoration: InputDecoration(
179+
icon: Icon(Icons.account_circle),
180+
labelText: 'Username',
181+
),
182+
),
183+
TextField(
184+
obscureText: true,
185+
decoration: InputDecoration(
186+
icon: Icon(Icons.lock),
187+
labelText: 'Password',
188+
),
189+
),
190+
],
191+
),
192+
buttons: [
193+
DialogButton(
194+
onPressed: () => Navigator.pop(context),
195+
child: Text(
196+
"LOGIN",
197+
style: TextStyle(color: Colors.white, fontSize: 20),
198+
),
199+
)
200+
]).show();
201+
}
146202
}
147203
148204
```

example/lib/main.dart

+8-7
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class PopupDialog extends StatelessWidget {
6161
Alert(
6262
context: context,
6363
title: "RFLUTTER ALERT",
64-
desc: "Flutter is better with RFlutter Alert.")
64+
desc: "Flutter is more awesome with RFlutter Alert.")
6565
.show();
6666
}
6767

@@ -71,7 +71,7 @@ class PopupDialog extends StatelessWidget {
7171
context: context,
7272
type: AlertType.error,
7373
title: "RFLUTTER ALERT",
74-
desc: "Flutter is better with RFlutter Alert.",
74+
desc: "Flutter is more awesome with RFlutter Alert.",
7575
buttons: [
7676
DialogButton(
7777
child: Text(
@@ -91,7 +91,7 @@ class PopupDialog extends StatelessWidget {
9191
context: context,
9292
type: AlertType.warning,
9393
title: "RFLUTTER ALERT",
94-
desc: "Flutter is better with RFlutter Alert.",
94+
desc: "Flutter is more awesome with RFlutter Alert.",
9595
buttons: [
9696
DialogButton(
9797
child: Text(
@@ -121,7 +121,7 @@ class PopupDialog extends StatelessWidget {
121121
// Reusable alert style
122122
var alertStyle = AlertStyle(
123123
animationType: AnimationType.fromTop,
124-
isCloseButton: true,
124+
isCloseButton: false,
125125
isOverlayTapDismiss: false,
126126
descStyle: TextStyle(fontWeight: FontWeight.bold),
127127
animationDuration: Duration(milliseconds: 400),
@@ -142,7 +142,7 @@ class PopupDialog extends StatelessWidget {
142142
style: alertStyle,
143143
type: AlertType.info,
144144
title: "RFLUTTER ALERT",
145-
desc: "Flutter is better with RFlutter Alert.",
145+
desc: "Flutter is more awesome with RFlutter Alert.",
146146
buttons: [
147147
DialogButton(
148148
child: Text(
@@ -157,15 +157,16 @@ class PopupDialog extends StatelessWidget {
157157
).show();
158158
}
159159

160+
// Alert custom images
160161
_onAlertWithCustomImagePressed(context) {
161162
Alert(
162163
context: context,
163164
title: "RFLUTTER ALERT",
164-
desc: "Flutter is better with RFlutter Alert.",
165+
desc: "Flutter is more awesome with RFlutter Alert.",
165166
image: Image.asset("assets/success.png"),
166167
).show();
167168
}
168-
169+
// Alert custom content
169170
_onAlertWithCustomContentPressed(context) {
170171
Alert(
171172
context: context,

lib/src/alert_style.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AlertStyle {
3535
this.animationType = AnimationType.fromBottom,
3636
this.animationDuration = const Duration(milliseconds: 200),
3737
this.alertBorder,
38-
this.isCloseButton = false,
38+
this.isCloseButton = true,
3939
this.isOverlayTapDismiss = true,
4040
this.overlayColor = Colors.black87,
4141
this.titleStyle = const TextStyle(

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: rflutter_alert
22
description: 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.
3-
version: 1.0.1
3+
version: 1.0.2
44
author: Ratel <[email protected]>
55
homepage: https://github.com/RatelHub/rflutter_alert
66

0 commit comments

Comments
 (0)