|
|
@@ -6,6 +6,7 @@ import 'package:gravity_engine/gravity_engine_method_channel.dart';
|
|
|
import 'package:location/data/repositories/account_repository.dart';
|
|
|
import 'package:location/data/repositories/config_repository.dart';
|
|
|
import 'package:location/utils/atmob_log.dart';
|
|
|
+import 'package:location/utils/toast_util.dart';
|
|
|
import '../../data/api/response/member_status_response.dart';
|
|
|
import '../../data/consts/build_config.dart';
|
|
|
import '../../data/consts/payment_type.dart';
|
|
|
@@ -18,6 +19,7 @@ typedef GravitySuccessCallback = void Function();
|
|
|
class GravityHelper {
|
|
|
static const String tag = 'GravityHelper';
|
|
|
static const String _keyCurrentDeviceId = "current_device_id";
|
|
|
+ static const bool _isShowToast = false;
|
|
|
static CancelableFuture<bool>? _initFuture;
|
|
|
static String? _currentClientId;
|
|
|
|
|
|
@@ -82,6 +84,7 @@ class GravityHelper {
|
|
|
atmobPlatformInfo.channelName ?? '',
|
|
|
BuildConfig.isDebug)
|
|
|
.then((data) {
|
|
|
+ _toast('gravity initialize success clientId:$deviceId');
|
|
|
debugPrint('gravity initialize success clientId:$deviceId');
|
|
|
GravityHelper._currentClientId = deviceId;
|
|
|
return data;
|
|
|
@@ -89,6 +92,12 @@ class GravityHelper {
|
|
|
}, 5);
|
|
|
}
|
|
|
|
|
|
+ static void _toast(String msg) {
|
|
|
+ if (_isShowToast) {
|
|
|
+ ToastUtil.show(msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
static void onLogin() {
|
|
|
_clearCurrentDeviceId();
|
|
|
_initialize(true, callback: () {
|