安卓1.3.5代码提交

This commit is contained in:
CYH 2023-12-04 19:21:29 +08:00
parent 07a4c42cde
commit 7478f85bbb
12 changed files with 356 additions and 296 deletions

View File

@ -71,8 +71,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21 minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode 26 versionCode 27
versionName "1.3.3" versionName "1.3.5"
manifestPlaceholders = [ manifestPlaceholders = [
vivo_APPID: "105669716", vivo_APPID: "105669716",
vivo_APPKEY:"84f750207787376b310ca5b0d5969122", vivo_APPKEY:"84f750207787376b310ca5b0d5969122",

View File

@ -59,97 +59,102 @@ class _ChatGiftPannelState extends State<ChatGiftPannel>
height: Get.height, height: Get.height,
child: Column( child: Column(
children: [ children: [
Expanded(child: Container()), Expanded(child:GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Get.back();
},
child: Container())),
Container( Container(
// color: Color(0xFF423055), child: SafeArea(
child: SafeArea( top: false,
top: false, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( color: Color(0xFF423055),
color: Color(0xFF423055), borderRadius: BorderRadius.only(topLeft: Radius.circular(16.sp,),topRight: Radius.circular(16.sp))
borderRadius: BorderRadius.only(topLeft: Radius.circular(16.sp,),topRight: Radius.circular(16.sp)) ),
), width: Get.width,
width: Get.width, height: 370.sp,
height: 370.sp, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ SizedBox(height: 5.sp,),
SizedBox(height: 5.sp,), Row(
Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ Container(
Container( height: 30.sp,
height: 30.sp, width:120.sp,
width:120.sp, margin: EdgeInsets.only(left: 5.sp,),
margin: EdgeInsets.only(left: 5.sp,), child: TabBar(
child: TabBar( isScrollable: false,
isScrollable: false, automaticIndicatorColorAdjustment: false,
automaticIndicatorColorAdjustment: false, labelPadding: EdgeInsets.symmetric(horizontal: 4.0.sp),
labelPadding: EdgeInsets.symmetric(horizontal: 4.0.sp), physics: NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(), indicatorColor: AppColor.mainColor,
indicatorColor: AppColor.mainColor, indicatorSize: TabBarIndicatorSize.label,
indicatorSize: TabBarIndicatorSize.label, unselectedLabelStyle: TextStyle(
unselectedLabelStyle: TextStyle( fontSize: 16.sp,
fontSize: 16.sp, fontWeight: FontWeight.w500,
fontWeight: FontWeight.w500, ),
unselectedLabelColor: Color(0xB3FFFFFF),
labelColor: AppColor.mainColor,
labelStyle: TextStyle(
fontSize: 16.sp, fontWeight: FontWeight.w500),
controller: tabController,
tabs: const <Widget>[
Tab(
text: '礼物',
),
Tab(
text: '会员',
),
],
), ),
unselectedLabelColor: Color(0xB3FFFFFF),
labelColor: AppColor.mainColor,
labelStyle: TextStyle(
fontSize: 16.sp, fontWeight: FontWeight.w500),
controller: tabController,
tabs: const <Widget>[
Tab(
text: '礼物',
),
Tab(
text: '会员',
),
],
), ),
), tabController.index == 0 ? Container(
tabController.index == 0 ? Container( margin: EdgeInsets.only(right: 15.sp),
margin: EdgeInsets.only(right: 15.sp), child: InkWell(
child: InkWell( onTap: () {
onTap: () { String toUserId = widget.accid!.split('_').last;
String toUserId = widget.accid!.split('_').last; Get.toNamed(AppRoutes.GiftShopPage,arguments: toUserId);
Get.toNamed(AppRoutes.GiftShopPage,arguments: toUserId); },
}, child: Container(
child: Container( height:22.sp,
height:22.sp, width: 62.sp,
width: 62.sp, decoration: BoxDecoration(
decoration: BoxDecoration( gradient: AppColor.mainVerLinearGradient,
gradient: AppColor.mainVerLinearGradient, borderRadius: BorderRadius.circular(11.sp)
borderRadius: BorderRadius.circular(11.sp) ),
), child: Stack(
child: Stack( alignment: Alignment.center,
alignment: Alignment.center, children: [
children: [ Container(
Container( height:20.sp,
height:20.sp, width: 60.sp,
width: 60.sp, decoration: BoxDecoration(
decoration: BoxDecoration( color: Color(0xFF423055),
color: Color(0xFF423055), borderRadius: BorderRadius.circular(10.sp)
borderRadius: BorderRadius.circular(10.sp) )),
)), Text('礼物墙',style: TextStyle(color: Colors.white,fontSize: 14.sp),)
Text('礼物墙',style: TextStyle(color: Colors.white,fontSize: 14.sp),) ],
], ),
), )),
)), ) : Container()
) : Container() ],
], ),
), Expanded(
Expanded( child: TabBarView(
child: TabBarView( controller: tabController,
controller: tabController, children: [
children: [ Gift(widget.accid,widget.giftId),
Gift(widget.accid,widget.giftId), PartnerOption(accid: widget.accid),
PartnerOption(accid: widget.accid), ],
], ))
)) ],
], ),
), )),
))) )
], ],
), ),
), ),

View File

@ -263,6 +263,7 @@ class _GiftState extends State<Gift> {
if (info['name'] == '浪漫告白') { if (info['name'] == '浪漫告白') {
selectedIndex = i; selectedIndex = i;
giftId = info['id'].toString(); giftId = info['id'].toString();
tipStr = info['topHours'] != null ? info['topHours'].toString() : '';
} }
} }

View File

@ -2,7 +2,7 @@ import 'dart:io';
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_install_app/flutter_install_app.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -260,7 +260,7 @@ class _CustomDialogState extends State<UpdateDialog> {
// SmartDialog.dismiss(); // SmartDialog.dismiss();
print(error); print(error);
}); });
// await AppInstaller.installApk(filePath, actionRequired: false); await AppInstaller.installApk(filePath, actionRequired: false);
} }
} }

View File

@ -23,6 +23,7 @@ import 'package:tencent_cloud_chat_uikit/data_services/message/message_services.
import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart'; import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import '../../util/PaymentUtils.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../../util/eventBus.dart'; import '../../util/eventBus.dart';
import '../../view/notice.dart'; import '../../view/notice.dart';
@ -87,6 +88,9 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
checkVersion(); checkVersion();
loadMyCircleData(); loadMyCircleData();
if (Platform.isAndroid) {
initWxApi();
}
} }
void addMsgListener() { void addMsgListener() {

View File

@ -248,7 +248,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'想要聊天的圈友', '最近想要聊天的圈友',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.sp, fontSize: 16.sp,
@ -270,7 +270,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
).createShader(Offset.zero & bounds.size); ).createShader(Offset.zero & bounds.size);
}, },
child: Text( child: Text(
'${ctr.total}等您聊', '${ctr.total}在线等您聊',
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

View File

@ -138,30 +138,12 @@ class QuickPage extends StatelessWidget {
// height: 210.sp + (item.images.isNotEmpty ? 98.sp : 0), // height: 210.sp + (item.images.isNotEmpty ? 98.sp : 0),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.sp), borderRadius: BorderRadius.circular(10.sp),
border: GradientBoxBorder( border: Border.all(
color: AppColor.mainColor.withOpacity(0.2),
gradient:
AppColor.mainVerLinearGradient,
width: 1.sp, width: 1.sp,
), ),
), ),
child: Stack( child:
children: [
Container(
margin: EdgeInsets.only(top: 1.sp, left: 1.sp, right: 1.sp),
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.sp),
topRight: Radius.circular(10.sp),
),
child: Image(
image: AssetImage(getCircleImage("icon_list_null")),
width: Get.width,
fit: BoxFit.fill,
height: 92.sp,
)
),
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -171,10 +153,10 @@ class QuickPage extends StatelessWidget {
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 6.sp, left: 8.sp), margin: EdgeInsets.only(top: 6.sp, left: 8.sp),
width: 88.sp, width: 61.sp,
height: 88.sp, height: 61.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(30.5.sp),
gradient: const LinearGradient( gradient: const LinearGradient(
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
@ -187,51 +169,58 @@ class QuickPage extends StatelessWidget {
), ),
padding: EdgeInsets.all(2.sp), padding: EdgeInsets.all(2.sp),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(30.sp),
child: Image.network(item.avatarThumb, child: Image.network(item.avatarThumb,
width: 88.sp, height: 88.sp, fit: BoxFit.cover), width: 60.sp, height: 60.sp, fit: BoxFit.cover),
), ),
), ),
Expanded(
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 6.sp, left: 9.sp),
child: Row(
children: [
Text(
item.nickname,
style: TextStyle(
fontWeight: FontWeight.bold,
color: const Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 16.sp,
),
),
SizedBox(width: 8.sp),
if (item.gender != null)
_buildInfoRow(item),
const Spacer(),
],
),
),
Container(
// color: Colors.red,
// height: 55.sp, //
constraints: BoxConstraints(
maxHeight: 55.sp
),
width: Get.width,
margin: EdgeInsets.symmetric(horizontal: 8.0),
child: Align(
alignment: Alignment.centerLeft, //
child: Text(
item.signature ?? '暂时还没有签名哦~',
maxLines: 2,
style: TextStyle(color: Colors.white, fontSize: 18.sp),
overflow: TextOverflow.ellipsis,
),
),
),
],
),
)
], ],
), ),
), ),
Container(
margin: EdgeInsets.only(top: 6.sp, left: 9.sp),
child: Row(
children: [
Text(
item.nickname,
style: TextStyle(
fontWeight: FontWeight.bold,
color: const Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 16.sp,
),
),
SizedBox(width: 8.sp),
if (item.gender != null)
_buildInfoRow(item),
const Spacer(),
],
),
),
Container(
// color: Colors.red,
// height: 55.sp, //
constraints: BoxConstraints(
maxHeight: 55.sp
),
width: Get.width,
margin: EdgeInsets.symmetric(horizontal: 8.0),
child: Align(
alignment: Alignment.centerLeft, //
child: Text(
item.signature ?? '暂时还没有签名哦~',
maxLines: 2,
style: TextStyle(color: Colors.white, fontSize: 18.sp),
overflow: TextOverflow.ellipsis,
),
),
),
if (item.interests.isNotEmpty) if (item.interests.isNotEmpty)
Container( Container(
margin: EdgeInsets.only(left: 8.sp, right: 3.sp,bottom: 5.sp), margin: EdgeInsets.only(left: 8.sp, right: 3.sp,bottom: 5.sp),
@ -262,8 +251,7 @@ class QuickPage extends StatelessWidget {
), ),
), ),
]), ]),
], ),
)),
); );
} }

View File

@ -106,6 +106,15 @@ class MyTabbedScreenState extends State<UserinfoPage>
@override @override
void dispose() { void dispose() {
_tabController.dispose(); _tabController.dispose();
OverlayState? overlayState = Overlay.of(Get.context!);
if (mainOverlayEntry != null) {
if (overlayState.debugIsVisible(mainOverlayEntry!)) {
mainOverlayEntry!.remove();
}
}
// overlayState.insert(entry);
sub.cancel(); sub.cancel();
routeObserver.unsubscribe(this); routeObserver.unsubscribe(this);
super.dispose(); super.dispose();

View File

@ -77,9 +77,11 @@ class _RechargeScreenDialogState extends State<RechargeScreenDialog> {
if (isZfbPrice) { if (isZfbPrice) {
var data = await DioManager.instance.post( var data = await DioManager.instance.post(
url: Api.postAliPayOrder, url: Api.postAliPayOrder,
params: {"itemId": itemId, "payType": 4}); params: {"product_id": itemId, "type": 4});
if (data['code'] == 10000) { var bean = BaseResponse<PayUrlBean>.fromJson(
openAliPay(data['payUrl'], (isSuccess, errorMsg) { data, (data) => PayUrlBean.fromJson(data));
if (bean.isSuccess()) {
openAliPay(bean.data.payUrl, (isSuccess, errorMsg) {
if (isSuccess) { if (isSuccess) {
// //
showOKToast('充值成功'); showOKToast('充值成功');
@ -95,12 +97,12 @@ class _RechargeScreenDialogState extends State<RechargeScreenDialog> {
} else { } else {
var data = await DioManager.instance.post( var data = await DioManager.instance.post(
url: Api.postWxOrder, url: Api.postWxOrder,
params: {"itemId": itemId, "payType": 4}); params: {"product_id": itemId, "type": 4});
var bean = BaseResponse<PaymentData>.fromJson( var bean = BaseResponse<PaymentData>.fromJson(
data, (data) => PaymentData.fromJson(data)); data, (data) => PaymentData.fromJson(data));
if (bean.isSuccess()) { if (bean.isSuccess()) {
// "wxPayAo" -> [_Map] // "wxPayAo" -> [_Map]
openWxPay(data['wxPayAo'], (bool isSuccess, String? errorMessage) { openWxPay(bean.data, (bool isSuccess, String? errorMessage) {
if (isSuccess) { if (isSuccess) {
// //
showOKToast('充值成功'); showOKToast('充值成功');
@ -129,7 +131,7 @@ class _RechargeScreenDialogState extends State<RechargeScreenDialog> {
Container( Container(
margin: EdgeInsets.only(left: 20.sp,right: 20.sp), margin: EdgeInsets.only(left: 20.sp,right: 20.sp),
padding: EdgeInsets.all(20.sp), padding: EdgeInsets.all(20.sp),
height: widget.isShowBalance ? 441.sp + (!Platform.isAndroid ? 0 : 50.sp) : 390.sp + (!Platform.isAndroid ? 0 : 50.sp), height: widget.isShowBalance ? 441.sp + (!Platform.isAndroid ? 0 : 15.sp) : 390.sp + (!Platform.isAndroid ? 0 : 50.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0xFF393949), color: const Color(0xFF393949),
borderRadius: BorderRadius.circular(10.sp) borderRadius: BorderRadius.circular(10.sp)
@ -296,7 +298,7 @@ class _RechargeScreenDialogState extends State<RechargeScreenDialog> {
), ),
), ),
), ),
SizedBox(height: 16.0.sp), SizedBox(height: 10.0.sp),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,

View File

@ -41,6 +41,8 @@ final CoreServicesImpl coreInstance = TIMUIKitCore.getInstance();
final TUIChatSeparateViewModel chatSeparateViewModel = final TUIChatSeparateViewModel chatSeparateViewModel =
TUIChatSeparateViewModel(); TUIChatSeparateViewModel();
OverlayEntry? mainOverlayEntry;
void main() { void main() {
FlutterBugly.postCatchedException(() async { FlutterBugly.postCatchedException(() async {
// ensureInitialized // ensureInitialized
@ -133,9 +135,7 @@ void uploadBuzIDAndToken() async {
return; return;
} }
// if (Platform.isAndroid) {
initWxApi();
// }
await ChannelPush.init((msg) {}); await ChannelPush.init((msg) {});
int? businessID = await TimUiKitPushPlugin.getBuzId(PushConfig.appInfo); int? businessID = await TimUiKitPushPlugin.getBuzId(PushConfig.appInfo);

View File

@ -1,10 +1,10 @@
class Api { class Api {
// static const baseUrl = 'https://leyuan666.com/zuul-service/'; static const baseUrl = 'https://leyuan666.com/zuul-service/';
static const baseUrl = 'http://192.168.3.55:2000/'; // static const baseUrl = 'http://192.168.3.55:2000/';
// //

View File

@ -1,180 +1,231 @@
import 'dart:async'; import 'dart:async';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/common/colors/app_color.dart';
import 'package:event_bus/event_bus.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.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:get/get.dart'; import 'package:get/get.dart';
import '../main.dart';
typedef void NoticeCallback(); typedef void NoticeCallback();
void showFloatingButtonOverlay( void showFloatingButtonOverlay(
BuildContext context, String nickname, String ageMsg, String avatar,int event,NoticeCallback noticeCallback) { BuildContext context, String nickname, String ageMsg, String avatar,int event,NoticeCallback noticeCallback) {
OverlayState? overlayState = Overlay.of(context); OverlayState? overlayState = Overlay.of(context);
late OverlayEntry overlayEntry; late OverlayEntry overlayEntry;
bool showMessage = false; bool showMessage = false;
int countdownSeconds = 5; // int countdownSeconds = 5; //
// Timer // Timer
late Timer countdownTimer; late Timer countdownTimer;
// OverlayEntry // OverlayEntry
overlayEntry = OverlayEntry( overlayEntry = OverlayEntry(
builder: (BuildContext context) { builder: (BuildContext context) {
return Positioned(
top: 30, return Stack(
alignment: Alignment.center,
children: [
Positioned(
top: MediaQuery.of(context).padding.top,
// right: 16, // right: 16,
child: AnimatedContainer( child: AnimatedContainer(
duration: const Duration(milliseconds: 500), duration: const Duration(milliseconds: 500),
curve: Curves.easeInOut, curve: Curves.easeInOut,
height: showMessage ? 95 : 0, height: showMessage ? 85 : 0,
child: Container( child: Container(
width: Get.width - 16, width: Get.width - 16,
margin: EdgeInsets.all(10.sp), // margin: EdgeInsets.only(top:10.sp),
padding: EdgeInsets.fromLTRB(16.sp, 16.sp, 16.sp, 0), padding: EdgeInsets.fromLTRB(16.sp, 16.sp, 16.sp, 0),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: const Color(0xFF353443), color: const Color(0xFF353443),
), ),
child: SingleChildScrollView( child: Row(
child: Row( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ ClipOval(
ClipOval( child: CachedNetworkImage(
child: CachedNetworkImage( fit: BoxFit.cover,
fit: BoxFit.cover, placeholder: null,
placeholder: null, imageUrl: avatar,
imageUrl: avatar, width: 48.sp,
width: 48.sp, height: 48.sp,
height: 48.sp, ),
), ),
), const SizedBox(width: 8),
const SizedBox(width: 8), Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Row(
Row( children: [
children: [ Container(
Container( // width: 70.sp,
// width: 70.sp, child: Text(
child: Text( nickname,
nickname, overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, style: TextStyle(
style: TextStyle( color: Color.fromRGBO(247, 250, 250, 1.0),
color: Color.fromRGBO(247, 250, 250, 1.0), fontSize: 16.sp,
fontSize: 16.sp, ),
), ),
), ),
), SizedBox(width: 8.sp),
SizedBox(width: 8.sp), Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(17),
borderRadius: BorderRadius.circular(17), gradient: const LinearGradient(
gradient: const LinearGradient( colors: [
colors: [ Color.fromRGBO(141, 255, 248, 1.0),
Color.fromRGBO(141, 255, 248, 1.0), Color.fromRGBO(181, 211, 255, 1.0),
Color.fromRGBO(181, 211, 255, 1.0), ],
], begin: Alignment.centerLeft,
begin: Alignment.centerLeft, end: Alignment.centerRight,
end: Alignment.centerRight, ),
),
padding: EdgeInsets.only(
top: 2.sp,
bottom: 2.sp,
left: 10.sp,
right: 10.sp,
),
child: Text(
ageMsg,
style: const TextStyle(
color: Colors.black,
fontSize: 10,
),
), ),
), ),
padding: EdgeInsets.only(
top: 2.sp,
bottom: 2.sp,
left: 10.sp,
right: 10.sp,
),
child: Text(
ageMsg,
style: const TextStyle(
color: Colors.black,
fontSize: 10,
),
),
),
],
),
const SizedBox(height: 8),
Text( event == 0
? "看了这么久,给我点个喜欢呗~"
: event == 1
? "我喜欢了你,可以喜欢我一下吗?"
: event == 2
? "你喜欢的人上线啦,赶紧找他聊天吧!"
: "我也喜欢了你,一起聊聊呗~",
style: TextStyle(
color: Colors.grey,
fontSize: 14.sp,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
const Spacer(),
GestureDetector(
onTap: () {
countdownTimer.cancel(); //
overlayEntry!.remove();
noticeCallback();
// logic.setLike();
// logic.showMessage = false;
// logic.update();
},
child: Container(
margin: EdgeInsets.only(top: 6.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17),
gradient: const LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
], ],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
), ),
), const SizedBox(height: 8),
padding: EdgeInsets.symmetric( Text( event == 0
horizontal: 16.sp, vertical: 6.sp), ? "看了这么久,给我点个喜欢呗~"
child: Text(
event == 0
? "喜欢"
: event == 1 : event == 1
? "回关" ? "我喜欢了你,可以喜欢我一下吗?"
: event == 2 : event == 2
? "私聊" ? "你喜欢的人上线啦,赶紧找他聊天吧!"
: "私聊", : "我也喜欢了你,一起聊聊呗~",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.grey,
fontSize: 14.sp, fontSize: 14.sp,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
const Spacer(),
GestureDetector(
onTap: () {
countdownTimer.cancel();
try {
overlayEntry!.remove();
} catch (e) {
}
mainOverlayEntry = null;
noticeCallback();
// logic.setLike();
// logic.showMessage = false;
// logic.update();
},
child: Container(
margin: EdgeInsets.only(top: 6.sp),
height: 34,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17),
gradient: const LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
padding: EdgeInsets.symmetric(
horizontal: 16.sp, vertical: 6.sp),
child: Text(
event == 0
? "喜欢"
: event == 1
? "回关"
: event == 2
? "私聊"
: "私聊",
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
),
), ),
), ),
), ),
),
// ), // ),
], ],
),
), ),
), ),
), ),
), if (event == 0)
Positioned(
top: MediaQuery.of(context).padding.top,
right: 8,
child: GestureDetector(
onTap: () {
countdownTimer.cancel();
//
try {
overlayEntry!.remove();
} catch (e) {
}
mainOverlayEntry = null;
},
child: Container(
height: 20,
width: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(topRight: Radius.circular(10),bottomLeft: Radius.circular(10)),
gradient: AppColor.mainVerLinearGradient
),
alignment: Alignment.center,
child: Icon(Icons.close,size: 20,color: Colors.white,),
),
))
],
); );
}, },
); );
// setState(() {}); // setState(() {});
showMessage = true; showMessage = true;
mainOverlayEntry = overlayEntry;
countdownTimer = Timer.periodic(Duration(seconds: 1), (timer) { countdownTimer = Timer.periodic(Duration(seconds: 1), (timer) {
if (countdownSeconds > 0) { if (countdownSeconds > 0) {
countdownSeconds--; countdownSeconds--;
// overlayEntry.markNeedsBuild(); // OverlayEntry // overlayEntry.markNeedsBuild(); // OverlayEntry
} else { } else {
timer.cancel();
// //
overlayEntry!.remove(); timer.cancel();
try {
overlayEntry!.remove();
} catch (e) {
}
mainOverlayEntry = null;
} }
}); });
// OverlayEntry Overlay // OverlayEntry Overlay