|
1 | | -## 2.0.0 |
| 1 | +## 2.1.0 |
2 | 2 |
|
3 | | -Major feature upgrade release. |
| 3 | +Feature update release. |
4 | 4 |
|
5 | | -This release brings KAlertFlutter much closer to the native Android Java KAlertDialog library with a modern dialog API, professional UI styling, advanced customization, input validation, image dialogs, progress dialogs, and backward compatibility with the old API. |
| 5 | +This release adds WebView dialog support to KAlertFlutter, making the Flutter package more closely aligned with the native Android Java KAlertDialog library. WebView dialogs are useful for showing Terms and Conditions, Privacy Policy, Refund Policy, Help pages, FAQ pages, documentation pages, or any hosted web content directly inside a dialog. |
6 | 6 |
|
7 | 7 | ### New features |
8 | 8 |
|
9 | | -- Added new `KAlertDialog` API. |
10 | | -- Added `KAlertDialog.show()`. |
11 | | -- Added `KAlertDialog.success()`. |
12 | | -- Added `KAlertDialog.error()`. |
13 | | -- Added `KAlertDialog.warning()`. |
14 | | -- Added `KAlertDialog.info()`. |
15 | | -- Added `KAlertDialog.question()`. |
16 | | -- Added `KAlertDialog.progress()`. |
17 | | -- Added `KAlertDialog.input()`. |
18 | | -- Added `KAlertDialog.customView()`. |
19 | | -- Added `KAlertDialog.customImage()`. |
20 | | -- Added `KAlertDialog.urlImage()`. |
21 | | - |
22 | | -### New dialog types |
23 | | - |
24 | | -- Added `KAlertType.normal`. |
25 | | -- Added `KAlertType.success`. |
26 | | -- Added `KAlertType.error`. |
27 | | -- Added `KAlertType.warning`. |
28 | | -- Added `KAlertType.info`. |
29 | | -- Added `KAlertType.question`. |
30 | | -- Added `KAlertType.progress`. |
31 | | -- Added `KAlertType.input`. |
32 | | -- Added `KAlertType.customImage`. |
33 | | -- Added `KAlertType.urlImage`. |
34 | | -- Added `KAlertType.customView`. |
35 | | - |
36 | | -### New style presets |
37 | | - |
38 | | -- Added `KAlertStyle.classic`. |
39 | | -- Added `KAlertStyle.modern`. |
40 | | -- Added `KAlertStyle.minimal`. |
41 | | -- Added `KAlertStyle.rounded`. |
42 | | - |
43 | | -### Image dialog support |
44 | | - |
45 | | -- Added custom image dialog support. |
46 | | -- Added URL image dialog support. |
47 | | -- Added big URL image mode. |
48 | | -- Added circle URL image mode. |
49 | | -- Added `KAlertImageType.big`. |
50 | | -- Added `KAlertImageType.circle`. |
51 | | -- Added URL image placeholder support. |
52 | | -- Added URL image error widget support. |
53 | | - |
54 | | -### Input dialog improvements |
55 | | - |
56 | | -- Added input validation support. |
57 | | -- Added input max length support. |
58 | | -- Added keyboard type support. |
59 | | -- Added initial input value support. |
60 | | -- Added input confirm callback. |
61 | | -- Fixed input dialog controller lifecycle handling. |
62 | | -- Fixed TextEditingController disposed error. |
63 | | - |
64 | | -### Custom view support |
65 | | - |
66 | | -- Added support for placing any custom Flutter widget inside the dialog. |
67 | | -- Added custom view dialog API using `KAlertDialog.customView()`. |
68 | | - |
69 | | -### Progress dialog support |
70 | | - |
71 | | -- Added progress/loading dialog. |
72 | | -- Added non-dismissible progress dialog support. |
73 | | -- Added custom progress color support. |
74 | | - |
75 | | -### Dialog customization |
76 | | - |
77 | | -- Added custom dialog corner radius. |
78 | | -- Added custom dialog elevation. |
79 | | -- Added custom dim amount. |
80 | | -- Added custom max width. |
81 | | -- Added custom background color. |
82 | | -- Added custom title color. |
83 | | -- Added custom content color. |
84 | | -- Added custom icon color. |
85 | | -- Added custom title text style. |
86 | | -- Added custom content text style. |
87 | | -- Added title font weight support. |
88 | | -- Added content font weight support. |
89 | | -- Added title text size support. |
90 | | -- Added content text size support. |
91 | | - |
92 | | -### Button customization |
93 | | - |
94 | | -- Added confirm button text customization. |
95 | | -- Added cancel button text customization. |
96 | | -- Added confirm button color customization. |
97 | | -- Added cancel button color customization. |
98 | | -- Added confirm button text color customization. |
99 | | -- Added cancel button text color customization. |
100 | | -- Added button text size customization. |
101 | | -- Added confirm button font weight support. |
102 | | -- Added cancel button font weight support. |
103 | | -- Added button all-caps control. |
104 | | -- Added show/hide confirm button support. |
105 | | -- Added show/hide cancel button support. |
106 | | - |
107 | | -### Callback APIs |
108 | | - |
109 | | -- Added `onShow` callback. |
110 | | -- Added `onDismiss` callback. |
111 | | -- Added `onConfirm` callback. |
112 | | -- Added `onCancel` callback. |
113 | | -- Added input confirm callback. |
114 | | - |
115 | | -### UI improvements |
116 | | - |
117 | | -- Added modern Material-style dialog design. |
118 | | -- Added smooth fade and scale transition animation. |
119 | | -- Added animated dialog icons. |
120 | | -- Added dark mode friendly styling. |
121 | | -- Added responsive dialog max height handling. |
122 | | -- Added scroll handling to prevent keyboard overflow. |
123 | | -- Improved dialog spacing, radius, colors, and button layout. |
124 | | - |
125 | | -### Backward compatibility |
126 | | - |
127 | | -- Kept old `KAlert.show()` API. |
128 | | -- Kept old `KAlert.confirm()` API. |
129 | | -- Kept old `KAlert.prompt()` API. |
130 | | -- Old API now uses the new modern dialog UI internally. |
131 | | - |
132 | | -### Fixes |
133 | | - |
134 | | -- Fixed generic result type issue with `KAlertResult<String>`. |
135 | | -- Fixed `KAlertResult<dynamic>` type error on confirm button click. |
136 | | -- Fixed `TextEditingController was used after being disposed` issue in input dialogs. |
137 | | -- Fixed keyboard overflow issue in input dialogs. |
138 | | -- Improved dialog closing behavior for input and custom callback flows. |
| 9 | +- Added WebView dialog support. |
| 10 | +- Added `KAlertType.webView`. |
| 11 | +- Added `KAlertDialog.webView()`. |
| 12 | +- Added `KAlertDialog.showWebView()`. |
| 13 | +- Added backward-compatible `KAlert.webView()`. |
| 14 | +- Added support for loading hosted web pages inside dialogs. |
| 15 | +- Added Terms and Privacy Policy dialog support. |
| 16 | +- Added Refund Policy, Help, FAQ, and documentation page dialog support. |
| 17 | +- Added horizontal WebView loading progress support. |
| 18 | +- Added center WebView loading spinner support. |
| 19 | +- Added WebView created callback. |
| 20 | +- Added WebView progress callback. |
| 21 | +- Added WebView page started callback. |
| 22 | +- Added WebView page finished callback. |
| 23 | +- Added WebView page error callback. |
| 24 | +- Added navigation request callback support. |
| 25 | +- Added JavaScript enable/disable option. |
| 26 | +- Added WebView zoom enable/disable option. |
| 27 | +- Added configurable WebView height. |
| 28 | +- Added configurable progress color. |
| 29 | +- Added main-frame-only WebView error handling to avoid false errors from failed favicon, script, CSS, image, iframe, or analytics resources. |
| 30 | + |
| 31 | +### New dependency |
| 32 | + |
| 33 | +- Added `webview_flutter` for WebView rendering. |
| 34 | + |
| 35 | +### Usage |
| 36 | + |
| 37 | +```dart |
| 38 | +final result = await KAlertDialog.webView( |
| 39 | + context: context, |
| 40 | + title: 'Terms & Privacy Policy', |
| 41 | + content: 'Please read our terms and privacy policy before continuing.', |
| 42 | + url: 'https://policies.google.com/privacy', |
| 43 | + webViewHeight: 420, |
| 44 | + showHorizontalProgress: true, |
| 45 | + showCenterLoader: true, |
| 46 | + javaScriptEnabled: true, |
| 47 | + enableZoom: false, |
| 48 | + showCancelButton: true, |
| 49 | + confirmText: 'I Agree', |
| 50 | + cancelText: 'Cancel', |
| 51 | +); |
| 52 | +
|
| 53 | +if (result?.confirmed == true) { |
| 54 | + debugPrint('Accepted'); |
| 55 | +} |
| 56 | +```` |
| 57 | +
|
| 58 | +### Backward-compatible usage |
| 59 | +
|
| 60 | +```dart |
| 61 | +final accepted = await KAlert.webView( |
| 62 | + context, |
| 63 | + url: 'https://policies.google.com/privacy', |
| 64 | + title: 'Terms & Privacy Policy', |
| 65 | + message: 'Please read the page before continuing.', |
| 66 | +); |
| 67 | +
|
| 68 | +if (accepted == true) { |
| 69 | + debugPrint('Accepted'); |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +### Platform note |
| 74 | + |
| 75 | +For Android apps, make sure Internet permission is added in `android/app/src/main/AndroidManifest.xml`: |
| 76 | + |
| 77 | +```xml |
| 78 | +<uses-permission android:name="android.permission.INTERNET" /> |
| 79 | +``` |
| 80 | + |
| 81 | +For best compatibility, use `https://` URLs for Terms, Privacy Policy, Help, FAQ, and documentation pages. |
0 commit comments