Skip to content

Commit

Permalink
callback name change
Browse files Browse the repository at this point in the history
  • Loading branch information
Ragul-XA authored and jay-xa committed Jul 23, 2024
1 parent a69c1d0 commit a76093c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/src/presentation/aad_b2c_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ADB2CEmbedWebView extends StatefulWidget {
final Color webViewBackgroundColor;
final String? userAgent;
final Function(String url)? getCurrentUrl;
final Function(String url)? onGetCurrentPageUrl;

const ADB2CEmbedWebView({
super.key,
Expand All @@ -49,6 +50,7 @@ class ADB2CEmbedWebView extends StatefulWidget {
this.webViewBackgroundColor = const Color(0x00000000),
this.userAgent,
this.getCurrentUrl,
this.onGetCurrentPageUrl,

// Optionals with default value
this.responseType = Constants.defaultResponseType,
Expand All @@ -67,7 +69,7 @@ class ADB2CEmbedWebViewState extends State<ADB2CEmbedWebView> {
late Function(BuildContext context) onErrorOrCancel;
Widget? loadingReplacement;
late Function onRedirect;
late Function getCurrentUrl;
late Function onGetCurrentPageUrl;

bool isLoading = true;
bool showRedirect = false;
Expand Down Expand Up @@ -127,6 +129,7 @@ class ADB2CEmbedWebViewState extends State<ADB2CEmbedWebView> {
super.dispose();
controller = null;
getCurrentUrl = widget.getCurrentUrl ?? () {};
onGetCurrentPageUrl = widget.onGetCurrentPageUrl ?? () {};

//Enable virtual display.
if (Platform.isAndroid) WebView.platform = AndroidWebView();
Expand Down Expand Up @@ -218,7 +221,7 @@ class ADB2CEmbedWebViewState extends State<ADB2CEmbedWebView> {
}
} else {
// To get forgot password and reset password page urls.
getCurrentUrl(url);
onGetCurrentPageUrl(url);
}
}

Expand Down

0 comments on commit a76093c

Please sign in to comment.