更换Toast第三方,修改表单bug

This commit is contained in:
CYH 2023-08-10 12:23:28 +03:00
parent 59c0969691
commit 613660f1ce
46 changed files with 483 additions and 407 deletions

View File

@ -360,7 +360,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = C97QBVP4DP; DEVELOPMENT_TEAM = C39VUKAY2Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "微乐园"; INFOPLIST_KEY_CFBundleDisplayName = "微乐园";
@ -381,7 +381,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.0; MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp123;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -508,7 +508,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = C97QBVP4DP; DEVELOPMENT_TEAM = C39VUKAY2Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "微乐园"; INFOPLIST_KEY_CFBundleDisplayName = "微乐园";
@ -529,7 +529,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.0; MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp123;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -550,7 +550,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = C97QBVP4DP; DEVELOPMENT_TEAM = C39VUKAY2Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "微乐园"; INFOPLIST_KEY_CFBundleDisplayName = "微乐园";
@ -571,7 +571,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.0; MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.circleApp123;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;

View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict/>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist> </plist>

View File

@ -55,7 +55,7 @@ class BlacklistLogic extends GetxController {
initList(); initList();
update(); update();
} }
showToast(bean.msg); showOKToast(bean.msg);
} }
} }

View File

@ -73,7 +73,7 @@ class Call_outLogic extends GetxController {
if (bean.isSuccess()) { if (bean.isSuccess()) {
configBean = bean.data!; configBean = bean.data!;
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
var quniuData = var quniuData =
@ -100,28 +100,28 @@ class Call_outLogic extends GetxController {
sendShout() async { sendShout() async {
if (numbers.isEmpty) { if (numbers.isEmpty) {
showToast("请选择要喊话的圈子。"); showOKToast("请选择要喊话的圈子。");
return; return;
} }
if (textEditingController.text.isEmpty) { if (textEditingController.text.isEmpty) {
showToast("请输入喊话内容"); showOKToast("请输入喊话内容");
return; return;
} }
if (state.imaglist.isEmpty && state.videolist.isEmpty) { if (state.imaglist.isEmpty && state.videolist.isEmpty) {
if (textEditingController.text.length < 10) { if (textEditingController.text.length < 10) {
showToast("您当前未添加图片或视频请至少输入10字喊话内容。"); showOKToast("您当前未添加图片或视频请至少输入10字喊话内容。");
return; return;
} }
} else { } else {
if (!state.imaglist.isEmpty) { if (!state.imaglist.isEmpty) {
if (textEditingController.text.length < 5) { if (textEditingController.text.length < 5) {
showToast("请至少输入5个字内容"); showOKToast("请至少输入5个字内容");
return; return;
} }
} }
if (!state.videolist.isEmpty) { if (!state.videolist.isEmpty) {
if (textEditingController.text.length < 5) { if (textEditingController.text.length < 5) {
showToast("请至少输入5个字内容"); showOKToast("请至少输入5个字内容");
return; return;
} }
} }
@ -151,7 +151,7 @@ class Call_outLogic extends GetxController {
); );
SmartDialog.dismiss(); SmartDialog.dismiss();
if (beandata.isSuccess()) { if (beandata.isSuccess()) {
showToast(beandata.msg); showOKToast(beandata.msg);
final logic = Get.put(CircleLogic()); final logic = Get.put(CircleLogic());
logic.setCircle(numbers[0].id); logic.setCircle(numbers[0].id);
logic.refresh(); logic.refresh();
@ -162,7 +162,7 @@ class Call_outLogic extends GetxController {
// if (beandata.data == null) { // if (beandata.data == null) {
// return; // return;
// } // }
showToast(beandata.msg); showOKToast(beandata.msg);
var callOutBean = BaseResponse<List<String>>.fromJson( var callOutBean = BaseResponse<List<String>>.fromJson(
data, data,
(jsonData) => List<String>.from(jsonData), (jsonData) => List<String>.from(jsonData),
@ -194,7 +194,7 @@ class Call_outLogic extends GetxController {
UnlockCallDialog().showUnlockBottomSheet(numbers[0].id); UnlockCallDialog().showUnlockBottomSheet(numbers[0].id);
// tipWdiget() // tipWdiget()
} else { } else {
showToast(beandata.msg); showOKToast(beandata.msg);
} }
} }
@ -218,11 +218,11 @@ class Call_outLogic extends GetxController {
showImg() async { showImg() async {
try { try {
if (state.videolist.length != 0) { if (state.videolist.length != 0) {
showToast("已添加视频,无法添加图片。"); showOKToast("已添加视频,无法添加图片。");
return; return;
} }
if (state.imaglist.length == 6) { if (state.imaglist.length == 6) {
showToast("最多上传6张图片哦~"); showOKToast("最多上传6张图片哦~");
return; return;
} }
final XFile? pickedFile = await _picker.pickImage( final XFile? pickedFile = await _picker.pickImage(
@ -268,11 +268,11 @@ class Call_outLogic extends GetxController {
showVideo() async { showVideo() async {
if (state.imaglist.length != 0) { if (state.imaglist.length != 0) {
showToast("已添加图片,无法添加视频。"); showOKToast("已添加图片,无法添加视频。");
return; return;
} }
if (state.videolist.length != 0) { if (state.videolist.length != 0) {
showToast("最多上传1个视频哦~"); showOKToast("最多上传1个视频哦~");
return; return;
} }
@ -309,7 +309,7 @@ class Call_outLogic extends GetxController {
}); });
} else { } else {
SmartDialog.dismiss(); SmartDialog.dismiss();
showToast("请上传5-30秒的视频当前视频长度为:$durationInSeconds" ""); showOKToast("请上传5-30秒的视频当前视频长度为:$durationInSeconds" "");
} }
} catch (e) {} } catch (e) {}

View File

@ -181,7 +181,7 @@ class Call_outPage extends StatelessWidget {
controller.isCheck = !controller.isCheck; controller.isCheck = !controller.isCheck;
controller.update(); controller.update();
}else{ }else{
showToast("至尊喊话为年会员特权,开通年会员即可享受哦~"); showOKToast("至尊喊话为年会员特权,开通年会员即可享受哦~");
controller.showRechargeDialog(); controller.showRechargeDialog();
} }

View File

@ -266,7 +266,7 @@ bool isSendLoging = false;
return; return;
} }
if (isBlack) { if (isBlack) {
showToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
lastText = ""; lastText = "";
@ -275,7 +275,7 @@ bool isSendLoging = false;
if (text.isEmpty) { if (text.isEmpty) {
if (hintText.contains('说些什么吧~')) { if (hintText.contains('说些什么吧~')) {
showToast('请输入消息内容后发送'); showOKToast('请输入消息内容后发送');
return; return;
} else { } else {
if ((widget.currentConversation.lastMessage?.customElem ?? null) != if ((widget.currentConversation.lastMessage?.customElem ?? null) !=
@ -303,7 +303,7 @@ bool isSendLoging = false;
} }
} }
} else { } else {
showToast('请输入消息内容后发送'); showOKToast('请输入消息内容后发送');
} }
} }
@ -354,7 +354,7 @@ bool isSendLoging = false;
goDownBottom(); goDownBottom();
_handleSendEditStatus("", false); _handleSendEditStatus("", false);
} else { } else {
showToast('请输入消息内容'); showOKToast('请输入消息内容');
} }
} }

View File

@ -2,6 +2,10 @@ import 'dart:async';
import 'dart:math'; import 'dart:math';
import 'package:circle_app/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart'; import 'package:circle_app/app/chat/TIMUIKitChat/TIMUIKitTextField/tim_uikit_send_sound_message.dart';
import 'package:circle_app/app/minefragment/logic.dart';
import 'package:circle_app/common/Widgets/open_vip_tip/view.dart';
import 'package:circle_app/network/api.dart';
import 'package:circle_app/network/dio_manager.dart';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -150,6 +154,7 @@ class _TIMTextFieldLayoutNarrowState
final TUISettingModel settingModel = serviceLocator<TUISettingModel>(); final TUISettingModel settingModel = serviceLocator<TUISettingModel>();
final ImagePicker _picker = ImagePicker(); final ImagePicker _picker = ImagePicker();
bool isVip = false;
bool showMore = false; bool showMore = false;
bool showMoreButton = true; bool showMoreButton = true;
bool showSendSoundText = false; bool showSendSoundText = false;
@ -513,7 +518,8 @@ class _TIMTextFieldLayoutNarrowState
Stack( Stack(
children: [ children: [
Container( Container(
width: 296.sp, width: Get.width - 80.sp,
// width: 296.sp,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 8, horizontal: 12.sp), vertical: 8, horizontal: 12.sp),
constraints: constraints:
@ -669,7 +675,7 @@ class _TIMTextFieldLayoutNarrowState
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
if (isBlack) { if (isBlack) {
showToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
showKeyboard = showSendSoundText; showKeyboard = showSendSoundText;
@ -708,7 +714,7 @@ class _TIMTextFieldLayoutNarrowState
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (isBlack) { if (isBlack) {
showToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
getImageFile(); getImageFile();
@ -719,7 +725,7 @@ class _TIMTextFieldLayoutNarrowState
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (isBlack) { if (isBlack) {
showToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
getTakeImageFile(); getTakeImageFile();
@ -768,7 +774,38 @@ class _TIMTextFieldLayoutNarrowState
); );
} }
Future checkVipStatus() async {
if (!isVip) {
var data = await DioManager.instance.get(url: Api.getUserMine);
var bean = BaseResponse<MineResponseBean>.fromJson(
data, (data) => MineResponseBean.fromJson(data));
if (bean.isSuccess()) {
User userInfoBean = bean.data.user!;
isVip = userInfoBean.vip > 0;
}
}
if (!isVip) {
showOKToast('开通会员之后才能发送图片');
Get.bottomSheet(
Scaffold(
backgroundColor: Colors.transparent,
body: Open_vip_tipPage(false),
),
isScrollControlled: true,
enableDrag: false);
return false;
}
return isVip;
}
Future getImageFile() async { Future getImageFile() async {
bool isOK = await checkVipStatus();
if (!isOK) {
return;
}
try { try {
final XFile? pickedFile = await _picker.pickImage( final XFile? pickedFile = await _picker.pickImage(
source: ImageSource.gallery, source: ImageSource.gallery,
@ -787,6 +824,12 @@ class _TIMTextFieldLayoutNarrowState
} }
Future getTakeImageFile() async { Future getTakeImageFile() async {
bool isOK = await checkVipStatus();
if (!isOK) {
return;
}
try { try {
final XFile? pickedFile = await _picker.pickImage( final XFile? pickedFile = await _picker.pickImage(
source: ImageSource.camera, source: ImageSource.camera,

View File

@ -124,7 +124,7 @@ class _ChatPageState extends State<ChatPage> {
], ],
), ),
customAppBar:MyAppBar( customAppBar:MyAppBar(
centerTitle: con.showName!, centerTitle: con.showName! ?? '',
actionWdiget: GestureDetector( actionWdiget: GestureDetector(
onTap: () async{ 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);

View File

@ -69,7 +69,7 @@ class CircleLogic extends GetxController {
} }
}); });
} }
showToast(bean.msg); showOKToast(bean.msg);
} }
updateCircleInfo(Circle circleInfo) { updateCircleInfo(Circle circleInfo) {
@ -122,7 +122,7 @@ class CircleLogic extends GetxController {
await sendTextMsg(data['data']['account_id']); await sendTextMsg(data['data']['account_id']);
} }
} else { } else {
showToast(data['msg']); showOKToast(data['msg']);
} }
} }

View File

@ -77,7 +77,7 @@ class _CirclePageState extends State<CirclePage>
itemCount: logic.circle.lists.length, itemCount: logic.circle.lists.length,
viewportFraction: 0.93, viewportFraction: 0.93,
// scale: 0.9, // scale: 0.9,
loop: false, loop: false,
key: UniqueKey(), key: UniqueKey(),
// pagination: new SwiperPagination(),// // pagination: new SwiperPagination(),//
// control: new SwiperControl(),// // control: new SwiperControl(),//

View File

@ -51,7 +51,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
void dispose() { void dispose() {
// TODO: implement dispose // TODO: implement dispose
super.dispose(); super.dispose();
widget.scrollController.dispose(); // widget.scrollController.dispose();
} }
@ -97,7 +97,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
setState(() {}); setState(() {});
} }
} else { } else {
showToast(data["msg"]); showOKToast(data["msg"]);
} }
} }
@ -169,7 +169,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
var sp = await SharedPreferencesHelper.getInstance(); var sp = await SharedPreferencesHelper.getInstance();
String myUserId = sp.getMyUserId(); String myUserId = sp.getMyUserId();
if (bean.user!.id.toString() == myUserId) { if (bean.user!.id.toString() == myUserId) {
showToast('无法与自己私聊'); showOKToast('无法与自己私聊');
return; return;
} }
// if () // if ()
@ -253,12 +253,11 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
margin: EdgeInsets.only(bottom: 7.sp), margin: EdgeInsets.only(bottom: 7.sp),
width: Get.width, width: Get.width,
height: 30.sp, height: 30.sp,
child: HideText(text: widget.bean.intro,additionText: '查看更多',maxLines: 2,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () { child: HideText(text: widget.bean.intro,additionText: '查看更多',maxLines: 1,style: TextStyle(color: Colors.white, fontSize: 10.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 10.sp),onTap: () {
_showTextContentDialog( _showTextContentDialog(
context, widget.bean.intro); context, widget.bean.intro);
},), },
)),
),
GestureDetector( GestureDetector(
behavior:HitTestBehavior.opaque, behavior:HitTestBehavior.opaque,
@ -450,6 +449,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
padding: const EdgeInsets.all(1.0), padding: const EdgeInsets.all(1.0),
child: Stack( child: Stack(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -486,7 +486,19 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
color: const Color(0xCCF7FAFA), fontSize: 16.sp), color: const Color(0xCCF7FAFA), fontSize: 16.sp),
),), ),),
), ),
) ),
Positioned(
top:8.sp,
right: 10.sp,
child: GestureDetector(
onTap: () {
Get.back();
},
child: Icon(
Icons.close,color: Colors.white,
size: 20.sp,
),
)),
], ],
), ),
), ),

View File

@ -39,7 +39,7 @@ class ListLogic extends GetxController {
callOutMore = dataList.length == 20; callOutMore = dataList.length == 20;
update(); update();
} else { } else {
showToast(data["msg"]); showOKToast(data["msg"]);
} }
} }

View File

@ -2,6 +2,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// import 'package:flutter_install_app/flutter_install_app.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart'; import 'package:get/get_core/src/get_main.dart';

View File

@ -245,7 +245,7 @@ class UnlockCallDialog extends GetxController {
Get.back(); Get.back();
}); });
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
} else { } else {
var data = await DioManager.instance.post( var data = await DioManager.instance.post(
@ -258,7 +258,7 @@ class UnlockCallDialog extends GetxController {
Get.back(); Get.back();
}); });
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
} }
SmartDialog.dismiss(); SmartDialog.dismiss();

View File

@ -68,7 +68,7 @@ class FeedbackLogic extends GetxController {
'type':1 'type':1
}); });
var bean = BaseResponse<dynamic>.fromJson(data, (jsonData) => jsonData,); var bean = BaseResponse<dynamic>.fromJson(data, (jsonData) => jsonData,);
showToast(bean.msg); showOKToast(bean.msg);
if(bean.isSuccess()){ if(bean.isSuccess()){
Get.back(); Get.back();
} }

View File

@ -56,7 +56,7 @@ class FriendslistLogic extends GetxController {
lists[index].isLike = !lists[index].isLike; lists[index].isLike = !lists[index].isLike;
update(); update();
} }
showToast(bean.msg); showOKToast(bean.msg);
} }
} }

View File

@ -65,7 +65,7 @@ class LikelistLogic extends GetxController {
lists[index].isLike = !lists[index].isLike; lists[index].isLike = !lists[index].isLike;
update(); update();
} }
showToast(bean.msg); showOKToast(bean.msg);
} }
} }

View File

@ -68,7 +68,7 @@ class Complete_materialLogic extends GetxController {
update(); update();
// state.nickName = userInfoBean!.nickname; // state.nickName = userInfoBean!.nickname;
}else{ }else{
showToast(bean.msg); showOKToast(bean.msg);
} }
} }
@ -124,41 +124,41 @@ class Complete_materialLogic extends GetxController {
checkInfo() async { checkInfo() async {
if (state.textEditingController.text.isEmpty) { if (state.textEditingController.text.isEmpty) {
showToast('请输入您的昵称'); showOKToast('请输入您的昵称');
return; return;
} else if(state.textEditingController.text.length<2){ } else if(state.textEditingController.text.length<2){
showToast('昵称不能低于两个字'); showOKToast('昵称不能低于两个字');
return; return;
} else if(state.textEditingController.text.length>6){ } else if(state.textEditingController.text.length>6){
showToast('昵称最多输入6个字'); showOKToast('昵称最多输入6个字');
return; return;
}else if (state.sex.isEmpty) { }else if (state.sex.isEmpty) {
showToast('请选择您的属性'); showOKToast('请选择您的属性');
return; return;
} else if (state.age.isEmpty) { } else if (state.age.isEmpty) {
showToast('请选择您的年龄'); showOKToast('请选择您的年龄');
return; return;
} else if (state.role.isEmpty) { } else if (state.role.isEmpty) {
showToast('请选择您的角色'); showOKToast('请选择您的角色');
return; return;
} else if (state.role.isEmpty) { } else if (state.role.isEmpty) {
showToast('请选择您的角色'); showOKToast('请选择您的角色');
return; return;
} else if (state.orientation.isEmpty) { } else if (state.orientation.isEmpty) {
showToast('请选择您的取向'); showOKToast('请选择您的取向');
return; return;
} else if (numbers.isEmpty) { } else if (numbers.isEmpty) {
showToast('请选择您的兴趣'); showOKToast('请选择您的兴趣');
// return; // return;
} else if (state.descEditingController.text.isEmpty) { } else if (state.descEditingController.text.isEmpty) {
showToast('请输入您的交友宣言'); showOKToast('请输入您的交友宣言');
return; return;
} else if (state.descEditingController.text.length < 5) { } else if (state.descEditingController.text.length < 5) {
showToast('您的交友宣言太短'); showOKToast('您的交友宣言太短');
return; return;
} }
if (headUrl == '') { if (headUrl == '') {
showToast('请上传头像'); showOKToast('请上传头像');
return; return;
} }
// LatLng location = await getLocation(); // LatLng location = await getLocation();
@ -182,44 +182,44 @@ class Complete_materialLogic extends GetxController {
if (bean.code == 200) { if (bean.code == 200) {
Get.offAllNamed(AppRoutes.Home); Get.offAllNamed(AppRoutes.Home);
}else{ }else{
showToast(bean.msg); showOKToast(bean.msg);
} }
} }
editInfo() async { editInfo() async {
if (state.textEditingController.text.isEmpty) { if (state.textEditingController.text.isEmpty) {
showToast('请输入您的昵称'); showOKToast('请输入您的昵称');
return; return;
} else if(state.textEditingController.text.length>6){ } else if(state.textEditingController.text.length>6){
showToast('昵称最多输入6个字'); showOKToast('昵称最多输入6个字');
return; return;
}else if (state.sex.isEmpty) { }else if (state.sex.isEmpty) {
showToast('请选择您的属性'); showOKToast('请选择您的属性');
return; return;
} else if (state.age.isEmpty) { } else if (state.age.isEmpty) {
showToast('请选择您的年龄'); showOKToast('请选择您的年龄');
return; return;
} else if (state.role.isEmpty) { } else if (state.role.isEmpty) {
showToast('请选择您的角色'); showOKToast('请选择您的角色');
return; return;
} else if (state.role.isEmpty) { } else if (state.role.isEmpty) {
showToast('请选择您的角色'); showOKToast('请选择您的角色');
return; return;
} else if (state.orientation.isEmpty) { } else if (state.orientation.isEmpty) {
showToast('请选择您的取向'); showOKToast('请选择您的取向');
return; return;
} else if (numbers.isEmpty) { } else if (numbers.isEmpty) {
showToast('请选择您的兴趣'); showOKToast('请选择您的兴趣');
// return; // return;
} else if (state.descEditingController.text.isEmpty) { } else if (state.descEditingController.text.isEmpty) {
showToast('请输入您的交友宣言'); showOKToast('请输入您的交友宣言');
return; return;
} else if (state.descEditingController.text.length < 5) { } else if (state.descEditingController.text.length < 5) {
showToast('您的交友宣言太短'); showOKToast('您的交友宣言太短');
return; return;
} }
if (headUrl == '') { if (headUrl == '') {
showToast('请上传头像'); showOKToast('请上传头像');
return; return;
} }
//TODO //TODO
@ -255,7 +255,7 @@ class Complete_materialLogic extends GetxController {
}else{ }else{
showToast(bean.msg); showOKToast(bean.msg);
} }
} }

View File

@ -60,7 +60,7 @@ class LoginLogic extends GetxController {
var data = await DioManager.instance.post( var data = await DioManager.instance.post(
url: Api.sendCode, params: {"phone": phoneEditingController.text}); url: Api.sendCode, params: {"phone": phoneEditingController.text});
var bean = BaseResponse<Data>.fromJson(data, (data) => Data.fromJson(data)); var bean = BaseResponse<Data>.fromJson(data, (data) => Data.fromJson(data));
showToast(bean.msg); showOKToast(bean.msg);
if (bean.code == 200) { if (bean.code == 200) {
if (kDebugMode) { if (kDebugMode) {
print("验证码:${bean.data!.code}"); print("验证码:${bean.data!.code}");
@ -88,16 +88,16 @@ class LoginLogic extends GetxController {
void login() async { void login() async {
if (!GetUtils.isPhoneNumber(phoneEditingController.text)) { if (!GetUtils.isPhoneNumber(phoneEditingController.text)) {
showToast('请输入正确的手机号'); showOKToast('请输入正确的手机号');
return; return;
} }
if (codeEditingController.text == '') { if (codeEditingController.text == '') {
showToast('请输入验证码'); showOKToast('请输入验证码');
return; return;
} }
if (!check) { if (!check) {
showToast('请勾选同意用户协议和隐私协议'); showOKToast('请勾选同意用户协议和隐私协议');
return; return;
} }
var data = await DioManager.instance.post(url: Api.login, params: { var data = await DioManager.instance.post(url: Api.login, params: {
@ -127,7 +127,7 @@ class LoginLogic extends GetxController {
Get.offNamed(AppRoutes.Complete_materialPage); Get.offNamed(AppRoutes.Complete_materialPage);
return; return;
} else { } else {
showToast(bean.msg.toString()); showOKToast(bean.msg.toString());
} }
// try { // try {

View File

@ -18,272 +18,278 @@ class LoginPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Stack(
resizeToAvoidBottomInset: false, children: [
body: GestureDetector( Image.asset(
onTap: () { getBaseImage('bg'),
FocusManager.instance.primaryFocus?.unfocus(); fit: BoxFit.fill,
}, width: Get.width,
child: GetBuilder<LoginLogic>(builder: (logic) { height: Get.height,
return Stack( ),
alignment: Alignment.center, Scaffold(
children: [ resizeToAvoidBottomInset: false,
Image.asset( backgroundColor: Colors.transparent,
getBaseImage('bg'), body: GestureDetector(
fit: BoxFit.fill, onTap: () {
width: Get.width, FocusManager.instance.primaryFocus?.unfocus();
height: Get.height, },
), child: GetBuilder<LoginLogic>(builder: (logic) {
Positioned( return Stack(
left: 0, alignment: Alignment.center,
right: 0, children: [
top: 180.sp,
child: Image.asset(getBaseImage("ic_launcher"),width: 120.sp,height: 120.sp,)),
Container( Positioned(
width: Get.width, left: 0,
height: Get.height, right: 0,
child: Column( top: 180.sp,
mainAxisAlignment: MainAxisAlignment.center, child: Image.asset(getBaseImage("ic_launcher"),width: 120.sp,height: 120.sp,)),
children: [
Container(
// margin: EdgeInsets.only(
// top: MediaQuery.of(context).padding.top + 100.sp),
child: Stack(
alignment: Alignment.center,
children: [
Positioned(
bottom: 0,
child: Container( Container(
width: 280.sp, width: Get.width,
height: 50.sp, height: Get.height,
decoration: BoxDecoration( child: Column(
// color: Colors.white60, mainAxisAlignment: MainAxisAlignment.center,
borderRadius: BorderRadius.circular(25.sp), children: [
border: Border.all(color: Colors.white60,width: 0.5.sp) Container(
),)), // margin: EdgeInsets.only(
Row( // top: MediaQuery.of(context).padding.top + 100.sp),
mainAxisAlignment: MainAxisAlignment.center, child: Stack(
alignment: Alignment.center,
children: [ children: [
Text( Positioned(
' +86', bottom: 0,
style: TextStyle(
color: Colors.white, fontSize: 16.sp), child: Container(
), width: 280.sp,
Stack( height: 50.sp,
decoration: BoxDecoration(
// color: Colors.white60,
borderRadius: BorderRadius.circular(25.sp),
border: Border.all(color: Colors.white60,width: 0.5.sp)
),)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Text(
width: 200.sp, ' +86',
child: TextField( style: TextStyle(
onChanged: (msg){ color: Colors.white, fontSize: 16.sp),
if (GetUtils.isPhoneNumber(msg)&& msg.length==11) {
logic.isPhoto = true;
}else{
logic.isPhoto = false;
}
logic.update();
},
controller: logic.phoneEditingController,
keyboardType: TextInputType.phone,
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
FilteringTextInputFormatter.deny(RegExp('[^0-9]')),
],
maxLength: 11,
style: TextStyle(
color: Colors.white, fontSize: 16.sp),
decoration: InputDecoration(
hintText: '请输入手机号',
hintStyle: TextStyle(
color: Colors.white70,
fontSize: 16.sp),
border: InputBorder.none,
counterText: '',
contentPadding: EdgeInsets.only(
left: 16.sp)),
),
), ),
Stack(
], children: [
) Container(
], width: 200.sp,
), child: TextField(
onChanged: (msg){
], if (GetUtils.isPhoneNumber(msg)&& msg.length==11) {
), logic.isPhoto = true;
), }else{
Container( logic.isPhoto = false;
margin: EdgeInsets.only(top: 20.sp), }
child: Stack( logic.update();
alignment: Alignment.center, },
children: [ controller: logic.phoneEditingController,
Positioned( keyboardType: TextInputType.phone,
bottom: 0, inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
child: Container( FilteringTextInputFormatter.deny(RegExp('[^0-9]')),
width: 280.sp, ],
height: 50.sp, maxLength: 11,
decoration: BoxDecoration( style: TextStyle(
// color: Colors.white60, color: Colors.white, fontSize: 16.sp),
borderRadius: BorderRadius.circular(25.sp), decoration: InputDecoration(
border: Border.all(color: Colors.white60,width: 0.5.sp) hintText: '请输入手机号',
),)), hintStyle: TextStyle(
Row( color: Colors.white70,
mainAxisAlignment: MainAxisAlignment.center, fontSize: 16.sp),
children: [ border: InputBorder.none,
Text( counterText: '',
'验证码', contentPadding: EdgeInsets.only(
style: TextStyle( left: 16.sp)),
color: Colors.white, fontSize: 16.sp),
),
Stack(
alignment: Alignment.center,
children: [
SizedBox(
width: 200.sp,
child: TextField(
controller: logic.codeEditingController,
keyboardType: TextInputType.phone,
maxLength: 8,
style: TextStyle(
color: Colors.white, fontSize: 16.sp),
decoration: InputDecoration(
hintText: '请输入验证码',
hintStyle: TextStyle(
color: Colors.white70,
fontSize: 16.sp),
border: InputBorder.none,
counterText: '',
contentPadding: EdgeInsets.only(
left: 16.sp)),
),
),
Positioned(
right: 0,
child: GestureDetector(
onTap: () {
if(logic.isPhoto){
logic.starDownTimer();
}
},
child: Container(
alignment: Alignment.center,
width: 76.sp,
height: 29.sp,
decoration: BoxDecoration(
color:logic.isPhoto ? logic.sendCodeBtn? Colors.white30:const Color(0xff0AFCFF) : Colors.white30,
borderRadius: BorderRadius.circular(
29.sp / 2)
),
child: Text(logic.sendCodeBtn ? '${logic.seconds}s' : '获取验证码', style: TextStyle(
color: logic.isPhoto ? logic.sendCodeBtn? Colors.white:Colors.black : Colors.white, fontSize: 12.sp),),
), ),
)), ),
],
)
], ],
) ),
], ],
), ),
),
Container(
margin: EdgeInsets.only(top: 20.sp),
child: Stack(
alignment: Alignment.center,
children: [
Positioned(
bottom: 0,
], child: Container(
), width: 280.sp,
), height: 50.sp,
decoration: BoxDecoration(
// color: Colors.white60,
borderRadius: BorderRadius.circular(25.sp),
border: Border.all(color: Colors.white60,width: 0.5.sp)
),)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'验证码',
style: TextStyle(
color: Colors.white, fontSize: 16.sp),
),
Stack(
alignment: Alignment.center,
children: [
SizedBox(
width: 200.sp,
child: TextField(
controller: logic.codeEditingController,
keyboardType: TextInputType.phone,
maxLength: 8,
style: TextStyle(
color: Colors.white, fontSize: 16.sp),
decoration: InputDecoration(
hintText: '请输入验证码',
], hintStyle: TextStyle(
), color: Colors.white70,
), fontSize: 16.sp),
Positioned( border: InputBorder.none,
bottom: 182.sp, counterText: '',
child: GestureDetector( contentPadding: EdgeInsets.only(
onTap: () { left: 16.sp)),
logic.login(); ),
}, ),
child: Container( Positioned(
width: 168.sp, right: 0,
height: 42.sp, child: GestureDetector(
alignment: Alignment.center, onTap: () {
decoration: BoxDecoration( if(logic.isPhoto){
borderRadius: BorderRadius.circular(21.sp), logic.starDownTimer();
gradient: const LinearGradient( }
begin: Alignment.centerLeft, },
end: Alignment.centerRight, child: Container(
colors: [Color(0xff0AFCFF), Color(0xffD739EA)])), alignment: Alignment.center,
child: Text( width: 76.sp,
'登录', height: 29.sp,
style: TextStyle(color: Colors.white, fontSize: 16.sp), decoration: BoxDecoration(
color:logic.isPhoto ? logic.sendCodeBtn? Colors.white30:const Color(0xff0AFCFF) : Colors.white30,
borderRadius: BorderRadius.circular(
29.sp / 2)
),
child: Text(logic.sendCodeBtn ? '${logic.seconds}s' : '获取验证码', style: TextStyle(
color: logic.isPhoto ? logic.sendCodeBtn? Colors.white:Colors.black : Colors.white, fontSize: 12.sp),),
),
)),
],
)
],
),
],
),
),
],
), ),
), ),
), Positioned(
), bottom: 182.sp,
Positioned( child: GestureDetector(
bottom: 17.sp + MediaQuery.of(context).padding.bottom, onTap: () {
child: GestureDetector( logic.login();
behavior: HitTestBehavior.opaque, },
onTap: () { child: Container(
logic.check = !logic.check; width: 168.sp,
logic.update(); height: 42.sp,
}, alignment: Alignment.center,
child: Container( decoration: BoxDecoration(
child: Row( borderRadius: BorderRadius.circular(21.sp),
children: [ gradient: const LinearGradient(
!logic.check ? Container(width: 14.sp,height: 14.sp,decoration: BoxDecoration(border: Border.all(color: Colors.white70,width: 1.sp),borderRadius: BorderRadius.circular(10)),): Icon(Icons.check_circle_rounded,size: 15.sp,color: Color(0xff00FFF4),), begin: Alignment.centerLeft,
SizedBox(width: 4.sp,), end: Alignment.centerRight,
Text( colors: [Color(0xff0AFCFF), Color(0xffD739EA)])),
'同意', child: Text(
style: TextStyle( '登录',
color: Colors.white, style: TextStyle(color: Colors.white, fontSize: 16.sp),
fontSize: 11.sp, ),
fontWeight: FontWeight.w600),
),
SizedBox(
width: 2.sp,
),
GestureDetector(
onTap: (){
navigateToUserAgreement();
},
child: Text(
'《用户协议》',
style: TextStyle(
color: Color(0xff00FFF4),
fontSize: 11.sp,
fontWeight: FontWeight.w400,
),
),
),
Text(
'',
style: TextStyle(
color: Colors.white,
fontSize: 11.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
width: 2.sp,
),
GestureDetector(
onTap: (){
navigateToPrivacyPolicy();
},
child: Text(
'《隐私协议》',
style: TextStyle(
color: Color(0xff00FFF4),
fontSize: 11.sp,
fontWeight: FontWeight.w400,
),
),
),
],
), ),
), ),
)) ),
Positioned(
bottom: 17.sp + MediaQuery.of(context).padding.bottom,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
logic.check = !logic.check;
logic.update();
},
child: Container(
child: Row(
children: [
!logic.check ? Container(width: 14.sp,height: 14.sp,decoration: BoxDecoration(border: Border.all(color: Colors.white70,width: 1.sp),borderRadius: BorderRadius.circular(10)),): Icon(Icons.check_circle_rounded,size: 15.sp,color: Color(0xff00FFF4),),
SizedBox(width: 4.sp,),
Text(
'同意',
style: TextStyle(
color: Colors.white,
fontSize: 11.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
width: 2.sp,
),
GestureDetector(
onTap: (){
navigateToUserAgreement();
},
child: Text(
'《用户协议》',
style: TextStyle(
color: Color(0xff00FFF4),
fontSize: 11.sp,
fontWeight: FontWeight.w400,
),
),
),
Text(
'',
style: TextStyle(
color: Colors.white,
fontSize: 11.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
width: 2.sp,
),
GestureDetector(
onTap: (){
navigateToPrivacyPolicy();
},
child: Text(
'《隐私协议》',
style: TextStyle(
color: Color(0xff00FFF4),
fontSize: 11.sp,
fontWeight: FontWeight.w400,
),
),
),
],
),
),
))
], ],
); );
}), }),
)); )),
],
);
} }
} }

View File

@ -94,7 +94,7 @@ class MinefragmentLogic extends GetxController {
update(); update();
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
} }

View File

@ -150,7 +150,7 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
// Alignment(0.52, 0.52) // Alignment(0.52, 0.52)
gradient: LinearGradient( gradient: LinearGradient(
colors: isPined colors: isPined
? [const Color(0xFF4B3E5E), const Color(0xFF334141)] ? [const Color(0x0F4B3E5E), const Color(0xaF334141)]
: [Colors.transparent, Colors.transparent])), : [Colors.transparent, Colors.transparent])),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

View File

@ -59,7 +59,7 @@ class MyCircleLogic extends GetxController {
} }
}); });
} }
showToast(bean.msg); showOKToast(bean.msg);
} }
Circle getCircleIndex() { Circle getCircleIndex() {

View File

@ -11,15 +11,15 @@ class OffaccountLogic extends GetxController {
offaccount() async { offaccount() async {
if(state.photoController.text==''){ if(state.photoController.text==''){
showToast("请输入手机号"); showOKToast("请输入手机号");
return; return;
} }
if(state.photoController.text.length<11){ if(state.photoController.text.length<11){
showToast("请输入正确手机号"); showOKToast("请输入正确手机号");
return; return;
} }
if(state.offReasonMsg=="请选择"){ if(state.offReasonMsg=="请选择"){
showToast("请选择注销原因"); showOKToast("请选择注销原因");
return; return;
} }
var data = await DioManager.instance.post(url: Api.offAccount, params: { var data = await DioManager.instance.post(url: Api.offAccount, params: {
@ -30,7 +30,7 @@ class OffaccountLogic extends GetxController {
if(bean.isSuccess()){ if(bean.isSuccess()){
pushLoginPage(); pushLoginPage();
}else{ }else{
showToast(bean.msg); showOKToast(bean.msg);
} }
} }
} }

View File

@ -50,7 +50,7 @@ class PhotoinfoLogic extends GetxController {
// var activity = Get.find<MinefragmentLogic>(); // var activity = Get.find<MinefragmentLogic>();
// activity.isVip // activity.isVip
var bean = BaseResponse<dynamic>.fromJson(data, (jsonData) => jsonData,); var bean = BaseResponse<dynamic>.fromJson(data, (jsonData) => jsonData,);
showToast(bean.msg); showOKToast(bean.msg);
if(bean.isSuccess()){ if(bean.isSuccess()){
final accountLogic = Get.find<AccountLogic>(); final accountLogic = Get.find<AccountLogic>();
accountLogic.photo = newPhotoController.text.toString(); accountLogic.photo = newPhotoController.text.toString();
@ -79,12 +79,12 @@ class PhotoinfoLogic extends GetxController {
Future<void> getCode() async { Future<void> getCode() async {
if(!GetUtils.isPhoneNumber(newPhotoController.text)){ if(!GetUtils.isPhoneNumber(newPhotoController.text)){
showToast("新手机号输入有误"); showOKToast("新手机号输入有误");
return; return;
} }
var data = await DioManager.instance.post(url: Api.sendCode, params: {"phone": newPhotoController.text}); var data = await DioManager.instance.post(url: Api.sendCode, params: {"phone": newPhotoController.text});
var bean = BaseResponse<Data>.fromJson(data, (data) => Data.fromJson(data)); var bean = BaseResponse<Data>.fromJson(data, (data) => Data.fromJson(data));
showToast(bean.msg); showOKToast(bean.msg);
if(kDebugMode){ if(kDebugMode){
if(bean.code==200){ if(bean.code==200){
codeController.text = bean.data!.code.toString(); codeController.text = bean.data!.code.toString();

View File

@ -312,7 +312,7 @@ class PhotoinfoPage extends StatelessWidget {
String newphoto = logic.newPhotoController.text; String newphoto = logic.newPhotoController.text;
String code = logic.codeController.text; String code = logic.codeController.text;
if (photo == "" || photo.length < 11) { if (photo == "" || photo.length < 11) {
showToast("已绑定的手机号输入有误"); showOKToast("已绑定的手机号输入有误");
return; return;
} }
// if(password==""){ // if(password==""){
@ -320,11 +320,11 @@ class PhotoinfoPage extends StatelessWidget {
// return ; // return ;
// } // }
if (newphoto == "" || newphoto.length < 11) { if (newphoto == "" || newphoto.length < 11) {
showToast("新手机号输入有误"); showOKToast("新手机号输入有误");
return; return;
} }
if (code == "") { if (code == "") {
showToast("请输入验证码"); showOKToast("请输入验证码");
return; return;
} }
logic.bindingPhoto(); logic.bindingPhoto();

View File

@ -83,7 +83,7 @@ class PrivacyPage extends StatelessWidget {
logic.update(); logic.update();
}else{ }else{
showRechargeDialog(); showRechargeDialog();
showToast("请先升级vip"); showOKToast("请先升级vip");
} }
}, },

View File

@ -33,7 +33,7 @@ class ReportLogic extends GetxController {
onSubmit()async{ onSubmit()async{
if(myPosition== -1){ if(myPosition== -1){
showToast("请选择举报类目"); showOKToast("请选择举报类目");
return; return;
} }
List myBean = []; List myBean = [];
@ -54,7 +54,7 @@ class ReportLogic extends GetxController {
if(bean.isSuccess()){ if(bean.isSuccess()){
Get.back(); Get.back();
} }
showToast(bean.msg); showOKToast(bean.msg);
} }
final ImagePicker _picker = ImagePicker(); final ImagePicker _picker = ImagePicker();

View File

@ -41,7 +41,7 @@ class Select_circlePage extends StatelessWidget {
if (numbers.length > 0) { if (numbers.length > 0) {
Navigator.pop(context, numbers); Navigator.pop(context, numbers);
} else { } else {
showToast("请选择兴趣圈子"); showOKToast("请选择兴趣圈子");
} }
}, },
), ),

View File

@ -38,7 +38,7 @@ class Signal_circle_listLogic extends GetxController {
update(); update();
} }
showToast(bean.msg); showOKToast(bean.msg);
} }
} }

View File

@ -51,7 +51,7 @@ class SplashLogic extends GetxController {
pushLoginPage(); pushLoginPage();
return; return;
} }
showToast(bean.msg.toString()); showOKToast(bean.msg.toString());
if (bean.code == 500) { if (bean.code == 500) {
await Future.delayed(Duration(seconds: 5)); await Future.delayed(Duration(seconds: 5));
onInit(); onInit();

View File

@ -328,7 +328,7 @@ class _MyTabbedScreenState extends State<TextPage>
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
showToast("喜欢"); showOKToast("喜欢");
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -355,7 +355,7 @@ class _MyTabbedScreenState extends State<TextPage>
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
showToast("私聊"); showOKToast("私聊");
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -723,7 +723,7 @@ class _MyTabbedScreenState extends State<TextPage>
borderRadius: BorderRadius.circular(0.0), borderRadius: BorderRadius.circular(0.0),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
showToast("点击了图片"); showOKToast("点击了图片");
}, },
child: Image.network( child: Image.network(
url, url,
@ -736,7 +736,7 @@ class _MyTabbedScreenState extends State<TextPage>
right: 0, right: 0,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
showToast("删除"); showOKToast("删除");
}, },
child: Image( child: Image(
image: AssetImage(getMineImage("icon_img_del")), image: AssetImage(getMineImage("icon_img_del")),

View File

@ -108,7 +108,7 @@ class UserinfoLogic extends GetxController {
isBlackBeen = bean.data.isBlock; isBlackBeen = bean.data.isBlock;
isDestroy = bean.data.isDestroy; isDestroy = bean.data.isDestroy;
if(isBlackBeen){ if(isBlackBeen){
showToast("您已被对方拉黑"); showOKToast("您已被对方拉黑");
} }
} }
onLineCity = isOnline ? "在线" : "离线"; onLineCity = isOnline ? "在线" : "离线";
@ -122,7 +122,7 @@ class UserinfoLogic extends GetxController {
} else if (bean.code == 9999) { } else if (bean.code == 9999) {
showBlackDialog(Get.context!); showBlackDialog(Get.context!);
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
update(); update();
} }
@ -160,11 +160,11 @@ class UserinfoLogic extends GetxController {
.post(url: "${Api.urgeAlbum + userId}/urge/album"); .post(url: "${Api.urgeAlbum + userId}/urge/album");
var bean = BaseResponse<String>.fromJson(data, (data) => data); var bean = BaseResponse<String>.fromJson(data, (data) => data);
if (bean.isSuccess()) { if (bean.isSuccess()) {
showToast("催更成功"); showOKToast("催更成功");
isUrgeStatus = true; isUrgeStatus = true;
update(); update();
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
} }
@ -181,7 +181,7 @@ class UserinfoLogic extends GetxController {
setLike() async { setLike() async {
if(isBlack||isDestroy){ if(isBlack||isDestroy){
showToast("喜欢失败,存在拉黑关系或者该账户已注销"); showOKToast("喜欢失败,存在拉黑关系或者该账户已注销");
return; return;
} }
@ -196,13 +196,13 @@ class UserinfoLogic extends GetxController {
isLike = !isLike; isLike = !isLike;
update(); update();
} }
showToast(bean.msg); showOKToast(bean.msg);
} }
setBlock(String status) async { setBlock(String status) async {
List<String> parts = imId.split('_'); List<String> parts = imId.split('_');
if (parts[2] == "10") { if (parts[2] == "10") {
showToast("不可拉黑客服号哦~"); showOKToast("不可拉黑客服号哦~");
return; return;
} }
var data = await DioManager.instance.post( var data = await DioManager.instance.post(
@ -235,7 +235,7 @@ class UserinfoLogic extends GetxController {
update(); update();
} }
showToast(bean.msg); showOKToast(bean.msg);
} }
Future getImageFile() async { Future getImageFile() async {

View File

@ -172,7 +172,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
final chatButton = GestureDetector( final chatButton = GestureDetector(
onTap: () { onTap: () {
if(logic.isBlack||logic.isDestroy||logic.isBlackBeen){ if(logic.isBlack||logic.isDestroy||logic.isBlackBeen){
showToast("私聊失败,存在拉黑关系或者该账户已注销"); showOKToast("私聊失败,存在拉黑关系或者该账户已注销");
return; return;
} }

View File

@ -37,7 +37,7 @@ class HomeCallOutLogic extends GetxController {
callOutMore = dataList.length == 20; callOutMore = dataList.length == 20;
update(); update();
} else { } else {
showToast(data["msg"]); showOKToast(data["msg"]);
} }
} }
@ -71,11 +71,11 @@ class HomeCallOutLogic extends GetxController {
var data = await DioManager.instance.delete( var data = await DioManager.instance.delete(
url: "/up-service/callout/${callOutId}",); url: "/up-service/callout/${callOutId}",);
if (data['code'] == 200) { if (data['code'] == 200) {
showToast('删除成功'); showOKToast('删除成功');
lists.removeAt(index); lists.removeAt(index);
update(); update();
} else { } else {
showToast('操作失败'); showOKToast('操作失败');
} }
} }
} }

View File

@ -229,7 +229,7 @@ unlockingPayment(String cicleId, MyCallback myCallback) async {
}); });
// showToast(data.toString()); // showToast(data.toString());
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
} else { } else {
var data = await DioManager.instance var data = await DioManager.instance
@ -245,7 +245,7 @@ unlockingPayment(String cicleId, MyCallback myCallback) async {
} }
}); });
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
} }

View File

@ -66,7 +66,7 @@ class Open_vip_tipLogic extends GetxController {
} }
}); });
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
} else { } else {
var data = await DioManager.instance.post( var data = await DioManager.instance.post(
@ -84,7 +84,7 @@ class Open_vip_tipLogic extends GetxController {
} }
}); });
} else { } else {
showToast(bean.msg); showOKToast(bean.msg);
} }
} }
SmartDialog.dismiss(); SmartDialog.dismiss();

View File

@ -280,7 +280,7 @@ class Open_vip_tipPage extends StatelessWidget {
controller.index = index; controller.index = index;
controller.update(); controller.update();
}else{ }else{
showToast("只有年会员才可使用至尊喊话哦~"); showOKToast("只有年会员才可使用至尊喊话哦~");
} }
}, },

View File

@ -16,6 +16,7 @@ import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:oktoast/oktoast.dart';
import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart'; import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart';
import 'package:tencent_cloud_chat_uikit/data_services/core/core_services.dart'; import 'package:tencent_cloud_chat_uikit/data_services/core/core_services.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
@ -259,7 +260,7 @@ class _MyAppState extends State<MyApp> {
FlutterNativeSplash.remove(); FlutterNativeSplash.remove();
return; return;
} }
showToast(bean.msg.toString()); showOKToast(bean.msg.toString());
if (bean.code == 500) { if (bean.code == 500) {
await Future.delayed(const Duration(seconds: 5)); await Future.delayed(const Duration(seconds: 5));
getLoginStyle(); getLoginStyle();
@ -279,12 +280,12 @@ class _MyAppState extends State<MyApp> {
switch (callbackValue.type) { switch (callbackValue.type) {
case TIMCallbackType.INFO: case TIMCallbackType.INFO:
// Shows the recommend text for info callback directly // Shows the recommend text for info callback directly
showToast(callbackValue.infoRecommendText!); showOKToast(callbackValue.infoRecommendText!);
break; break;
case TIMCallbackType.API_ERROR: case TIMCallbackType.API_ERROR:
//Prints the API error to console, and shows the error message. //Prints the API error to console, and shows the error message.
if(callbackValue.errorCode==20007){ if(callbackValue.errorCode==20007){
showToast("您已被对方拉黑,换个人聊聊天吧~"); showOKToast("您已被对方拉黑,换个人聊聊天吧~");
return; return;
} }
if(callbackValue.errorCode==6015){ if(callbackValue.errorCode==6015){
@ -294,7 +295,7 @@ class _MyAppState extends State<MyApp> {
"Error from TUIKit: ${callbackValue.errorMsg}, Code: ${callbackValue.errorCode}"); "Error from TUIKit: ${callbackValue.errorMsg}, Code: ${callbackValue.errorCode}");
if (callbackValue.errorCode == 10004 && if (callbackValue.errorCode == 10004 &&
callbackValue.errorMsg!.contains("not support @all")) { callbackValue.errorMsg!.contains("not support @all")) {
showToast("当前群组不支持@全体成员"); showOKToast("当前群组不支持@全体成员");
} else { } else {
// showToast(callbackValue.errorMsg ?? // showToast(callbackValue.errorMsg ??
// callbackValue.errorCode.toString()); // callbackValue.errorCode.toString());
@ -338,14 +339,22 @@ class _MyAppState extends State<MyApp> {
minTextAdapt: true, minTextAdapt: true,
splitScreenMode: true, splitScreenMode: true,
builder: (context, child) { builder: (context, child) {
return GetMaterialApp( return OKToast(
// 2-A: wrap your app with OKToast
textStyle: 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),
child: GetMaterialApp(
title: '微乐园', title: '微乐园',
initialBinding: SplashBinding(), initialBinding: SplashBinding(),
getPages: AppPages.routes, getPages: AppPages.routes,
home: SplashPage(), home: SplashPage(),
builder: FlutterSmartDialog.init(), builder: FlutterSmartDialog.init(),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
); ));
}); });
} }

View File

@ -323,7 +323,7 @@ class ConnectivityInterceptor extends Interceptor {
Future<void> onRequest( Future<void> onRequest(
RequestOptions options, RequestInterceptorHandler handler) async { RequestOptions options, RequestInterceptorHandler handler) async {
if (!await isInternetAvailable()) { if (!await isInternetAvailable()) {
showToast("请检查网络连接是否正常"); showOKToast("请检查网络连接是否正常");
} }
return handler.next(options); return handler.next(options);
} }

View File

@ -121,7 +121,7 @@ class CacheUtil {
if (value.toInt() <= 0&&totalSize<=0) { if (value.toInt() <= 0&&totalSize<=0) {
showToast("暂无缓存"); showOKToast("暂无缓存");
// Get.back(); // Get.back();
} else if (value >= 0) { } else if (value >= 0) {
@ -147,7 +147,7 @@ class CacheUtil {
await loadCache(); await loadCache();
SmartDialog.dismiss(); SmartDialog.dismiss();
showToast("清理缓存成功"); showOKToast("清理缓存成功");
callback("0KB"); callback("0KB");
}); });
return "正在清理中···"; return "正在清理中···";
@ -155,7 +155,7 @@ class CacheUtil {
} catch (e) { } catch (e) {
print(e); print(e);
SmartDialog.dismiss(); SmartDialog.dismiss();
showToast("清除缓存失败"); showOKToast("清除缓存失败");
} }
} }

View File

@ -24,7 +24,7 @@ Future<void> openWxPay(PaymentData data, WxPayCallback callback) async {
// //
bool isInstalled = await fluwx.isWeChatInstalled; bool isInstalled = await fluwx.isWeChatInstalled;
if (!isInstalled) { if (!isInstalled) {
showToast("请先安装微信"); showOKToast("请先安装微信");
callback(false, "请先安装微信"); callback(false, "请先安装微信");
return; return;
} }
@ -43,11 +43,11 @@ Future<void> openWxPay(PaymentData data, WxPayCallback callback) async {
// //
fluwx.weChatResponseEventHandler.listen((event) { fluwx.weChatResponseEventHandler.listen((event) {
if (event.isSuccessful) { if (event.isSuccessful) {
showToast("微信支付成功"); showOKToast("微信支付成功");
callback(true, null); callback(true, null);
} else { } else {
print(event.errStr); print(event.errStr);
showToast(event.errStr ?? "微信支付失败"); showOKToast(event.errStr ?? "微信支付失败");
callback(false, event.errStr); callback(false, event.errStr);
} }
}); });
@ -69,19 +69,19 @@ void _listenPay(AlipayResp resp) {
} else { } else {
switch(resp.resultStatus){ switch(resp.resultStatus){
case 8000: case 8000:
showToast("正在处理中"); showOKToast("正在处理中");
break; break;
case 4000: case 4000:
showToast("订单支付失败"); showOKToast("订单支付失败");
break; break;
case 5000: case 5000:
showToast("重复请求"); showOKToast("重复请求");
break; break;
case 6001: case 6001:
showToast("支付已取消"); showOKToast("支付已取消");
break; break;
case 6002: case 6002:
showToast("网络连接出错"); showOKToast("网络连接出错");
break; break;
} }
callback(false, resp.result); callback(false, resp.result);
@ -96,7 +96,7 @@ openAliPay(String payUrl, WxPayCallback myCallback) async {
callback = myCallback; callback = myCallback;
bool isInstalled = await AlipayKitPlatform.instance.isInstalled(); bool isInstalled = await AlipayKitPlatform.instance.isInstalled();
if (!isInstalled) { if (!isInstalled) {
showToast("请先安装支付宝"); showOKToast("请先安装支付宝");
return; return;
} }
if (null == _paySubs) { if (null == _paySubs) {

View File

@ -62,7 +62,7 @@ void uploadImage(String quToken ,XFile pickedFile,String updataRoute,MyCallback
if(bean.isSuccess()){ if(bean.isSuccess()){
quToken = bean.data!.token.toString(); quToken = bean.data!.token.toString();
}else{ }else{
showToast("图片上传失败"); showOKToast("图片上传失败");
SmartDialog.dismiss(force: true); SmartDialog.dismiss(force: true);
return; return;
} }
@ -83,7 +83,7 @@ void uploadImage(String quToken ,XFile pickedFile,String updataRoute,MyCallback
}); });
}).catchError((error) { }).catchError((error) {
print(error); print(error);
showToast("图片上传失败"); showOKToast("图片上传失败");
SmartDialog.dismiss(force: true); SmartDialog.dismiss(force: true);
}); });
}else{ }else{

View File

@ -6,8 +6,8 @@ import 'package:circle_app/main.dart';
import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/router/app_routers.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:oktoast/oktoast.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:video_compress/video_compress.dart'; import 'package:video_compress/video_compress.dart';
@ -50,15 +50,23 @@ String getCircleImage(String image) {
} }
/// msg: /// msg:
showToast(String msg) { showOKToast(String msg) {
Fluttertoast.showToast( showToast(
msg: msg, msg,
toastLength: Toast.LENGTH_SHORT, position: ToastPosition.center,
gravity: ToastGravity.CENTER, backgroundColor: Colors.black.withOpacity(0.8),
timeInSecForIosWeb: 1, radius: 13.0,
backgroundColor: Colors.black54, textStyle: const TextStyle(fontSize: 16.0),
textColor: Colors.white, // animationBuilder: const Miui10AnimBuilder(),
fontSize: 16.0); );
// Fluttertoast.showToast(
// msg: msg,
// toastLength: Toast.LENGTH_SHORT,
// gravity: ToastGravity.CENTER,
// timeInSecForIosWeb: 1,
// backgroundColor: Colors.black54,
// textColor: Colors.white,
// fontSize: 16.0);
} }
loaddingWidget(bool isMore) { loaddingWidget(bool isMore) {

View File

@ -32,7 +32,7 @@ class _ExitAppConfirmationState extends State<ExitAppConfirmation> {
// ScaffoldMessenger.of(context).showSnackBar( // ScaffoldMessenger.of(context).showSnackBar(
// const SnackBar(content: Text('再按一次返回键退出应用')), // const SnackBar(content: Text('再按一次返回键退出应用')),
// ); // );
showToast("再按一次返回键退出应用"); showOKToast("再按一次返回键退出应用");
return Future.value(false); return Future.value(false);
} }
return Future.value(true); return Future.value(true);

View File

@ -41,7 +41,7 @@ dependencies:
# 相册库 # 相册库
image_picker: ^0.8.6 image_picker: ^0.8.6
# Toast弹窗 # Toast弹窗
fluttertoast: ^8.1.0 oktoast: ^3.3.1
# 清除缓存 # 清除缓存
flutter_cache_manager: ^3.2.0 flutter_cache_manager: ^3.2.0
# 跳转web # 跳转web
@ -93,7 +93,7 @@ dependencies:
#event_bus: #event_bus:
event_bus: ^2.0.0 event_bus: ^2.0.0
#安装apk #安装apk
flutter_install_app: 1.3.0 # flutter_install_app: 1.3.0
#闪屏页 #闪屏页
flutter_native_splash: 2.2.16 flutter_native_splash: 2.2.16
#腾讯离线推送 #腾讯离线推送