Merge branch 'master' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan
commit
6b2f1a86df
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j
|
||||
b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ
|
||||
KoZIhvcNAQEBBQADggEPADCCAQoCggEBALcPrk09MmhQhRNe8LYdaeN4mYtoKJg3
|
||||
SndMLgpxnaRqP7a6f4sp118wCFZsTXnwhPVP4DzmXWc2AzZtsusmhdw1tzNFtme0
|
||||
PtEjDXIPI2lHU3Zhi2zukZdAVxF+uNi3pcp0axina60ZQciIfb/7Fx6hNbqpk90E
|
||||
O8a2Ob17Wq/ZTYIP4H7ZGydUe2ra9QyDtjmGj9vpEv+xXYWX685sgEylTG14DSOP
|
||||
ozGsQmaf+QCMbCT3osq7idWc1IQ+3Oed0kUTx1jmRtZwPzQkJJ1Bx3vYSXN/EOlb
|
||||
u+ei1Nqtc14aVCYvmcuvGDtMyRtw6w+syCw2CpJCPGNkxNz+EH9h+EUCAwEAAaAA
|
||||
MA0GCSqGSIb3DQEBCwUAA4IBAQBYdu2AaZY6kReuT1Xp8ktlyPfjBRKhPPChuaeR
|
||||
tFnYMsJtG0aIA/xOu4/RYDgmL92seimULXd9DIPvkJ2DuaB+bdfGTw0qXUlihkm8
|
||||
ui5O0L2F9OZbQxJogvTmrMsKnkoR27O5vyfCn9VMOLk3x1nyEzAXIj/5GHWw9T6t
|
||||
r65jPUOfm6ikiZtICBzSaTPBtyfZB8mrbwG2dpOvVNSa1dj3xip4L8CL6TxH+qM3
|
||||
+N90QFYjvjphJkpn2Kt0ow9IyIyeqJbIYJmsWoV9pXddOHCjKdTWUjq7D2Jn3eUA
|
||||
DAKjKgVqF4/dU10k7EtSfrw01aHLXjj5FxsD5YhVrgTA5xSq
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j
|
||||
b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ
|
||||
KoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnHqsyE7WfiVcE1Lpa4t4OVO6qlll2q
|
||||
1djs0XG06R/dlDtIqv4940/XLj+hU93mzAcVvFW4DSIEdD3InM3+T6oMTjPu6meU
|
||||
69h9ryaVkluQRrT/tdGI1EKO4MWGMe4MDIt7DqMhMfAcxTwekwdxdKaCEhaw3qnA
|
||||
l/64AelY6URW1pHHJMA0VV7j+pE3jVNai+muMXPrhQ1VrOrV8FftpY3bEeRJR2Cl
|
||||
T0tv0LhEMu4SfLnVWCzGQQC82hilDw3rH3ZDs8DFxF9agNVdwKlYamarh1dQXwRq
|
||||
Yx2+sjY1/51r9L4VS+GAh9ECxz0e+43NpzfZ/N+mTeDYKDepaBwPQ6kCAwEAAaAA
|
||||
MA0GCSqGSIb3DQEBCwUAA4IBAQB89OyLfywKT7ftmpEqCmgsmaJexb580q9w8wOk
|
||||
1JhJkNV5ec+p1dnge2NZeJ4LGII/5wmPj1vANNW0GZdmJDgnC+2gg9toq1QLCAsF
|
||||
rW7/LMpgAoEH+P5bhrHV9RRv6BQi0ZmN0apBHjp/pqZfm2Cl5jQPEWjUEf2tIF4l
|
||||
LSKdok6IPO9n4Fgyk0XdUNSEhgVhsLtZkGiXnkI1YovKDnupTFYPXMLp103bc9zP
|
||||
xDxwscvOysNDijlzZAkJPg2z8NrJIRDrKvLRHzxQwZ/1LHVB/51bp/1iyks3vOjh
|
||||
qw5XVsrtGAjCjU9md7q3XkPSyKzhK9UqPdOxdvl1OY0KKIIY
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,17 @@
|
||||
package io.flutter.plugins.firebasemessaging;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.google.firebase.messaging.RemoteMessage;
|
||||
|
||||
public class CustomFlutterFirebaseMessagingService extends FlutterFirebaseMessagingService {
|
||||
@Override
|
||||
public void onMessageReceived(RemoteMessage remoteMessage) {
|
||||
if (remoteMessage.getData().containsKey("is_call")) {
|
||||
Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName());
|
||||
startActivity(intent);
|
||||
super.onMessageReceived(remoteMessage);
|
||||
} else
|
||||
super.onMessageReceived(remoteMessage);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package io.flutter.plugins.firebasemessaging;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.google.firebase.messaging.RemoteMessage;
|
||||
|
||||
public class CustomFlutterFirebaseMessagingService extends FlutterFirebaseMessagingService {
|
||||
@Override
|
||||
public void onMessageReceived(RemoteMessage remoteMessage) {
|
||||
if (remoteMessage.getData().containsKey("is_call")) {
|
||||
Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName());
|
||||
startActivity(intent);
|
||||
super.onMessageReceived(remoteMessage);
|
||||
} else
|
||||
super.onMessageReceived(remoteMessage);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
|
||||
class LocationUtils {
|
||||
AppSharedPreferences sharedPref = new AppSharedPreferences();
|
||||
|
||||
bool isShowConfirmDialog;
|
||||
BuildContext context;
|
||||
|
||||
LocationUtils({@required this.isShowConfirmDialog, @required this.context});
|
||||
|
||||
void getCurrentLocation() async {
|
||||
print("current location");
|
||||
isLocationServiceEnabled().then((value) {
|
||||
if (value) {
|
||||
checkPermission().then((permission) {
|
||||
if (permission == LocationPermission.always ||
|
||||
permission == LocationPermission.whileInUse) {
|
||||
getLastKnownPosition().then((value) => setLocation(value));
|
||||
}
|
||||
|
||||
if (permission == LocationPermission.denied ||
|
||||
permission == LocationPermission.deniedForever) {
|
||||
setZeroLocation();
|
||||
if (isShowConfirmDialog) showErrorLocationDialog(false);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
} else {
|
||||
if (isShowConfirmDialog) showErrorLocationDialog(false);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
showErrorLocationDialog(bool isPermissionError) {
|
||||
ConfirmDialog dialog = new ConfirmDialog(
|
||||
context: context,
|
||||
confirmMessage: TranslationBase.of(context).locationDialogMessage,
|
||||
okText: TranslationBase.of(context).confirm,
|
||||
cancelText: TranslationBase.of(context).cancel_nocaps,
|
||||
okFunction: () => {
|
||||
ConfirmDialog.closeAlertDialog(context),
|
||||
if (isPermissionError)
|
||||
openAppSettings()
|
||||
else
|
||||
openLocationSettings()
|
||||
},
|
||||
cancelFunction: () => {});
|
||||
return dialog.showAlertDialog(context);
|
||||
}
|
||||
|
||||
void setLocation(Position position) {
|
||||
print(position);
|
||||
this.sharedPref.setDouble(USER_LAT, position.latitude);
|
||||
this.sharedPref.setDouble(USER_LONG, position.longitude);
|
||||
}
|
||||
|
||||
void setZeroLocation() {
|
||||
this.sharedPref.setDouble(USER_LAT, 0.0);
|
||||
this.sharedPref.setDouble(USER_LONG, 0.0);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue