Update project
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
@@ -13,7 +14,8 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../../constants/color_constants.dart';
|
||||
import '../../constants/font_constants.dart';
|
||||
import '../../controllers/tenant_controller /tenant_list.dart';
|
||||
import '../../controllers/tenant_list/tenant_controller.dart';
|
||||
import '../../service/firebase_analytics/analytics_service.dart';
|
||||
import '../../widgets/text_widget.dart';
|
||||
import '../home_view.dart';
|
||||
|
||||
@@ -114,6 +116,19 @@ class _CustomerCreateViewState extends State<CustomerCreateView> {
|
||||
await prefs.setString('customerDoorNo', details['doorno'] ?? '');
|
||||
|
||||
debugPrint("✅ Customer info saved to SharedPreferences.");
|
||||
|
||||
await FirebaseAnalytics.instance.setUserId(
|
||||
id: customerIdStr,
|
||||
);
|
||||
|
||||
await AnalyticsService.logEvent(
|
||||
'signup_success',
|
||||
parameters: {
|
||||
'customer_id': int.tryParse(customerIdStr) ?? 0,
|
||||
'customer_name': details['firstname'] ?? '',
|
||||
'user_type': 'new_user',
|
||||
},
|
||||
);
|
||||
}
|
||||
tenantController.loadTenants();
|
||||
|
||||
@@ -131,11 +146,7 @@ class _CustomerCreateViewState extends State<CustomerCreateView> {
|
||||
fontSize: 15,
|
||||
);
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
// ❌ Handle failure message from API
|
||||
debugPrint("❌ API returned failure: $message");
|
||||
|
||||
@@ -147,8 +158,6 @@ class _CustomerCreateViewState extends State<CustomerCreateView> {
|
||||
textColor: Colors.white,
|
||||
fontSize: 15,
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
} catch (e, stacktrace) {
|
||||
debugPrint(" Something went wrong");
|
||||
@@ -161,17 +170,11 @@ class _CustomerCreateViewState extends State<CustomerCreateView> {
|
||||
textColor: Colors.white,
|
||||
fontSize: 15,
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
|
||||
|
||||
|
||||
final size = MediaQuery.of(context).size;
|
||||
final width = size.width;
|
||||
final height = size.height;
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
import '../../controllers/authentication/auth_controller.dart';
|
||||
import '../../service/firebase_analytics/analytics_service.dart';
|
||||
import '../authentication/verification_view.dart';
|
||||
|
||||
class Login_view extends StatelessWidget {
|
||||
@@ -319,8 +320,13 @@ class Login_view extends StatelessWidget {
|
||||
elevation: 0,
|
||||
),
|
||||
onPressed: canProceed
|
||||
? () =>
|
||||
authController.signIn(context, phone)
|
||||
? () async {
|
||||
await AnalyticsService.logEvent(
|
||||
'login_continue_clicked',
|
||||
);
|
||||
|
||||
authController.signIn(context, phone);
|
||||
}
|
||||
: null,
|
||||
child: authController.isLoading.value
|
||||
? const SizedBox(
|
||||
|
||||
Reference in New Issue
Block a user