forked from eatvio/eatvio_app
feat: appmetrica
This commit is contained in:
@@ -4,6 +4,7 @@ import 'dart:developer';
|
||||
import 'package:eatvio_app/core/const.dart';
|
||||
import 'package:eatvio_app/core/locator_service.dart';
|
||||
import 'package:eatvio_app/features/auth/presentation/bloc/auth_cubit/auth_cubit.dart';
|
||||
import 'package:eatvio_app/features/registration/services/registration_analytics_service.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
@@ -24,6 +25,8 @@ class _WebViewRegistrationScreenState extends State<WebViewRegistrationScreen> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
authCubit = sl<AuthCubit>();
|
||||
// Report webview registration started
|
||||
RegistrationAnalyticsService.reportRegistrationStep(18); // Webview registration step
|
||||
_controller = WebViewController()
|
||||
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||
..addJavaScriptChannel(
|
||||
@@ -43,10 +46,9 @@ class _WebViewRegistrationScreenState extends State<WebViewRegistrationScreen> {
|
||||
NavigationDelegate(
|
||||
onNavigationRequest: (NavigationRequest request) {
|
||||
if (request.url.contains('profile')) {
|
||||
authCubit.getTokenByCredentials(
|
||||
email!,
|
||||
password!,
|
||||
);
|
||||
// Report webview registration completion
|
||||
RegistrationAnalyticsService.reportRegistrationComplete();
|
||||
authCubit.getTokenByCredentials(email!, password!);
|
||||
}
|
||||
return NavigationDecision.navigate;
|
||||
},
|
||||
@@ -86,12 +88,8 @@ class _WebViewRegistrationScreenState extends State<WebViewRegistrationScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 0,
|
||||
),
|
||||
body: SafeArea(
|
||||
child: WebViewWidget(controller: _controller),
|
||||
),
|
||||
appBar: AppBar(toolbarHeight: 0),
|
||||
body: SafeArea(child: WebViewWidget(controller: _controller)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user