Selaa lähdekoodia

Merge branch 'v1.0.0' of http://git.atmob.com:28999/Atmob-Flutter/AiKeyboard2025 into v1.0.0

hezihao 7 kuukautta sitten
vanhempi
commit
90e266569b

+ 2 - 2
lib/data/consts/error_code.dart

@@ -15,7 +15,7 @@ class ErrorCode {
 
 /// 错误码扩展方法
 extension ErrorDescription on int {
-  String get description {
+  String? get description {
     switch (this) {
       case ErrorCode.verificationCodeError:
         return StringName.loginVerificationCodeRequestFailedToast;
@@ -24,7 +24,7 @@ extension ErrorDescription on int {
       case ErrorCode.sensitive:
         return StringName.sensitiveContent;
       default:
-        return 'UNKNOWN_ERROR';
+        return null;
     }
   }
 }

+ 1 - 1
lib/module/browser/browser_controller.dart

@@ -53,7 +53,7 @@ class BrowserController extends BaseController {
   }
 
   void _getTitle() async {
-    await Future.delayed(const Duration(seconds: 500));
+    await Future.delayed(const Duration(milliseconds: 1500));
     webViewController.getTitle().then((title) {
       if (title != null) {
         this.title.value = title;

+ 2 - 0
lib/module/browser/browser_page.dart

@@ -31,6 +31,7 @@ class BrowserPage extends BasePage<BrowserController> {
       child: Scaffold(
         backgroundColor: Colors.transparent,
         appBar: AppBar(
+          centerTitle: true,
           systemOverlayStyle: SystemUiOverlayStyle.dark,
           backgroundColor: Colors.transparent,
           title: Obx(
@@ -42,6 +43,7 @@ class BrowserPage extends BasePage<BrowserController> {
               ),
             ),
           ),
+
           leading: IconButton(
             icon: SizedBox(
               width: 24.w,

+ 2 - 1
lib/module/change/hobbies/change_hobbies_page.dart

@@ -265,9 +265,10 @@ class ChangeHobbiesPage extends BasePage<ChangeHobbiesController> {
                 padding: EdgeInsets.only(left: 16.w),
                 child: Row(
                   children: [
+                  controller.currentCharacterCustomConfig?.customHobby==true?
                     _buildCustom(() {
                       controller.clickHobbiesCustom();
-                    }),
+                    }):SizedBox(),
                     ...controller.hobbiesSelectLabels.map((item) {
                       return Container(
                         margin: EdgeInsets.only(left: 8.w),

+ 9 - 0
lib/module/intro/intro_controller.dart

@@ -1,5 +1,7 @@
 import 'dart:async';
+import 'dart:io';
 import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
 import 'package:get/get.dart';
 import 'package:keyboard/base/base_controller.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -121,6 +123,13 @@ class IntroController extends BaseController {
     });
   }
 
+  void clickBack() {
+    if (GetPlatform.isAndroid) {
+      SystemNavigator.pop();
+    }
+    exit(0);
+  }
+
   @override
   void onClose() {
     _autoPageTimer?.cancel();

+ 6 - 1
lib/module/intro/intro_page.dart

@@ -26,7 +26,12 @@ class IntroPage extends BasePage<IntroController> {
   @override
   Widget buildBody(BuildContext context) {
     return PopScope(
-      canPop: false,
+      onPopInvokedWithResult: (didPop, result) async {
+        if (didPop) {
+          return;
+        }
+        controller.clickBack();
+      },
       child: Stack(
         children: [
           Assets.images.bgIntro.image(width: double.infinity, fit: BoxFit.fill),

+ 2 - 2
lib/module/profile/edit/profile_edit_controller.dart

@@ -275,10 +275,10 @@ class ProfileEditController extends BaseController {
 
   void _handleError(dynamic error) {
     if (error is ServerErrorException) {
-      ErrorHandler.toastError(error);
+      ErrorHandler.toastError(error,message: error.message);
       AtmobLog.d(tag, 'clickSaveButton error: ${error.message}');
     } else {
-      ErrorHandler.toastError(error);
+
       AtmobLog.d(tag, 'clickSaveButton error1: $error');
     }
   }

+ 8 - 0
lib/module/profile/profile_controller.dart

@@ -28,6 +28,8 @@ class ProfileController extends BaseController {
 
   int get userGender => userInfo?.gender ?? 0;
 
+  bool get isLogin => accountRepository.isLogin.value;
+
   final Rx<KeyboardInfo> _currentCustomKeyboardInfo = KeyboardInfo().obs;
 
   KeyboardInfo get currentCustomKeyboardInfo =>
@@ -110,6 +112,12 @@ class ProfileController extends BaseController {
   clickAvatar({required bool isUser, KeyboardInfo? keyboardInfo}) async {
     AtmobLog.d(tag, "clickAvatar");
     if (!isUser) {
+      if (isLogin == false) {
+        ToastUtil.show('请先登录~');
+        LoginDialog.show();
+        return;
+      }
+
       var result = await ProfileEditPage.start(keyboardInfo: keyboardInfo);
       if (result == true) {
         await getCustomKeyboard();