diff --git a/circle_app/android/app/build.gradle b/circle_app/android/app/build.gradle index dc3ca8e..def45c7 100644 --- a/circle_app/android/app/build.gradle +++ b/circle_app/android/app/build.gradle @@ -72,7 +72,7 @@ android { minSdkVersion 21 targetSdkVersion flutter.targetSdkVersion versionCode 14 - versionName "1.2.0" + versionName "1.2.2" manifestPlaceholders = [ vivo_APPID: "105669716", vivo_APPKEY:"84f750207787376b310ca5b0d5969122", diff --git a/circle_app/ios/Runner.xcodeproj/project.pbxproj b/circle_app/ios/Runner.xcodeproj/project.pbxproj index 87ba7e9..52312c1 100644 --- a/circle_app/ios/Runner.xcodeproj/project.pbxproj +++ b/circle_app/ios/Runner.xcodeproj/project.pbxproj @@ -381,7 +381,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.1; + MARKETING_VERSION = 1.2.2; PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -530,7 +530,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.1; + MARKETING_VERSION = 1.2.2; PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -573,7 +573,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.1; + MARKETING_VERSION = 1.2.2; PRODUCT_BUNDLE_IDENTIFIER = com.exampe.circleApp; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; diff --git a/circle_app/lib/app/aboutapp/logic.dart b/circle_app/lib/app/aboutapp/logic.dart index 713ec55..f373a0e 100644 --- a/circle_app/lib/app/aboutapp/logic.dart +++ b/circle_app/lib/app/aboutapp/logic.dart @@ -1,4 +1,4 @@ -import 'package:flutter_install_app/flutter_install_app.dart'; +// import 'package:flutter_install_app/flutter_install_app.dart'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -32,7 +32,9 @@ class AboutappLogic extends GetxController { _updateInfo = bean.data; version = bean.data.version; update(); - showReportDialog(Get.context!, bean.data.constraint == 0, bean.data); + if (isUpdate) { + showReportDialog(Get.context!, bean.data.constraint == 0, bean.data); + } } //getVersion(); @@ -51,7 +53,7 @@ class AboutappLogic extends GetxController { if(isUpdate){ showReportDialog(Get.context!, _updateInfo!.constraint == 0, _updateInfo!); }else { - showOKToast("暂无新版本"); + showOKToast("当前已经是最新版本!"); } } diff --git a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart index 757bcd9..d7299b2 100644 --- a/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart +++ b/circle_app/lib/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart @@ -454,6 +454,8 @@ class _TIMTextFieldLayoutNarrowState _buildRepliedMessage(widget.repliedMessage), Stack( children: [ + + Container( decoration: BoxDecoration( borderRadius: BorderRadius.only( @@ -468,26 +470,26 @@ class _TIMTextFieldLayoutNarrowState children: [ Container( padding: - EdgeInsets.symmetric(vertical: 8, horizontal: 12.sp), + EdgeInsets.symmetric(vertical: 8, horizontal: 12.sp), constraints: const BoxConstraints(minHeight: 30), child: Row( children: [ if (widget.forbiddenText != null) Expanded( child: Container( - height: 35, - color: theme.weakBackgroundColor, - alignment: Alignment.center, - child: Text( - TIM_t(widget.forbiddenText!), - textAlign: TextAlign.center, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: theme.weakTextColor, - ), - ), - )), + height: 35, + color: theme.weakBackgroundColor, + alignment: Alignment.center, + child: Text( + TIM_t(widget.forbiddenText!), + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: theme.weakTextColor, + ), + ), + )), if (PlatformUtils().isMobile && widget.showSendAudio && widget.forbiddenText == null) @@ -531,7 +533,7 @@ class _TIMTextFieldLayoutNarrowState padding: EdgeInsets.symmetric( vertical: 8, horizontal: 12.sp), constraints: - const BoxConstraints(minHeight: 30), + const BoxConstraints(minHeight: 30), decoration: BoxDecoration( color: Color(0x1AFFFFFF), borderRadius: BorderRadius.circular(26.sp), @@ -542,91 +544,91 @@ class _TIMTextFieldLayoutNarrowState Expanded( child: showSendSoundText ? TIMSendSoundMessage( - onDownBottom: - widget.goDownBottom, - conversationID: - widget.conversationID, - conversationType: - widget.conversationType) + onDownBottom: + widget.goDownBottom, + conversationID: + widget.conversationID, + conversationType: + widget.conversationType) : KeyboardVisibility( - child: ExtendedTextField( - style: TextStyle( - color: Colors.white, - fontSize: 14.sp), - maxLines: 4, - minLines: 1, - focusNode: widget.focusNode, - onChanged: debounceFunc, - onTap: () { - showKeyboard = true; - widget.goDownBottom(); - setState(() { - showEmojiPanel = false; - showMore = false; - }); - }, - keyboardType: - TextInputType.multiline, - textInputAction: - PlatformUtils() - .isAndroid - ? TextInputAction - .newline - : TextInputAction - .send, - onEditingComplete: () { - widget.onSubmitted(); - if (showKeyboard) { - widget.focusNode - .requestFocus(); - } - setState(() { - if (widget - .textEditingController - .text - .isEmpty) { - showMoreButton = true; - } - }); - }, - textAlignVertical: - TextAlignVertical.top, - decoration: InputDecoration( - border: InputBorder.none, - hintStyle: TextStyle( - fontSize: 14.sp, - color: - Color(0xB3FFFFFF), - ), - hintText: widget.hintText, - fillColor: - Colors.transparent, - filled: true, - isDense: true, - ), - controller: widget - .textEditingController, - specialTextSpanBuilder: - PlatformUtils().isWeb - ? null - : DefaultSpecialTextSpanBuilder( - isUseDefaultEmoji: - widget - .isUseDefaultEmoji, - customEmojiStickerList: - widget - .customEmojiStickerList, - showAtBackground: - true, - )), - onChanged: (bool visibility) { - if (showKeyboard != - visibility) { - setState(() { - showKeyboard = visibility; - }); + child: ExtendedTextField( + style: TextStyle( + color: Colors.white, + fontSize: 14.sp), + maxLines: 4, + minLines: 1, + focusNode: widget.focusNode, + onChanged: debounceFunc, + onTap: () { + showKeyboard = true; + widget.goDownBottom(); + setState(() { + showEmojiPanel = false; + showMore = false; + }); + }, + keyboardType: + TextInputType.multiline, + textInputAction: + PlatformUtils() + .isAndroid + ? TextInputAction + .newline + : TextInputAction + .send, + onEditingComplete: () { + widget.onSubmitted(); + if (showKeyboard) { + widget.focusNode + .requestFocus(); } - }), + setState(() { + if (widget + .textEditingController + .text + .isEmpty) { + showMoreButton = true; + } + }); + }, + textAlignVertical: + TextAlignVertical.top, + decoration: InputDecoration( + border: InputBorder.none, + hintStyle: TextStyle( + fontSize: 14.sp, + color: + Color(0xB3FFFFFF), + ), + hintText: widget.hintText, + fillColor: + Colors.transparent, + filled: true, + isDense: true, + ), + controller: widget + .textEditingController, + specialTextSpanBuilder: + PlatformUtils().isWeb + ? null + : DefaultSpecialTextSpanBuilder( + isUseDefaultEmoji: + widget + .isUseDefaultEmoji, + customEmojiStickerList: + widget + .customEmojiStickerList, + showAtBackground: + true, + )), + onChanged: (bool visibility) { + if (showKeyboard != + visibility) { + setState(() { + showKeyboard = visibility; + }); + } + }), ), if (widget.forbiddenText == null) const SizedBox( @@ -677,7 +679,7 @@ class _TIMTextFieldLayoutNarrowState Container( height: 40.sp, width: Get.width, - margin: EdgeInsets.only(bottom: showEmojiPanel ? Platform.isIOS ? 40.sp : 10.sp : 0), + margin: EdgeInsets.only(bottom: showEmojiPanel ? Platform.isIOS ? 0.sp : 10.sp : 0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ @@ -701,7 +703,7 @@ class _TIMTextFieldLayoutNarrowState }); } else { var data = - await Permission.microphone.request(); + await Permission.microphone.request(); if (data.isGranted) { setState(() { showEmojiPanel = false; @@ -731,7 +733,7 @@ class _TIMTextFieldLayoutNarrowState getImageFile(); }, child: - Image.asset(getMsgImage('photo'), width: 40.sp), + Image.asset(getMsgImage('photo'), width: 40.sp), ), GestureDetector( onTap: () { @@ -772,9 +774,9 @@ class _TIMTextFieldLayoutNarrowState AnimatedContainer( duration: Duration( milliseconds: - (showKeyboard && PlatformUtils().isAndroid) - ? 200 - : 340), + (showKeyboard && PlatformUtils().isAndroid) + ? 200 + : 340), curve: Curves.fastOutSlowIn, height: max(_getBottomHeight(), 0.0), // child: ListView( @@ -786,7 +788,7 @@ class _TIMTextFieldLayoutNarrowState ), ), Positioned( - bottom: MediaQuery.of(context).padding.bottom + 20, + bottom:0, child: AnimatedContainer( duration: Duration( milliseconds: (showKeyboard && PlatformUtils().isAndroid) @@ -800,7 +802,7 @@ class _TIMTextFieldLayoutNarrowState children: [_getBottomContainer()], ), ), - ) + ), ], ) ], diff --git a/circle_app/lib/app/chat/view.dart b/circle_app/lib/app/chat/view.dart index bd537d2..db619ba 100644 --- a/circle_app/lib/app/chat/view.dart +++ b/circle_app/lib/app/chat/view.dart @@ -114,12 +114,12 @@ class _ChatPageState extends State { return TIMChat( conversation: Get.arguments, customStickerPanel: renderCustomStickerPanel, - onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{ - var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: userId.toString().split('_').last); - // setState(() { - // - // }); - }, + // onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{ + // var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: userId.toString().split('_').last,preventDuplicates: false); + // // setState(() { + // // + // // }); + // }, controller : _timuiKitChatController, config: TIMUIKitChatConfig( @@ -171,7 +171,7 @@ class _ChatPageState extends State { centerTitle: con.showName! ?? '', actionWdiget: GestureDetector( onTap: () async{ - var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last); + var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last,preventDuplicates: false); }, child: Text('TA的主页',style: TextStyle(color: const Color(0xFF00FFF4),fontSize:12.sp,fontWeight: FontWeight.w500),), @@ -190,7 +190,9 @@ class _ChatPageState extends State { print(url); return GestureDetector( onTap: () async { - var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: message.sender!.toString().split('_').last); + // V2TimConversation con = Get.arguments; + // if (message.sender == con.userID.toString()) return; + var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: message.sender!.toString().split('_').last,preventDuplicates: false); }, child: Stack( alignment: Alignment.center, diff --git a/circle_app/lib/app/dialog/UpdateDialog.dart b/circle_app/lib/app/dialog/UpdateDialog.dart index bdd1479..721370e 100644 --- a/circle_app/lib/app/dialog/UpdateDialog.dart +++ b/circle_app/lib/app/dialog/UpdateDialog.dart @@ -2,7 +2,7 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - import 'package:flutter_install_app/flutter_install_app.dart'; + // import 'package:flutter_install_app/flutter_install_app.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -260,7 +260,7 @@ class _CustomDialogState extends State { // SmartDialog.dismiss(); print(error); }); - await AppInstaller.installApk(filePath, actionRequired: false); + // await AppInstaller.installApk(filePath, actionRequired: false); } } diff --git a/circle_app/lib/app/splash/logic.dart b/circle_app/lib/app/splash/logic.dart index 3705e25..325b699 100644 --- a/circle_app/lib/app/splash/logic.dart +++ b/circle_app/lib/app/splash/logic.dart @@ -25,31 +25,29 @@ class SplashLogic extends GetxController { void onReady() async { // TODO: implement onReady super.onReady(); + loadConfig(); + checkStatus(); } - @override - void onInit() { - super.onInit(); - // await Future.delayed(Duration(seconds: 30)); + loadConfig() async { + var data1 = + await DioManager.instance.get(url: Api.getCircleList, params: {}); + var bean1 = BaseResponse.fromJson( + data1, (data1) => ConfigBean.fromJson(data1)); + if (bean1.code == 200) { + configBean = bean1.data!; - // var data1 = - // await DioManager.instance.get(url: Api.getCircleList, params: {}); - // var bean1 = BaseResponse.fromJson( - // data1, (data1) => ConfigBean.fromJson(data1)); - // if (bean1.code == 200) { - // configBean = bean1.data!; - // - // configBean.genderMap.forEach((key, value) { - // genderList.add(value); - // }); - // - // configBean.orientationMap.forEach((key, value) { - // orientationList.add(value); - // }); - // configBean.roleMap.forEach((key, value) { - // roleList.add(value); - // }); - // } + configBean.genderMap.forEach((key, value) { + genderList.add(value); + }); + + configBean.orientationMap.forEach((key, value) { + orientationList.add(value); + }); + configBean.roleMap.forEach((key, value) { + roleList.add(value); + }); + } } checkStatus() async { diff --git a/circle_app/lib/app/userinfo/view.dart b/circle_app/lib/app/userinfo/view.dart index 053f6a2..a37b173 100644 --- a/circle_app/lib/app/userinfo/view.dart +++ b/circle_app/lib/app/userinfo/view.dart @@ -51,9 +51,6 @@ class MyTabbedScreenState extends State @override void dispose() { _tabController.dispose(); - if (OverlayClass.overlayEntry != null) { - OverlayClass.overlayEntry!.remove(); - } super.dispose(); } diff --git a/circle_app/lib/main.dart b/circle_app/lib/main.dart index 73ddf41..dcb586c 100644 --- a/circle_app/lib/main.dart +++ b/circle_app/lib/main.dart @@ -15,6 +15,7 @@ import 'package:circle_app/util/util.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bugly/flutter_bugly.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; @@ -503,6 +504,7 @@ class _MyAppState extends State with WidgetsBindingObserver { const TextStyle(fontSize: 19.0, color: Colors.white), backgroundColor: Colors.grey, animationCurve: Curves.easeIn, + // animationBuilder: const Miui10AnimBuilder(), animationDuration: const Duration(milliseconds: 200), duration: const Duration(seconds: 2), @@ -510,6 +512,17 @@ class _MyAppState extends State with WidgetsBindingObserver { title: '微乐园', initialBinding: SplashBinding(), getPages: AppPages.routes, + /// 国际化处理 + localizationsDelegates: const [ + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, /// iOS一定要设置,不然报错 + ], + locale: const Locale('zh', 'CN'), + supportedLocales : const [ + Locale('zh', 'CN'), + Locale('en', 'US'), + ], home: SplashPage(), builder: FlutterSmartDialog.init(), debugShowCheckedModeBanner: false, diff --git a/circle_app/lib/view/notice.dart b/circle_app/lib/view/notice.dart index c7521f5..617033c 100644 --- a/circle_app/lib/view/notice.dart +++ b/circle_app/lib/view/notice.dart @@ -6,9 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; typedef void NoticeCallback(); - class OverlayClass { - static OverlayEntry? overlayEntry; -} + void showFloatingButtonOverlay( BuildContext context, String nickname, String ageMsg, String avatar,int event,NoticeCallback noticeCallback) { @@ -22,7 +20,7 @@ void showFloatingButtonOverlay( late Timer countdownTimer; // 创建 OverlayEntry - OverlayClass.overlayEntry = OverlayEntry( + overlayEntry = OverlayEntry( builder: (BuildContext context) { return Positioned( top: 30, @@ -119,11 +117,7 @@ void showFloatingButtonOverlay( GestureDetector( onTap: () { countdownTimer.cancel(); // 取消计时器 - try { - OverlayClass.overlayEntry!.remove(); - } catch (e) { - - } + overlayEntry!.remove(); noticeCallback(); // logic.setLike(); @@ -180,14 +174,9 @@ void showFloatingButtonOverlay( } else { timer.cancel(); // 取消计时器 - - try { - OverlayClass.overlayEntry!.remove(); - } catch (e) { - - } + overlayEntry!.remove(); } }); // 将 OverlayEntry 添加到 Overlay 中 - overlayState?.insert(OverlayClass.overlayEntry!); + overlayState?.insert(overlayEntry!); } diff --git a/circle_app/pubspec.lock b/circle_app/pubspec.lock index c71ea3a..0ddb926 100644 --- a/circle_app/pubspec.lock +++ b/circle_app/pubspec.lock @@ -606,14 +606,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.3" - flutter_install_app: - dependency: "direct main" - description: - name: flutter_install_app - sha256: "9b117006d17c900e671c26bcbc9b15c7b8efd15d6f9b4442ad5d576de20fab53" - url: "https://pub.dev" - source: hosted - version: "1.3.0" flutter_intl: dependency: "direct main" description: @@ -646,6 +638,11 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.0" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" flutter_luban: dependency: "direct main" description: diff --git a/circle_app/pubspec.yaml b/circle_app/pubspec.yaml index d5e1e71..2be09f0 100644 --- a/circle_app/pubspec.yaml +++ b/circle_app/pubspec.yaml @@ -31,6 +31,8 @@ dependencies: flutter: sdk: flutter + flutter_localizations: # 国际化处理 + sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. @@ -93,7 +95,7 @@ dependencies: #event_bus: event_bus: ^2.0.0 #安装apk - flutter_install_app: 1.3.0 +# flutter_install_app: 1.3.0 #闪屏页 flutter_native_splash: 2.2.16 #腾讯离线推送