Update: 2026-06-13 15:43:50
This commit is contained in:
@@ -17,6 +17,13 @@ class AppLink {
|
||||
|
||||
static const String appDomain = 'siromove.com';
|
||||
|
||||
static String get inviteRedirectUrl {
|
||||
if (currentCountry == 'Syria') {
|
||||
return "https://siromove.com/inviteSyria.php";
|
||||
}
|
||||
return "https://siromove.com/invite.php";
|
||||
}
|
||||
|
||||
static String get location {
|
||||
switch (currentCountry) {
|
||||
case 'Syria': return 'https://api-syria.siromove.com/siro_v3/ride/location';
|
||||
|
||||
@@ -45,7 +45,8 @@ class InviteController extends GetxController {
|
||||
final String shareText =
|
||||
'''Join Siro as a driver using my referral code!
|
||||
Use code: $driverCouponCode
|
||||
Download the Siro Driver app now and earn rewards!
|
||||
Download the Siro Driver app now and earn rewards:
|
||||
https://siromove.com/invite.php?code=$driverCouponCode&app=driver
|
||||
''';
|
||||
await Share.share(shareText);
|
||||
}
|
||||
@@ -55,7 +56,8 @@ Download the Siro Driver app now and earn rewards!
|
||||
if (couponCode != null) {
|
||||
final String shareText = '''Get a discount on your first Siro ride!
|
||||
Use my referral code: $couponCode
|
||||
Download the Siro app now and enjoy your ride!
|
||||
Download the Siro app now and enjoy your ride:
|
||||
https://siromove.com/invite.php?code=$couponCode&app=rider
|
||||
''';
|
||||
await Share.share(shareText);
|
||||
}
|
||||
@@ -491,15 +493,15 @@ Download the Siro app now and enjoy your ride!
|
||||
if (response != 'failure') {
|
||||
var d = (response);
|
||||
mySnackbarSuccess('Invite sent successfully'.tr);
|
||||
String inviteCode = d['message']['inviteCode'].toString();
|
||||
String message = '${'*Siro DRIVER CODE*'.tr}\n\n'
|
||||
'${"Use this code in registration".tr}\n'
|
||||
'${"To get a gift for both".tr}\n\n'
|
||||
'${"The period of this code is 24 hours".tr}\n\n'
|
||||
'${'before'.tr} *${d['message']['expirationTime'].toString()}*\n\n'
|
||||
'_*${d['message']['inviteCode'].toString()}*_\n\n'
|
||||
'${"Install our app:".tr}\n'
|
||||
'*Android:* https://play.google.com/store/apps/details?id=com.siro_driver \n\n\n'
|
||||
'*iOS:* https://apps.apple.com/st/app/siro-driver/id6482995159';
|
||||
'_*${inviteCode}*_\n\n'
|
||||
'${"Quick Invite Link:".tr}\n'
|
||||
'${AppLink.inviteRedirectUrl}?code=$inviteCode&app=driver';
|
||||
|
||||
launchCommunication('whatsapp', formattedPhoneNumber, message);
|
||||
invitePhoneController.clear();
|
||||
@@ -534,18 +536,16 @@ Download the Siro app now and enjoy your ride!
|
||||
if (response != 'failure') {
|
||||
var d = response;
|
||||
mySnackbarSuccess('Invite sent successfully'.tr);
|
||||
String inviteCode = d['message']['inviteCode'].toString();
|
||||
|
||||
String message = '${'*Siro APP CODE*'.tr}\n\n'
|
||||
'${"Use this code in registration".tr}\n\n'
|
||||
'${"To get a gift for both".tr}\n\n'
|
||||
'${"The period of this code is 24 hours".tr}\n\n'
|
||||
'${'before'.tr} *${d['message']['expirationTime'].toString()}*\n\n'
|
||||
'_*${d['message']['inviteCode'].toString()}*_\n\n'
|
||||
'_*${inviteCode}*_\n\n'
|
||||
'${"Quick Invite Link:".tr}\n'
|
||||
'https://${AppLink.appDomain}/?inviteCode=${d['message']['inviteCode'].toString()}\n\n'
|
||||
'${"Install our app:".tr}\n'
|
||||
'*Android:* https://play.google.com/store/apps/details?id=com.Siro.siro\n\n\n'
|
||||
'*iOS:* https://apps.apple.com/st/app/siro-rider/id6748075179';
|
||||
'${AppLink.inviteRedirectUrl}?code=$inviteCode&app=rider';
|
||||
|
||||
launchCommunication('whatsapp', formattedPhoneNumber, message);
|
||||
invitePhoneController.clear();
|
||||
|
||||
@@ -51,17 +51,17 @@ class DefaultFirebaseOptions {
|
||||
|
||||
static const FirebaseOptions android = FirebaseOptions(
|
||||
apiKey: 'AIzaSyAEoply_UcEP6KaCu_ziCy_ZDIjAKvi7b8',
|
||||
appId: '1:825988584191:android:4525a21b00173d361632ca',
|
||||
appId: '1:825988584191:android:492d9bc1df6b40c51632ca',
|
||||
messagingSenderId: '825988584191',
|
||||
projectId: 'siro-a6957',
|
||||
storageBucket: 'siro-a6957.firebasestorage.app',
|
||||
);
|
||||
static const FirebaseOptions ios = FirebaseOptions(
|
||||
apiKey: 'AIzaSyDk6x6KZUY0IQtxoCMXX0F7N_yik8O19eA',
|
||||
appId: '1:825988584191:ios:4002b88e618f0c4e1632ca',
|
||||
appId: '1:825988584191:ios:a86f1a54f0b1aaa21632ca',
|
||||
messagingSenderId: '825988584191',
|
||||
projectId: 'siro-a6957',
|
||||
storageBucket: 'siro-a6957.firebasestorage.app',
|
||||
iosBundleId: 'com.siro.driver',
|
||||
iosBundleId: 'com.siro.siro-driver',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:siro_driver/views/widgets/error_snakbar.dart';
|
||||
import 'package:siro_driver/views/widgets/my_textField.dart';
|
||||
import 'package:siro_driver/views/widgets/elevated_btn.dart'; // Checked import
|
||||
@@ -40,29 +39,13 @@ class SosConnect extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// === SOS Button ===
|
||||
_buildModernActionButton(
|
||||
icon: MaterialIcons.warning,
|
||||
color: Colors.white,
|
||||
bgColor: AppColor.redColor,
|
||||
tooltip: 'EMERGENCY SOS',
|
||||
isPulsing: true,
|
||||
onTap: () => _handleSosCall(controller),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// === Quick Invite Button ===
|
||||
_buildModernActionButton(
|
||||
icon: Icons.qr_code_rounded,
|
||||
color: Colors.white,
|
||||
bgColor: AppColor.blueColor,
|
||||
tooltip: 'Quick Invite',
|
||||
isPulsing: false,
|
||||
onTap: () => _showQuickInviteDialog(controller),
|
||||
),
|
||||
],
|
||||
child: _buildModernActionButton(
|
||||
icon: MaterialIcons.warning,
|
||||
color: Colors.white,
|
||||
bgColor: AppColor.redColor,
|
||||
tooltip: 'EMERGENCY SOS',
|
||||
isPulsing: true,
|
||||
onTap: () => _handleSosCall(controller),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -140,70 +123,4 @@ class SosConnect extends StatelessWidget {
|
||||
launchCommunication('phone', box.read(BoxName.sosPhoneDriver), '');
|
||||
}
|
||||
}
|
||||
|
||||
void _showQuickInviteDialog(MapDriverController controller) {
|
||||
// In a real scenario, this code would be fetched from the backend (ReferralController)
|
||||
// For now we will use a generated code or driverId. We should use the one from ReferralController
|
||||
// But since we are accessing it globally, we can just use the driverID + 123 for now until it's linked
|
||||
String driverId = box.read(BoxName.driverID).toString();
|
||||
String inviteCode = "SR$driverId"; // Placeholder code
|
||||
String deepLink = "https://${AppLink.appDomain}/invite?ref=$inviteCode";
|
||||
|
||||
Get.defaultDialog(
|
||||
title: "Quick Invite".tr,
|
||||
titleStyle: AppStyle.title.copyWith(fontWeight: FontWeight.bold),
|
||||
content: Column(
|
||||
children: [
|
||||
Text(
|
||||
"Let the passenger scan this code to sign up".tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 14, color: Colors.grey),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: QrImageView(
|
||||
data: deepLink,
|
||||
version: QrVersions.auto,
|
||||
size: 200.0,
|
||||
backgroundColor: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.blueColor.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: AppColor.blueColor.withOpacity(0.3)),
|
||||
),
|
||||
child: Text(
|
||||
inviteCode,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: AppColor.blueColor,
|
||||
letterSpacing: 4,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Done'.tr,
|
||||
onPressed: () => Get.back(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user