diff --git a/android/app/build.gradle b/android/app/build.gradle index 6a083c8..e04a887 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -60,7 +60,7 @@ android { versionCode flutterVersionCode.toInteger() versionName flutterVersionName ndk { - abiFilters "armeabi-v7a","arm64-v8a","x86" + abiFilters "armeabi-v7a", "arm64-v8a", "x86" } multiDexEnabled true } @@ -86,11 +86,11 @@ android { implementation 'com.google.android.material:material:1.3.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'com.squareup.okhttp3:okhttp:3.9.0' - implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0' //OKHttp优化策略依赖 - implementation 'com.squareup.okio:okio:1.13.0' - implementation 'org.greenrobot:eventbus:3.1.1' - implementation 'com.google.code.gson:gson:2.10.1' + implementation 'com.squareup.okhttp3:okhttp:3.9.0' + implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0' //OKHttp优化策略依赖 + implementation 'com.squareup.okio:okio:1.13.0' + implementation 'org.greenrobot:eventbus:3.1.1' + implementation 'com.google.code.gson:gson:2.10.1' //配置glide图片加载框架 implementation 'com.github.bumptech.glide:glide:3.7.0' diff --git a/android/app/libs/cloudgamelibrary-2.4.115.aar b/android/app/libs/cloudgamelibrary-2.4.115.aar new file mode 100644 index 0000000..cc001bc Binary files /dev/null and b/android/app/libs/cloudgamelibrary-2.4.115.aar differ diff --git a/android/app/libs/cloudgamelibrary-2.4.46.aar b/android/app/libs/cloudgamelibrary-2.4.46.aar deleted file mode 100644 index a834ff1..0000000 Binary files a/android/app/libs/cloudgamelibrary-2.4.46.aar and /dev/null differ diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 26667c9..c931bef 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -72,7 +72,7 @@ + android:exported="true"> @@ -84,7 +84,7 @@ + android:exported="true"> diff --git a/android/app/src/main/java/co/steamcloud/game/PlayGameActivity.java b/android/app/src/main/java/co/steamcloud/game/PlayGameActivity.java index ba35c1d..e9aee9f 100644 --- a/android/app/src/main/java/co/steamcloud/game/PlayGameActivity.java +++ b/android/app/src/main/java/co/steamcloud/game/PlayGameActivity.java @@ -131,14 +131,14 @@ public class PlayGameActivity extends Activity { private String isReconPlay = "false";//是否是重连游戏 public boolean btn_right_close = false;//右边摇杆是否关闭 public int virtual_mode = 1;//1表示虚拟手柄,2表示自定义虚拟手柄,3表示虚拟键盘,4表示自定义虚拟键盘 - public int shubiao_mode = 2;//鼠标模式 1=点击模式 2=滑屏点击 + public int shubiao_mode = 1;//鼠标模式 1=点击模式 2=滑屏点击 //操控输入 tController player1 = new tController((byte) 0); //手柄 MouseEvent mouseEvent = new MouseEvent(); //鼠标 Timer keyEventTimer = null; TimerTask keyEventTimerTask = null; - private boolean IsGameInput;//虚拟手柄 - private boolean IsKeyBoard;//虚拟键盘 + private boolean IsGameInput = true;//虚拟手柄 + private boolean IsKeyBoard = true;//虚拟键盘 private boolean IsGameMouse; public int Ismode = 1;//1手柄 2键盘 private boolean showKeyboard = false; @@ -855,42 +855,42 @@ public class PlayGameActivity extends Activity { // setPictureQuality(10, speed5); // }); handle1.setOnClickListener(v -> { - if (IsGameInput) { - handle1.setEnabled(false); - handle1.setBackgroundResource(R.drawable.shape_blue_bg1); - imgKeySet.setBackgroundResource(R.drawable.shape_blue_bg2); - imgKeySet.setEnabled(true); - if (MNKeyboard != null) { - MNKeyboard.setVisibility(View.VISIBLE); - } - if (IsKeyBoard) { - NetworkKeyboard.setVisibility(View.GONE); - Ismode = 1; - handle2.setEnabled(true); - handle2.setBackgroundResource(R.drawable.bg_border_performance); - custom_button_yg.setVisibility(View.VISIBLE); - } - +// if (IsGameInput) { + handle1.setEnabled(false); + handle1.setBackgroundResource(R.drawable.shape_blue_bg1); + imgKeySet.setBackgroundResource(R.drawable.shape_blue_bg2); + imgKeySet.setEnabled(true); + if (MNKeyboard != null) { + MNKeyboard.setVisibility(View.VISIBLE); } + if (IsKeyBoard) { + NetworkKeyboard.setVisibility(View.GONE); + Ismode = 1; + handle2.setEnabled(true); + handle2.setBackgroundResource(R.drawable.bg_border_performance); + custom_button_yg.setVisibility(View.VISIBLE); + } + +// } }); handle2.setOnClickListener(v -> { - if (IsKeyBoard) { - handle2.setEnabled(false); - handle2.setBackgroundResource(R.drawable.shape_blue_bg); - NetworkKeyboard.setVisibility(View.VISIBLE); - if (IsGameInput) { - handle1.setBackgroundResource(R.drawable.bg_border_performance3); - imgKeySet.setBackgroundResource(R.drawable.bg_border_performance4); - handle1.setEnabled(true); - imgKeySet.setEnabled(false); - Ismode = 2; - if (MNKeyboard != null) { - MNKeyboard.setVisibility(View.GONE); - } - custom_button_yg.setVisibility(View.GONE); +// if (IsKeyBoard) { + handle2.setEnabled(false); + handle2.setBackgroundResource(R.drawable.shape_blue_bg); + NetworkKeyboard.setVisibility(View.VISIBLE); + if (IsGameInput) { + handle1.setBackgroundResource(R.drawable.bg_border_performance3); + imgKeySet.setBackgroundResource(R.drawable.bg_border_performance4); + handle1.setEnabled(true); + imgKeySet.setEnabled(false); + Ismode = 2; + if (MNKeyboard != null) { + MNKeyboard.setVisibility(View.GONE); } - + custom_button_yg.setVisibility(View.GONE); } + +// } }); handle3.setOnClickListener(v -> { if (shubiao_mode == 2) { @@ -2639,6 +2639,54 @@ public class PlayGameActivity extends Activity { } public void getGameSetting() { + //有虚拟键盘 + if (IsKeyBoard) { + //请求虚拟键盘 + //JSONArray keyboardList = new JSONArray(netHander.getGameVirKeyboard(PlayGameActivity.this)); +// netHander.getGameVirKeyboard(new DataResponseCallback() { +// @Override +// public void onResponseSuccess(ResponseDao response) { +// if (response.getCode() == 0 && response.getResult() == 0) { +// //JSONObject jo1 = null; +// VirtualKey(response.getData().toString()); +// } +// } +// +// @Override +// public void onResponseFail(String errorString) { +// +// } +// }); + mImageCursor.setVisibility(View.VISIBLE); + mImageCursor.setFocusableInTouchMode(false); + + handle3.setTextColor(getResources().getColor(R.color.white)); +// handle3.setBackgroundColor(getResources().getColor(R.color.handle2_gb)); +// handle4.setTextColor(getResources().getColor(R.color.colorAccent1)); +// handle4.setBackgroundColor(getResources().getColor(R.color.handle1_gb)); + + if (IsGameInput) { + MNKeyboard.addView(handleView); + NetworkKeyboard.setVisibility(View.GONE); + Ismode = 1; +// handle1.setBackgroundColor(getResources().getColor(R.color.handle1_gb)); +// handle2.setBackgroundColor(getResources().getColor(R.color.handle2_gb)); + handle2.setTextColor(Color.parseColor("#FFFFFF")); + custom_button_yg.setVisibility(View.VISIBLE); + } else { + handle1.setEnabled(false); +// handle1.setBackgroundColor(getResources().getColor(R.color.handle2_gb)); + handle1.setTextColor(Color.parseColor("#33FFFFFF")); + + MNKeyboard.setVisibility(View.GONE); + NetworkKeyboard.setVisibility(View.VISIBLE); + Ismode = 2; +// handle2.setBackgroundColor(getResources().getColor(R.color.handle1_gb)); + handle2.setTextColor(Color.parseColor("#FFFFFF")); + custom_button_yg.setVisibility(View.GONE); + } + + } // netHander.getGameSetting(new DataResponseCallback() { // @Override @@ -2735,16 +2783,16 @@ public class PlayGameActivity extends Activity { // // } else { // //没有虚拟键盘,直接加载默认手柄 - MNKeyboard.addView(handleView); - NetworkKeyboard.setVisibility(View.GONE); - - Ismode = 1; - handle1.setBackgroundResource(R.drawable.shape_blue_bg1); - imgKeySet.setBackgroundResource(R.drawable.shape_blue_bg2); - handle2.setBackgroundResource(R.drawable.bg_border_performance2); - handle2.setTextColor(Color.parseColor("#33FFFFFF")); - handle3.setEnabled(false); - handle4.setEnabled(false); +// MNKeyboard.addView(handleView); +// NetworkKeyboard.setVisibility(View.GONE); +// +// Ismode = 1; +// handle1.setBackgroundResource(R.drawable.shape_blue_bg1); +// imgKeySet.setBackgroundResource(R.drawable.shape_blue_bg2); +//// handle2.setBackgroundResource(R.drawable.bg_border_performance2); +//// handle2.setTextColor(Color.parseColor("#33FFFFFF")); +// handle3.setEnabled(false); +// handle4.setEnabled(false); // } // // } else { @@ -2895,7 +2943,6 @@ public class PlayGameActivity extends Activity { @Override public void onError(int code, String msg) { Log.i(TAG, "startGame onError: " + code + "| " + msg); -// onGameError(code, msg); } @Override @@ -2991,7 +3038,7 @@ public class PlayGameActivity extends Activity { int userPlayGameTime = heartData.getInt("userPlayGameTime");//用户剩余游玩时间(分钟) int diamond = heartData.getInt("diamond");//钻石数 - if (userPlayGameTime <= 1) { + if (userPlayGameTime <= 3) { Toast.makeText(PlayGameActivity.this, "游玩时间不足,钻石耗尽将会自动退出游戏!", Toast.LENGTH_SHORT).show(); } @@ -3011,45 +3058,11 @@ public class PlayGameActivity extends Activity { } - private void closeGameNoTime(String errMessage, String errCategory) { - closeGame(); -// new Thread() { -// @Override -// public void run() { -// Config.is_CloseIng = true; -// int count = 0; -// Config.is_CloseGameHeartbeat = false; -// while (!Config.is_CloseGameHeartbeat) { -// -// try { -// Thread.sleep(60); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } -// count++; -// if (count == 1000) { -// count = 0; -// netHander.logErr(errMessage, errCategory, "sj"); -// closeGame(); -// } -// } -// -// } -// }.start(); - } - public void closeGame() { Log.d(TAG, "closeGame: "); ActivityCollector.removeActivity(this); -// netHander.stopSession(Config.gamePara.sc_id); -// Config.is_SolidHandle = String.valueOf(isHandelEnter()); WhaleCloud.getInstance().stopGame(); -// Config.is_CloseGameHeartbeat = true; - /*Intent intent = new Intent(this, MainActivity.class); - intent.putExtra("GameType", "0"); - startActivity(intent);*/ -// EventBus.getDefault().post("ExitGame", EventBusParams.GAME); } @@ -3157,43 +3170,6 @@ public class PlayGameActivity extends Activity { // // } - //加入vip -// private void showJoinVip() { -// if (joinMembershipDialog != null) { -// if (!joinMembershipDialog.isShowing()) { -// joinMembershipDialog.show(); -// } -// joinMembershipDialog.setJoinVip(new JoinMembershipDialog.JoinVip() { -// @Override -// public void pay(String data, String OrderCode, String price, String payType, String name, String productId) { -// orderId = OrderCode; -// payMoney = price; -// payChannel = payType; -// rechargeId = name; -// ProductId = productId; -// Pingpp.createPayment(PlayGameActivity.this, data); -// -// -// try { -// JSONObject ShowRecharge = new JSONObject(); -// ShowRecharge.put("recharge_type", "游戏内支付"); -// ShowRecharge.put("Front_page", Config.gamePara.game_key); -// SensorsDataAPI.sharedInstance().track("Um_Event_ShowRecharge", ShowRecharge); -// } catch (JSONException e) { -// e.printStackTrace(); -// } -// } -// -// @Override -// public void close() { -// hideBottomUIMenu(); -// } -// }); -// -// } -// } - - public static int getNavigationBarHeight(Context var0) { boolean var1 = ViewConfiguration.get(var0).hasPermanentMenuKey(); int var2; @@ -3934,87 +3910,6 @@ public class PlayGameActivity extends Activity { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { - //支付页面返回处理 -// if (requestCode == Pingpp.REQUEST_CODE_PAYMENT) { -// if (resultCode == Activity.RESULT_OK) { -// String result = data.getExtras().getString("pay_result"); -// /* 处理返回值 -// * "success" - 支付 -// * 成功 -// * "fail" - 支付失败 -// * "cancel" - 取消支付 -// * "invalid" - 支付插件未安装(一般是微信客户端未安装的情况) -// * "unknown" - app进程异常被杀死(一般是低内存状态下,app进程被杀死) -// */ -// String errorMsg = data.getExtras().getString("error_msg"); // 错误信息 -// String extraMsg = data.getExtras().getString("extra_msg"); // 错误信息 -// switch (result) { -// case "success": -// -// netHander.GetOrderStage2(orderId, QuickPaymentId); -// netHander.logPay(payMoney, ProductId); -// -// showToast("支付成功"); -// -// EventBus.getDefault().post("pay_success", EventBusParams.GAME); -// -// try { -// JSONObject RechargeBuy = new JSONObject(); -// RechargeBuy.put("item_id", ProductId); -// RechargeBuy.put("item_price", payMoney); -// RechargeBuy.put("order_id", orderId); -// RechargeBuy.put("recharge_id", rechargeId); -// RechargeBuy.put("recharge_num", payMoney); -// RechargeBuy.put("recharge_mode", payChannel); -// RechargeBuy.put("recharge_type", "游戏内支付"); -// RechargeBuy.put("Front_page", Config.gamePara.game_key); -// -// SensorsDataAPI.sharedInstance().track("RechargeBuyFE", RechargeBuy); -// } catch (JSONException e) { -// e.printStackTrace(); -// } -// -// -// conDiamond.setVisibility(View.GONE); -// imgShowHide.setVisibility(View.GONE); -// if (dialog != null) { -// dialog.dismiss(); -// } -// isInsufficientDialog = false; -// if (refresh != null) { -// refresh.cancel(); -// } -// -// break; -// case "fail": -// showToast("支付失败"); -// break; -// case "cancel": -// showToast("取消支付"); -// -// try { -// JSONObject ExisdRechargePage = new JSONObject(); -// ExisdRechargePage.put("B_Key_PageLowPosition", NetHander.B_Key_PageLowPosition); -// ExisdRechargePage.put("WUID", CocosMethods.deviceId); -// SensorsDataAPI.sharedInstance().track("Um_Event_ExisdRechargePage", ExisdRechargePage); -// } catch (JSONException e) { -// e.printStackTrace(); -// } -// -// break; -// case "invalid": -// showToast("支付插件未安装"); -// break; -// case "unknown": -// showToast("系统异常,请重新启动app"); -// break; -// } -// } -// } else if (requestCode == 10012) { -// String areaCode = data.getStringExtra("areaCode"); -// String name = data.getStringExtra("name"); -// -// } } public void showToast(final String toast) { diff --git a/android/app/src/main/res/layout/layout_game_setting.xml b/android/app/src/main/res/layout/layout_game_setting.xml index a69311c..3f4be64 100644 --- a/android/app/src/main/res/layout/layout_game_setting.xml +++ b/android/app/src/main/res/layout/layout_game_setting.xml @@ -127,14 +127,14 @@ android:id="@+id/seting_g2" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:visibility="gone" + android:visibility="visible" app:constraint_referenced_ids="scr_g2" /> @@ -336,12 +336,12 @@ android:layout_width="100dp" android:layout_height="28dp" android:layout_marginStart="17dp" - android:background="@drawable/bg_border_performance2" + android:background="@drawable/bg_border_performance" android:gravity="center" - android:text="虚拟键盘" - android:textColor="#33FFFFFF" + android:text="虚拟鼠标" + android:textColor="#FFFFFFFF" android:textSize="11sp" - android:visibility="gone" + android:visibility="visible" app:layout_constraintBottom_toBottomOf="@id/img_key_set" app:layout_constraintLeft_toRightOf="@id/img_key_set" app:layout_constraintTop_toTopOf="@id/img_key_set" /> @@ -354,9 +354,9 @@ android:layout_marginStart="38dp" android:layout_marginTop="20dp" android:text="鼠标模式" - android:textColor="#FFFFFF" - android:textSize="14sp" - android:visibility="gone" + android:textColor="#FFA2A2A2" + android:textSize="15sp" + android:visibility="visible" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toBottomOf="@id/handle1" /> @@ -365,12 +365,12 @@ android:layout_width="68dp" android:layout_height="28dp" android:layout_marginTop="16dp" - android:background="@drawable/bg_border_performance2" + android:background="@drawable/shape_blue_bg" android:gravity="center" android:text="点击模式" - android:textColor="#33FFFFFF" + android:textColor="#FFFFFFFF" android:textSize="11sp" - android:visibility="gone" + android:visibility="visible" app:layout_constraintLeft_toLeftOf="@id/operation8" app:layout_constraintTop_toBottomOf="@id/operation8" /> @@ -379,12 +379,12 @@ android:layout_width="68dp" android:layout_height="28dp" android:layout_marginLeft="16dp" - android:background="@drawable/bg_border_performance2" + android:background="@drawable/bg_border_performance" android:gravity="center" android:text="滑屏点击" - android:textColor="#33FFFFFF" + android:textColor="#FFFFFFFF" android:textSize="11sp" - android:visibility="gone" + android:visibility="visible" app:layout_constraintLeft_toRightOf="@+id/handle3" app:layout_constraintTop_toTopOf="@+id/handle3" /> @@ -394,7 +394,7 @@ android:layout_height="wrap_content" android:layout_marginTop="20dp" android:gravity="center_vertical" - android:visibility="gone" + android:visibility="visible" app:layout_constraintLeft_toLeftOf="@+id/handle1" app:layout_constraintTop_toBottomOf="@+id/handle4"> @@ -402,11 +402,10 @@ android:id="@+id/tv_sensitivity" android:layout_width="wrap_content" android:layout_height="25dp" - android:layout_marginStart="15dp" android:gravity="center" android:text="鼠标灵敏度" - android:textColor="#FFFFFF" - android:textSize="14sp" /> + android:textColor="#FFA2A2A2" + android:textSize="15sp" /> { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/game/game_page.dart b/lib/tools/game/game_page.dart index 907a33f..189d913 100644 --- a/lib/tools/game/game_page.dart +++ b/lib/tools/game/game_page.dart @@ -57,8 +57,8 @@ class _GamePageState extends State with AutomaticKeepAliveClientMixin @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/game/game_play_time_page.dart b/lib/tools/game/game_play_time_page.dart index 1e72352..5b1148b 100644 --- a/lib/tools/game/game_play_time_page.dart +++ b/lib/tools/game/game_play_time_page.dart @@ -49,8 +49,8 @@ class _GamePlaytimeState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/home/message/message_center_page.dart b/lib/tools/home/message/message_center_page.dart index d456d1f..3302a38 100644 --- a/lib/tools/home/message/message_center_page.dart +++ b/lib/tools/home/message/message_center_page.dart @@ -46,8 +46,8 @@ class _MessageCenterPageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/home/message/message_details_page.dart b/lib/tools/home/message/message_details_page.dart index 43f835d..9c88d8e 100644 --- a/lib/tools/home/message/message_details_page.dart +++ b/lib/tools/home/message/message_details_page.dart @@ -49,8 +49,8 @@ class _MessageDetailsPageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/home/my_home_page.dart b/lib/tools/home/my_home_page.dart index b090d0d..a6cf06b 100644 --- a/lib/tools/home/my_home_page.dart +++ b/lib/tools/home/my_home_page.dart @@ -116,8 +116,8 @@ class _MyHomePageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override @@ -157,10 +157,9 @@ class _MyHomePageState extends State { SingleChildScrollView( child: Column( children: [ - Container( + SizedBox( width: size.width, height: h387, - color: const Color(0xFFA4A4A4), child: Stack( children: [ ///banner @@ -400,17 +399,10 @@ class _MyHomePageState extends State { !NetworkConfig.isChecking ? GestureDetector( onTap: () { - // EasyLoading.show( - // indicator: Lottie.asset( - // 'assets/animation/line_up.json', - // repeat: true, - // ), - // ); if (NetworkConfig.token == "") { Navigator.pushNamed(context, "/LoginPage"); return; } - Navigator.pushNamed(context, "/MessageCenterPage").then((value) { _viewModel.getUserMessageNotReadCount(); }); diff --git a/lib/tools/home/search_page.dart b/lib/tools/home/search_page.dart index 8432538..e1e9a1e 100644 --- a/lib/tools/home/search_page.dart +++ b/lib/tools/home/search_page.dart @@ -63,8 +63,8 @@ class _SearchPageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } void _searchChanged(String str) { diff --git a/lib/tools/home_page.dart b/lib/tools/home_page.dart index 238b1a5..4c51bfa 100644 --- a/lib/tools/home_page.dart +++ b/lib/tools/home_page.dart @@ -43,13 +43,15 @@ class _HomePageState extends State with TickerProviderStateMixin { late StreamSubscription subscription; final HomeModel _viewModel = HomeModel(); late Timer _timer; - late BuildContext lineUpContext; + // late BuildContext lineUpContext; late ReconnectBean reconnectBean; bool isLineUp = false; DateTime? _lastPressTime; + late OverlayEntry entry; + @override void initState() { // TODO: implement initState @@ -150,20 +152,19 @@ class _HomePageState extends State with TickerProviderStateMixin { String gameId = event['gameId']; if (!isLineUp) { - showDialog( - context: context, - barrierDismissible: false, - builder: (BuildContext context) { - lineUpContext = context; - return LineUpDialog( - lineUpDialogKey, - num: queueBean.queue_pos!, - onTap: () { - _timer.cancel(); - _viewModel.cancelQueue(gameId); - }, - ); - }); + final overlay = Overlay.of(context); + entry = OverlayEntry(builder: (BuildContext context) { + return LineUpDialog( + lineUpDialogKey, + num: queueBean.queue_pos!, + onTap: () { + entry.remove(); + _timer.cancel(); + _viewModel.cancelQueue(gameId); + }, + ); + }); + overlay.insert(entry); isLineUp = true; } @@ -190,7 +191,8 @@ class _HomePageState extends State with TickerProviderStateMixin { ///排队成功 开始游戏 case "gameQueueSuccess": print("gameQueueSuccess"); - Navigator.pop(lineUpContext); + entry.remove(); + // Navigator.pop(lineUpContext); _timer.cancel(); _viewModel.playGame(NetworkConfig.gameId); break; @@ -238,12 +240,12 @@ class _HomePageState extends State with TickerProviderStateMixin { @override void dispose() { // TODO: implement dispose + super.dispose(); _startGamesEvent.cancel(); _tabSwitchEvent.cancel(); _timer.cancel(); _refreshUserEvent.cancel(); subscription.cancel(); - super.dispose(); } void onPageChanged(int index) { diff --git a/lib/tools/login/login_page.dart b/lib/tools/login/login_page.dart index 9d53f92..b44a9cc 100644 --- a/lib/tools/login/login_page.dart +++ b/lib/tools/login/login_page.dart @@ -62,11 +62,11 @@ class _LoginPageState extends State { @override void dispose() { // TODO: implement dispose + super.dispose(); _phoneController.dispose(); _codeController.dispose(); subscription.cancel(); _timer?.cancel(); - super.dispose(); } ///获取验证码 diff --git a/lib/tools/me/edit_info_page.dart b/lib/tools/me/edit_info_page.dart index 6fd660f..a6335b1 100644 --- a/lib/tools/me/edit_info_page.dart +++ b/lib/tools/me/edit_info_page.dart @@ -41,8 +41,8 @@ class _EditInfoPageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/me/feedback_page.dart b/lib/tools/me/feedback_page.dart index 923e40b..6b3e2ad 100644 --- a/lib/tools/me/feedback_page.dart +++ b/lib/tools/me/feedback_page.dart @@ -41,10 +41,10 @@ class _FeedbackPageState extends State { @override void dispose() { // TODO: implement dispose + super.dispose(); subscription.cancel(); _textController.dispose(); _contactController.dispose(); - super.dispose(); } @override diff --git a/lib/tools/me/game_history_page.dart b/lib/tools/me/game_history_page.dart index 34971a9..e5cddfa 100644 --- a/lib/tools/me/game_history_page.dart +++ b/lib/tools/me/game_history_page.dart @@ -46,8 +46,8 @@ class _GameHistoryPageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/me/my_collect_page.dart b/lib/tools/me/my_collect_page.dart index e49f997..17cedc6 100644 --- a/lib/tools/me/my_collect_page.dart +++ b/lib/tools/me/my_collect_page.dart @@ -45,8 +45,8 @@ class _MyCollectPageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/me/my_page.dart b/lib/tools/me/my_page.dart index 5cd9f4a..3524691 100644 --- a/lib/tools/me/my_page.dart +++ b/lib/tools/me/my_page.dart @@ -79,9 +79,9 @@ class _MyPageState extends State with AutomaticKeepAliveClientMixin { @override void dispose() { // TODO: implement dispose + super.dispose(); subscription.cancel(); _event.cancel(); - super.dispose(); } @override diff --git a/lib/tools/me/property/expenses_page.dart b/lib/tools/me/property/expenses_page.dart index de8eb69..25e1f51 100644 --- a/lib/tools/me/property/expenses_page.dart +++ b/lib/tools/me/property/expenses_page.dart @@ -44,8 +44,8 @@ class _ExpensesPageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/me/property/income_page.dart b/lib/tools/me/property/income_page.dart index 4d4c17e..b0cff5e 100644 --- a/lib/tools/me/property/income_page.dart +++ b/lib/tools/me/property/income_page.dart @@ -44,8 +44,8 @@ class _IncomePageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/me/set/about_page.dart b/lib/tools/me/set/about_page.dart index f7c70f0..bb8820f 100644 --- a/lib/tools/me/set/about_page.dart +++ b/lib/tools/me/set/about_page.dart @@ -41,8 +41,8 @@ class _AboutPageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override diff --git a/lib/tools/me/set/real_name_page.dart b/lib/tools/me/set/real_name_page.dart index 081d11e..a845f1f 100644 --- a/lib/tools/me/set/real_name_page.dart +++ b/lib/tools/me/set/real_name_page.dart @@ -59,10 +59,10 @@ class _RealNamePageState extends State { @override void dispose() { // TODO: implement dispose + super.dispose(); subscription.cancel(); _nameController.dispose(); _codeController.dispose(); - super.dispose(); } @override diff --git a/lib/tools/shop/shop_page.dart b/lib/tools/shop/shop_page.dart index 14df15d..868f7e6 100644 --- a/lib/tools/shop/shop_page.dart +++ b/lib/tools/shop/shop_page.dart @@ -97,10 +97,10 @@ class _ShopPageState extends State with AutomaticKeepAliveClientMixin @override void dispose() { // TODO: implement dispose + super.dispose(); _paySuccess?.cancel(); _refreshUserEvent.cancel(); subscription.cancel(); - super.dispose(); } @override diff --git a/lib/tools/start_page.dart b/lib/tools/start_page.dart index aa00b30..b563f1f 100644 --- a/lib/tools/start_page.dart +++ b/lib/tools/start_page.dart @@ -133,8 +133,8 @@ class _StartPageState extends State { @override void dispose() { // TODO: implement dispose - subscription.cancel(); super.dispose(); + subscription.cancel(); } @override