Skip to content

Commit

Permalink
feat: add support for no-op idv flow (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-tbd committed Aug 20, 2024
1 parent 22b4805 commit c66bba7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/features/kcc/kcc_webview_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class KccWebviewPage extends HookConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
const finish = 'finish.html';

final idvRequest = useState<AsyncValue<IdvRequest>>(const AsyncLoading());
final webViewController = useState<InAppWebViewController?>(null);

Expand Down Expand Up @@ -66,14 +68,25 @@ class KccWebviewPage extends HookConsumerWidget {
final fullPath =
Uri.parse(data.url).replace(scheme: 'https').toString();

if (fullPath.contains(finish)) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => KccRetrievalPage(
pfi: pfi,
idvRequest: data,
),
),
);
}

controller.loadUrl(urlRequest: URLRequest(url: WebUri(fullPath)));
},
onLoadStop: (controller, url) async {
if (url == null) {
return;
}

if (url.path.contains('finish.html')) {
if (url.path.contains(finish)) {
await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => KccRetrievalPage(
Expand Down

0 comments on commit c66bba7

Please sign in to comment.