Update: 2026-06-23 17:57:07
This commit is contained in:
@@ -58,6 +58,7 @@ import 'package:flutter_confetti/flutter_confetti.dart' hide Circle;
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
class RideLifecycleController extends GetxController {
|
||||
bool isDataInitializedAfterLogin = false;
|
||||
// --- Missing variables from monolithic controller ---
|
||||
String currentRideId = '';
|
||||
bool isDrawingRoute = false;
|
||||
@@ -4049,9 +4050,31 @@ class RideLifecycleController extends GetxController {
|
||||
await _checkAndRefreshMapStyle();
|
||||
Get.put(DeepLinkController(), permanent: true);
|
||||
await initilizeGetStorage();
|
||||
|
||||
final bool isLoggedIn = box.read(BoxName.isVerified) == '1' &&
|
||||
box.read(BoxName.passengerID) != null;
|
||||
|
||||
if (isLoggedIn) {
|
||||
isDataInitializedAfterLogin = true;
|
||||
getLocationArea(passengerLocation.latitude, passengerLocation.longitude);
|
||||
unawaited(_stagePricingAndState());
|
||||
unawaited(_stageNiceToHave());
|
||||
startMasterTimer();
|
||||
} else {
|
||||
Log.print("RideLifecycleController.onInit: User not logged in, skipping startup API calls.");
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> initializeDataAfterLogin() async {
|
||||
if (isDataInitializedAfterLogin) {
|
||||
Log.print("RideLifecycleController: Already initialized, skipping duplicate initializeDataAfterLogin.");
|
||||
return;
|
||||
}
|
||||
isDataInitializedAfterLogin = true;
|
||||
Log.print("RideLifecycleController: Initializing data after successful login...");
|
||||
getLocationArea(passengerLocation.latitude, passengerLocation.longitude);
|
||||
unawaited(_stagePricingAndState());
|
||||
unawaited(_stageNiceToHave());
|
||||
await _stagePricingAndState();
|
||||
await _stageNiceToHave();
|
||||
startMasterTimer();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user