Compare commits
10 Commits
af88766078
...
f955acb850
| Author | SHA1 | Date | |
|---|---|---|---|
| f955acb850 | |||
| 548b548f82 | |||
| d3295a11b1 | |||
| cac1567753 | |||
| 4eb62bb766 | |||
| 56bd9f6163 | |||
| 261c19ddfc | |||
| e855bf7b42 | |||
|
|
d2db9f1478 | ||
|
|
0a4b3269e6 |
@ -65,8 +65,8 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 21
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode 2
|
||||
versionName "1.0.1"
|
||||
versionCode 110
|
||||
versionName "1.1.0"
|
||||
manifestPlaceholders = [
|
||||
vivo_APPID: "105669716",
|
||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
[
|
||||
{"name": "全国",
|
||||
"city": [{
|
||||
"name": "全国",
|
||||
"area": ["全国"]
|
||||
}]},
|
||||
|
||||
{
|
||||
"name": "北京市",
|
||||
"city": [
|
||||
|
||||
@ -56,6 +56,7 @@ class CircleLogic extends GetxController {
|
||||
if (circle.lists.length < 20) {
|
||||
isMore = false;
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
myVip = await getVip();
|
||||
@ -224,11 +225,12 @@ class CircleLogic extends GetxController {
|
||||
}
|
||||
|
||||
void getBanner() async {
|
||||
bannerList.clear();
|
||||
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getNearbyBeanner, params: {});
|
||||
var bean = BaseResponse<BannerList>.fromJson(
|
||||
data, (data) => BannerList.fromJson(data));
|
||||
bannerList.clear();
|
||||
bannerList.addAll(bean.data.banners);
|
||||
cityName = bean.data.city;
|
||||
}
|
||||
@ -253,8 +255,10 @@ class CircleLogic extends GetxController {
|
||||
orientationList.forEach((element) {
|
||||
if (element.isSelect) orientations.add(element.id);
|
||||
});
|
||||
if(offset==0){
|
||||
getBanner();
|
||||
}
|
||||
|
||||
// getBanner();
|
||||
var data = await DioManager.instance.post(url: Api.postNearbyList, params: {
|
||||
"offset": offset,
|
||||
'deep': deep,
|
||||
@ -271,13 +275,12 @@ class CircleLogic extends GetxController {
|
||||
} catch (Exception) {}
|
||||
|
||||
if (vicinityPage == 1) {
|
||||
cityName = bean.data.city;
|
||||
vicinityList.clear();
|
||||
}
|
||||
try{
|
||||
vicinityList.addAll(bean.data.users);
|
||||
} catch(Exception){
|
||||
|
||||
}
|
||||
} on Exception{}
|
||||
|
||||
if (vicinityPage == 1) {
|
||||
refreshController.refreshCompleted();
|
||||
@ -384,11 +387,11 @@ class VicinityItemBean {
|
||||
interests: interests,
|
||||
images: List<String>.from(json['images']),
|
||||
avatarThumb: json['avatar_thumb'],
|
||||
genderName: json['genderName'],
|
||||
roleName: json['roleName'],
|
||||
orientationName: json['orientationName'],
|
||||
bgPicUrl: json['bgPicUrl'],
|
||||
onlineFlag: json['onlineFlag'],
|
||||
genderName: json['gender_name'],
|
||||
roleName: json['role_name'],
|
||||
orientationName: json['orientation_name'],
|
||||
bgPicUrl: json['bg_picUrl'],
|
||||
onlineFlag: json['online_flag'],
|
||||
isOnline: json['isOnline'],
|
||||
);
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_pickers/pickers.dart';
|
||||
import 'package:flutter_pickers/style/default_style.dart';
|
||||
import 'package:flutter_pickers/style/picker_style.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -18,10 +19,8 @@ import '../select_circle/logic.dart';
|
||||
import '../userinfo/logic.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
|
||||
const bgWidget = DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage('assets/images/base/home_back.png'));
|
||||
fit: BoxFit.fill, image: AssetImage('assets/images/base/home_back.png'));
|
||||
|
||||
class CirclePage extends StatefulWidget {
|
||||
CirclePage({Key? key}) : super(key: key);
|
||||
@ -76,9 +75,8 @@ class _CirclePageState extends State<CirclePage>
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF423055),
|
||||
image: bgWidget),
|
||||
decoration:
|
||||
const BoxDecoration(color: Color(0xFF423055), image: bgWidget),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
@ -139,18 +137,20 @@ class _CirclePageState extends State<CirclePage>
|
||||
controller: logic.refreshController,
|
||||
onRefresh: _onRefresh,
|
||||
onLoading: _onLoading,
|
||||
enablePullUp: logic.myVip>0,
|
||||
enablePullUp: logic.myVip > 0,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.all(10.sp),
|
||||
itemCount: logic.myVip == 0 ? logic.vicinityList.length + 2 : logic.vicinityList.length + 1,
|
||||
itemCount: logic.myVip == 0
|
||||
? logic.vicinityList.length + 2
|
||||
: logic.vicinityList.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
return bannerView(controller);
|
||||
} else {
|
||||
if (logic.myVip == 0 && index == logic.vicinityList.length+1) {
|
||||
if (logic.myVip == 0 && index == logic.vicinityList.length + 1) {
|
||||
return showVipView();
|
||||
} else {
|
||||
return ListItem(logic.vicinityList[index-1], index-1);
|
||||
return ListItem(logic.vicinityList[index - 1], index - 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -215,8 +215,8 @@ class _CirclePageState extends State<CirclePage>
|
||||
|
||||
Widget ListItem(VicinityItemBean item, int index) {
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
@ -238,12 +238,14 @@ class _CirclePageState extends State<CirclePage>
|
||||
topLeft: Radius.circular(10.sp),
|
||||
topRight: Radius.circular(10.sp),
|
||||
),
|
||||
child: item.images.length==0? Image(
|
||||
image: AssetImage(getCircleImage("icon_list_null")),
|
||||
width: Get.width,
|
||||
fit: BoxFit.fill,
|
||||
height: 92.sp,
|
||||
):Container(),
|
||||
child: item.images.length == 0
|
||||
? Image(
|
||||
image: AssetImage(getCircleImage("icon_list_null")),
|
||||
width: Get.width,
|
||||
fit: BoxFit.fill,
|
||||
height: 92.sp,
|
||||
)
|
||||
: Container(),
|
||||
),
|
||||
),
|
||||
Column(children: [
|
||||
@ -278,16 +280,18 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Container(
|
||||
|
||||
margin: EdgeInsets.only(top: 6.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
for (int i = 0; i < item.images.length; i++)
|
||||
GestureDetector(
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.Swiper,
|
||||
arguments: {'imaglist': item.images, 'index': i});
|
||||
},
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.Swiper,
|
||||
arguments: {
|
||||
'imaglist': item.images,
|
||||
'index': i
|
||||
});
|
||||
},
|
||||
child: ListAlbumItem(item.images[i], i)),
|
||||
],
|
||||
),
|
||||
@ -313,37 +317,33 @@ class _CirclePageState extends State<CirclePage>
|
||||
_buildInfoRow(item),
|
||||
const Spacer(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 8.sp),
|
||||
child:item.isOnline==1? Text(
|
||||
"当前在线",
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
):Container(),
|
||||
),
|
||||
|
||||
|
||||
margin: EdgeInsets.only(right: 8.sp),
|
||||
child: Text(
|
||||
item.onlineFlag.toString(),
|
||||
style: TextStyle(
|
||||
color: const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 50.sp, // 设置固定高度
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.symmetric( horizontal: 8.0),
|
||||
margin: EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft, // 文本左对齐,垂直居中
|
||||
child: Text(
|
||||
item.signature,
|
||||
maxLines: 2,
|
||||
style: TextStyle(color: Colors.white,fontSize: 14.sp),
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 8.sp,right: 3.sp),
|
||||
margin: EdgeInsets.only(left: 8.sp, right: 3.sp),
|
||||
child: _buildInterestsListView(item.interests))
|
||||
]),
|
||||
],
|
||||
@ -408,11 +408,9 @@ class _CirclePageState extends State<CirclePage>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget _buildInfoRow(VicinityItemBean item) {
|
||||
String ageMsg = getAgeCOntent(item!.gender, item!.age,
|
||||
item!.role, item!.orientation);
|
||||
String ageMsg =
|
||||
getAgeCOntent(item!.gender, item!.age, item!.role, item!.orientation);
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
@ -442,60 +440,61 @@ class _CirclePageState extends State<CirclePage>
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
if (item.vip > 0)
|
||||
Image(
|
||||
image: AssetImage(getBaseImage(item.vip == 1 ? "vip" : 'year_vip')),
|
||||
width: 44.sp,
|
||||
height: 18.sp,
|
||||
),
|
||||
if (item.vip > 0)
|
||||
Image(
|
||||
image: AssetImage(getBaseImage(item.vip == 1 ? "vip" : 'year_vip')),
|
||||
width: 44.sp,
|
||||
height: 18.sp,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget ListAlbumItem(String item, int index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 2.sp),
|
||||
child: CachedNetworkImage( width: 88.sp, height: 88.sp, fit: BoxFit.cover, imageUrl: item+"?imageView2/1/w/176/h/176/q/75",),
|
||||
margin: EdgeInsets.symmetric(horizontal: 2.sp),
|
||||
child: CachedNetworkImage(
|
||||
width: 88.sp,
|
||||
height: 88.sp,
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: item + "?imageView2/1/w/176/h/176/q/75",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _onRefresh() async {
|
||||
logic.vicinityPage = 1;
|
||||
logic.offset = 0;
|
||||
logic.getNearByList();
|
||||
// logic.refreshController.refreshCompleted();
|
||||
|
||||
logic.getNearByList();
|
||||
// logic.refreshController.refreshCompleted();
|
||||
}
|
||||
|
||||
void _onLoading() async {
|
||||
if(logic.myVip>0){
|
||||
if (logic.myVip > 0) {
|
||||
logic.vicinityPage = logic.vicinityPage + 1;
|
||||
// logic.offset = 0;
|
||||
//
|
||||
logic.getNearByList();
|
||||
}else{
|
||||
} else {
|
||||
logic.refreshController.loadComplete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Widget bannerView(CircleLogic controller) {
|
||||
return Container(
|
||||
return SizedBox(
|
||||
height: 160.sp,
|
||||
// margin: EdgeInsets.symmetric(horizontal: 16.sp),
|
||||
child: Swiper(
|
||||
autoplay: logic.bannerList.length > 1,
|
||||
controller: logic.swiperController,
|
||||
loop: logic.bannerList.length>1?true:false,
|
||||
autoplayDelay: 6000,
|
||||
loop: logic.bannerList.length > 1 ? true : false,
|
||||
// index:logic.index,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
// print(index);
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
print(logic.bannerList[index].param);
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "",
|
||||
"url": logic.bannerList[index].param.toString()
|
||||
});
|
||||
// print(logic.bannerList[index].param);
|
||||
navigateToCustomRoute(logic.bannerList[index]);
|
||||
},
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
@ -514,10 +513,10 @@ class _CirclePageState extends State<CirclePage>
|
||||
margin: EdgeInsets.all(5.0.sp), // 设置外边距
|
||||
alignment: Alignment.bottomCenter,
|
||||
builder: DotSwiperPaginationBuilder(
|
||||
color: Colors.white, // 小圆点的颜色
|
||||
color: Color(0x00FFFFFF), // 小圆点的颜色
|
||||
activeColor: logic.bannerList.length == 1
|
||||
? Color(0x00FFFFFF)
|
||||
: Color(0xFFFF4D7C), // 当前索引小圆点的颜色
|
||||
: Color(0x00FFFFFF), // 当前索引小圆点的颜色
|
||||
),
|
||||
),
|
||||
// control: new SwiperControl(), //左右的那个箭头,在某模拟器中会出现蓝线
|
||||
@ -528,16 +527,16 @@ class _CirclePageState extends State<CirclePage>
|
||||
Widget circleList(CircleLogic controller) {
|
||||
return Swiper(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var bean = logic.circle.lists[index];
|
||||
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||
return InfoListView(index, bean, logic);
|
||||
var bean = logic.circle.lists[index];
|
||||
// final GlobalKey<InfoListViewState> infoListViewKey = GlobalKey<InfoListViewState>();
|
||||
return InfoListView(index, bean, logic);
|
||||
},
|
||||
onIndexChanged: (index) {
|
||||
controller.state.index = index;
|
||||
if (index == logic.circle.lists.length - 1) {
|
||||
logic.loadMore();
|
||||
}
|
||||
print(index.toString());
|
||||
controller.state.index = index;
|
||||
if (index == logic.circle.lists.length - 1) {
|
||||
logic.loadMore();
|
||||
}
|
||||
print(index.toString());
|
||||
},
|
||||
index: controller.state.index,
|
||||
itemCount: logic.circle.lists.length,
|
||||
@ -590,23 +589,67 @@ class _CirclePageState extends State<CirclePage>
|
||||
left: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.VisitorListActivity);
|
||||
Get.toNamed(AppRoutes.Invite);
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 30.sp * widgets.length,
|
||||
height: 44.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.centerLeft,
|
||||
children: widgets,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(0.6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 5.sp,
|
||||
bottom: 4.sp,
|
||||
left: 8.sp,
|
||||
right: 8.sp,
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
"邀请得会员",
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
))
|
||||
|
||||
// Positioned(
|
||||
// left: 0,
|
||||
// child: GestureDetector(
|
||||
// onTap: () {
|
||||
// Get.toNamed(AppRoutes.VisitorListActivity);
|
||||
// },
|
||||
// child: SizedBox(
|
||||
// width: 30.sp * widgets.length,
|
||||
// height: 44.sp,
|
||||
// child: Stack(
|
||||
// alignment: Alignment.centerLeft,
|
||||
// children: widgets,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
: GestureDetector(
|
||||
onTap: (){
|
||||
showCityPiker(context);
|
||||
},
|
||||
child: Row(
|
||||
onTap: () {
|
||||
showCityPiker(context);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('icon_city'),
|
||||
@ -615,13 +658,13 @@ class _CirclePageState extends State<CirclePage>
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 4.sp, top: 4.sp),
|
||||
child: Text(
|
||||
logic.cityName,
|
||||
modifyCityName(logic.cityName),
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
//padding: EdgeInsets.symmetric(horizontal: 10.sp),
|
||||
@ -633,7 +676,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
labelPadding: EdgeInsets.symmetric(horizontal: 13.0),
|
||||
labelPadding: EdgeInsets.symmetric(horizontal: 13.0),
|
||||
indicator: UnderlineTabIndicator(
|
||||
borderSide: BorderSide(
|
||||
color: const Color(0xFF00FFF4),
|
||||
@ -653,7 +696,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
'发现',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -662,7 +704,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
'附近',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -675,17 +716,16 @@ class _CirclePageState extends State<CirclePage>
|
||||
color: const Color(0xFFF657FF).withOpacity(0.5),
|
||||
offset: Offset(0, -2), // 阴影偏移
|
||||
blurRadius: 3, // 阴影模糊半径
|
||||
// spreadRadius: 0
|
||||
|
||||
// spreadRadius: 0
|
||||
),
|
||||
],
|
||||
),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
// color: const Color(0xB3FFFFFF),
|
||||
// color: const Color(0xB3FFFFFF),
|
||||
fontSize: 18.sp,
|
||||
shadows: [
|
||||
Shadow(
|
||||
// color: const Color(0xFFF657FF),
|
||||
// color: const Color(0xFFF657FF),
|
||||
offset: const Offset(0, -1),
|
||||
blurRadius: 3.0.sp,
|
||||
),
|
||||
@ -763,8 +803,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
orientationList: logic.orientationList,
|
||||
roleList: logic.roleList,
|
||||
callback: (genderList, orientationList, roleList) {
|
||||
logic.offset = 0;
|
||||
logic.getNearByList();
|
||||
_onRefresh();
|
||||
},
|
||||
); // Use your custom widget here
|
||||
},
|
||||
@ -995,32 +1034,87 @@ class _CirclePageState extends State<CirclePage>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
showCityPiker(context) {
|
||||
Pickers.showMultiLinkPicker(context,
|
||||
pickerStyle: DefaultPickerStyle.dark(), data: logic.cityMap, columeNum: 2,
|
||||
onConfirm: (List res, List<int> position){
|
||||
print(res);
|
||||
// print(logic.cityMap[res[0]][res[1]][0]);
|
||||
// controller.state.city = controller.cityMap[res[0]][res[1]][0];
|
||||
// logic.state.city = res[1];
|
||||
logic.cityName = res[1];
|
||||
pickerStyle: DefaultPickerStyle.dark(),
|
||||
data: logic.cityMap,
|
||||
columeNum: 2, onConfirm: (List res, List<int> position) {
|
||||
print(res);
|
||||
// print(logic.cityMap[res[0]][res[1]][0]);
|
||||
// controller.state.city = controller.cityMap[res[0]][res[1]][0];
|
||||
// logic.state.city = res[1];
|
||||
logic.cityName = res[1];
|
||||
|
||||
logic.offset = 0;
|
||||
logic.getNearByList();
|
||||
// logic.getSuccess();
|
||||
// logic.update();
|
||||
}
|
||||
_onRefresh();
|
||||
// logic.getSuccess();
|
||||
// logic.update();
|
||||
}
|
||||
|
||||
// onConfirm:(String province, String city, String? town){
|
||||
// controller.state.role = city;
|
||||
// controller.update();
|
||||
//
|
||||
// }
|
||||
// onConfirm:(String province, String city, String? town){
|
||||
// controller.state.role = city;
|
||||
// controller.update();
|
||||
//
|
||||
// }
|
||||
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
String modifyCityName(String cityName) {
|
||||
if (cityName.endsWith("市")) {
|
||||
cityName = cityName.substring(0, cityName.length - 1);
|
||||
}
|
||||
|
||||
if (cityName.length > 4) {
|
||||
cityName = cityName.substring(0, 4) + "...";
|
||||
}
|
||||
|
||||
return cityName;
|
||||
}
|
||||
}
|
||||
|
||||
class DefaultPickerStyle extends PickerStyle {
|
||||
DefaultPickerStyle({bool haveRadius: false, String? title}) {
|
||||
if (haveRadius) {
|
||||
this.headDecoration = BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(10), topRight: Radius.circular(10)));
|
||||
}
|
||||
if (title != null && title != '') {
|
||||
this.title = Center(
|
||||
child:
|
||||
Text(title, style: TextStyle(color: Colors.grey, fontSize: 14)));
|
||||
}
|
||||
}
|
||||
|
||||
/// 夜间
|
||||
DefaultPickerStyle.dark({bool haveRadius: false, String? title}) {
|
||||
this.commitButton = Container(
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.only(left: 12, right: 22),
|
||||
child: Text('确定', style: TextStyle(color: Colors.white, fontSize: 16.0)),
|
||||
);
|
||||
|
||||
this.cancelButton = Container(
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.only(left: 22, right: 12),
|
||||
child: Text('取消', style: TextStyle(color: Colors.white, fontSize: 16.0)),
|
||||
);
|
||||
|
||||
this.headDecoration = BoxDecoration(
|
||||
color: Color(0xFF4A3E5D),
|
||||
borderRadius: !haveRadius
|
||||
? null
|
||||
: BorderRadius.only(
|
||||
topLeft: Radius.circular(10), topRight: Radius.circular(10)));
|
||||
|
||||
if (title != null && title != '') {
|
||||
this.title = Center(
|
||||
child:
|
||||
Text(title, style: TextStyle(color: Colors.white, fontSize: 14)));
|
||||
}
|
||||
|
||||
this.backgroundColor = Color(0xFF4A3E5D)!;
|
||||
this.textColor = Colors.white;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -23,6 +23,7 @@ double myProgress = 0;
|
||||
|
||||
class _CustomDialogState extends State<UpdateDialog> {
|
||||
bool isDownload = false;
|
||||
bool isShowWeb = false;
|
||||
|
||||
void incrementCounter() {}
|
||||
|
||||
@ -111,42 +112,78 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
onTap: () async {
|
||||
//incrementCounter();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
child: CircularProgressIndicator(
|
||||
value: myProgress,
|
||||
backgroundColor: Colors.grey,
|
||||
valueColor: const AlwaysStoppedAnimation<Color>(
|
||||
Color(0xFF30FFD9)),
|
||||
strokeWidth: 4.0.sp,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 4.sp),
|
||||
child: CircularProgressIndicator(
|
||||
value: myProgress,
|
||||
backgroundColor: Colors.grey,
|
||||
valueColor:
|
||||
const AlwaysStoppedAnimation<Color>(
|
||||
Color(0xFF30FFD9)),
|
||||
strokeWidth: 4.0.sp,
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final String appStoreUrl = widget.updateInfo
|
||||
.downloadUrl; // App Store链接示例
|
||||
|
||||
if (await canLaunch(appStoreUrl)) {
|
||||
await launch(appStoreUrl,
|
||||
forceSafariVC: false);
|
||||
} else {
|
||||
throw 'Could not open App Store.';
|
||||
}
|
||||
},
|
||||
child:isShowWeb? Container(
|
||||
margin: EdgeInsets.only(top: 4.sp),
|
||||
child: Text(
|
||||
"下载太慢?试试游览器下载吧。",
|
||||
style: TextStyle(
|
||||
color: Colors.blue, // 设置蓝色颜色
|
||||
decoration:
|
||||
TextDecoration.underline, // 添加下划线
|
||||
),
|
||||
),
|
||||
): Container(),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () async {
|
||||
if (Platform.isIOS) {
|
||||
final String appStoreUrl = widget.updateInfo.downloadUrl; // App Store链接示例
|
||||
final String appStoreUrl = widget
|
||||
.updateInfo.downloadUrl; // App Store链接示例
|
||||
if (await canLaunch(appStoreUrl)) {
|
||||
await launch(appStoreUrl,forceSafariVC : false);
|
||||
await launch(appStoreUrl,
|
||||
forceSafariVC: false);
|
||||
} else {
|
||||
throw 'Could not open App Store.';
|
||||
}
|
||||
} else {
|
||||
final String appStoreUrl = widget
|
||||
.updateInfo.downloadUrl; // App Store链接示例
|
||||
|
||||
final String appStoreUrl = widget.updateInfo.downloadUrl; // App Store链接示例
|
||||
|
||||
if(appStoreUrl.contains("apk")){
|
||||
if (appStoreUrl.contains("apk")) {
|
||||
updataApk(appStoreUrl);
|
||||
setDownloadUi();
|
||||
}else{
|
||||
await Future.delayed(Duration(seconds: 10));
|
||||
setState(() {
|
||||
isShowWeb = true;
|
||||
});
|
||||
|
||||
} else {
|
||||
if (await canLaunch(appStoreUrl)) {
|
||||
await launch(appStoreUrl,forceSafariVC : false);
|
||||
await launch(appStoreUrl,
|
||||
forceSafariVC: false);
|
||||
} else {
|
||||
throw 'Could not open App Store.';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Navigator.pop(context);
|
||||
@ -188,12 +225,17 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
Positioned(
|
||||
right: 8.sp,
|
||||
top: 8.sp,
|
||||
child: widget.isDismiss? GestureDetector(
|
||||
onTap: (){
|
||||
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Icon(Icons.close,color: Colors.white,size: 24.sp,)):Container())
|
||||
child: widget.isDismiss
|
||||
? GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
color: Colors.white,
|
||||
size: 24.sp,
|
||||
))
|
||||
: Container())
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -218,7 +260,7 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
// SmartDialog.dismiss();
|
||||
print(error);
|
||||
});
|
||||
// await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'dart:ffi';
|
||||
@ -18,6 +19,7 @@ import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../util/eventBus.dart';
|
||||
import '../../view/notice.dart';
|
||||
import '../circle/view.dart';
|
||||
import '../dialog/UpdateDialog.dart';
|
||||
import '../minefragment/view.dart';
|
||||
@ -58,7 +60,55 @@ class HomeLogic extends GetxController {
|
||||
print("收到新消息" + text);
|
||||
unreadSIze.value = (int.parse(unreadSIze.value) + 1).toString();
|
||||
//getUnreadSize();
|
||||
}, onRecvC2CCustomMessage: (
|
||||
String msgID,
|
||||
V2TimUserInfo sender,
|
||||
String customData,
|
||||
) {
|
||||
|
||||
if (sender.userID == "qpqz_dev_10_10000000000" ||
|
||||
sender.userID == "qpqz_prod_10_10000000000") {
|
||||
if(customData.isEmpty){
|
||||
return;
|
||||
}
|
||||
|
||||
print("123123123123"+customData);
|
||||
Map<String, dynamic> jsonData = json.decode(customData);
|
||||
int event = jsonData['event'];
|
||||
Map<String, dynamic> content = jsonData['content'];
|
||||
switch(event){
|
||||
case 1://关注
|
||||
String ageMsg = "${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
|
||||
if(content['isFollow']==1){//互关
|
||||
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],3,(){
|
||||
pushChatPage(content['id'].toString(), content['imId'],
|
||||
content['nickname']);
|
||||
});
|
||||
}else{
|
||||
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],1,(){
|
||||
setLike(content['id'].toString());
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
case 2://上线
|
||||
|
||||
String ageMsg = "${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
|
||||
|
||||
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],2,(){
|
||||
pushChatPage(content['id'].toString(), content['imId'],
|
||||
content['nickname']);
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_messageService.addSimpleMsgListener(listener: msgListener);
|
||||
|
||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||
@ -68,7 +118,19 @@ class HomeLogic extends GetxController {
|
||||
showReportDialog(Get.context!, bean.data.constraint == 0, bean.data);
|
||||
}
|
||||
}
|
||||
|
||||
setLike(String userId) async {
|
||||
var data = await DioManager.instance.post(
|
||||
url: "${Api.setLike + userId}/follow",
|
||||
params: {'status': "1"});
|
||||
var bean = BaseResponse<dynamic>.fromJson(
|
||||
data,
|
||||
(jsonData) => jsonData,
|
||||
);
|
||||
if (bean.isSuccess()) {
|
||||
update();
|
||||
}
|
||||
showOKToast(bean.msg);
|
||||
}
|
||||
getUnreadSize() async {
|
||||
V2TimValueCallback<int> getTotalUnreadMessageCountRes =
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
|
||||
@ -26,49 +26,40 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
|
||||
super.build(context);
|
||||
|
||||
return GetBuilder(builder: (HomeLogic controller) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
controller.onReady();
|
||||
// Get.toNamed(AppRoutes.Complete_materialPage);
|
||||
},
|
||||
child: ExitAppConfirmation(child: Stack(children: [
|
||||
Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
|
||||
bottomNavigationBar: Container(
|
||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
width: Get.width,
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(left: 50.sp, right: 50.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
getTabbarImage('tabbar_bg'),
|
||||
))),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
funcItem(0, 'msg', 0 == controller.currentIndex, controller),
|
||||
funcItem(1, 'circle', 1 == controller.currentIndex, controller),
|
||||
funcItem(2, 'mine', 2 == controller.currentIndex, controller),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: PageView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
controller: controller.pageController,
|
||||
onPageChanged: (int index) {
|
||||
// controller.updateIndex(index);
|
||||
},
|
||||
children: controller.tabs,
|
||||
),
|
||||
return ExitAppConfirmation(child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
|
||||
bottomNavigationBar: Container(
|
||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
width: Get.width,
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(left: 50.sp, right: 50.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
getTabbarImage('tabbar_bg'),
|
||||
))),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
funcItem(0, 'msg', 0 == controller.currentIndex, controller),
|
||||
funcItem(1, 'circle', 1 == controller.currentIndex, controller),
|
||||
funcItem(2, 'mine', 2 == controller.currentIndex, controller),
|
||||
],
|
||||
),
|
||||
|
||||
],),)
|
||||
);
|
||||
),
|
||||
body: PageView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
controller: controller.pageController,
|
||||
onPageChanged: (int index) {
|
||||
// controller.updateIndex(index);
|
||||
},
|
||||
children: controller.tabs,
|
||||
),
|
||||
),);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -40,6 +40,9 @@ class InvitePage extends StatelessWidget {
|
||||
child: Image.asset(getMineImage('invite_right_icon'),
|
||||
),
|
||||
),
|
||||
onPressed: (){
|
||||
navigateToInviteStrategy();
|
||||
},
|
||||
),
|
||||
body: GetBuilder<InviteLogic>(builder: (logic) {
|
||||
List<Widget> peopleCountList = [];
|
||||
|
||||
@ -29,7 +29,7 @@ class MinefragmentLogic extends GetxController {
|
||||
|
||||
String enterHomeInfoMsg = "进入主页";
|
||||
String joinedCircle = "";
|
||||
String vipMsg = "九大专属特权等你领取";
|
||||
String vipMsg = "十几种专属特权等你领取";
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
|
||||
@ -64,12 +64,12 @@ class MinefragmentPage extends StatelessWidget {
|
||||
child: Stack(children: [
|
||||
MyImageWidget,
|
||||
Positioned(
|
||||
top: 58.sp,
|
||||
left: 90.sp,
|
||||
top: 54.sp,
|
||||
left: 72.sp,
|
||||
child: Text(logic.vipMsg,style: TextStyle(color: const Color(0x99FFFFFF),fontSize: 12.sp),)),
|
||||
Positioned(
|
||||
top: 32.sp,
|
||||
left: 90.sp,
|
||||
top: 26.sp,
|
||||
left: 70.sp,
|
||||
child: Text("会员-微乐园贵宾",style: TextStyle(color: const Color(0xFFFFFFFF),fontSize: 16.sp),))
|
||||
],),
|
||||
),
|
||||
|
||||
@ -211,6 +211,16 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
.where(
|
||||
(element) => (element?.groupID != null || element?.userID != null))
|
||||
.toList();
|
||||
|
||||
// 过滤指定的 userID
|
||||
String devtTargetUserID = "qpqz_dev_10_10000000000";
|
||||
String prodTargetUserID = "qpqz_dev_10_10000000000";
|
||||
filteredConversationList = filteredConversationList
|
||||
.where((conversation) =>
|
||||
conversation?.userID != devtTargetUserID ||conversation?.userID != prodTargetUserID)
|
||||
.toList();
|
||||
|
||||
|
||||
if (widget.conversationCollector != null) {
|
||||
filteredConversationList = filteredConversationList
|
||||
.where(widget.conversationCollector!)
|
||||
|
||||
@ -252,22 +252,20 @@ class MsgPage extends StatelessWidget {
|
||||
width: Get.width,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
getMsgImage('msg_first'),
|
||||
width: 50.sp,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'抢占第一',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
getMsgImage('msg_first'),
|
||||
width: 50.sp,
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'抢占第一',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
|
||||
@ -23,31 +23,26 @@ class SplashLogic extends GetxController {
|
||||
void onReady() async {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
// await Future.delayed(Duration(seconds: 30));
|
||||
// await Future.delayed(Duration(seconds: 30));
|
||||
if ((await getAuthorization()).isEmpty) {
|
||||
if(Platform.isIOS){
|
||||
if (Platform.isIOS) {
|
||||
pushLoginPage();
|
||||
return;
|
||||
}
|
||||
bool isAgreemement = await getAgreemement();
|
||||
if(!isAgreemement){
|
||||
if (!isAgreemement) {
|
||||
showReportDialog();
|
||||
}else{
|
||||
} else {
|
||||
pushLoginPage();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
var data =
|
||||
await DioManager.instance.put(url: Api.refreshToken, params: {});
|
||||
await DioManager.instance.put(url: Api.refreshToken, params: {});
|
||||
var bean = BaseResponse<LoginData>.fromJson(
|
||||
data, (data) => LoginData.fromJson(data));
|
||||
if (bean.code == 200) {
|
||||
@ -65,7 +60,10 @@ class SplashLogic extends GetxController {
|
||||
});
|
||||
|
||||
return;
|
||||
} else if(bean.code == 5000||bean.code == 5001||bean.code == 5002||bean.code == 5003){
|
||||
} else if (bean.code == 5000 ||
|
||||
bean.code == 5001 ||
|
||||
bean.code == 5002 ||
|
||||
bean.code == 5003) {
|
||||
pushLoginPage();
|
||||
return;
|
||||
}
|
||||
@ -73,7 +71,7 @@ class SplashLogic extends GetxController {
|
||||
if (bean.code == 500) {
|
||||
await Future.delayed(Duration(seconds: 5));
|
||||
onInit();
|
||||
}else {
|
||||
} else {
|
||||
pushLoginPage();
|
||||
}
|
||||
|
||||
@ -81,7 +79,6 @@ class SplashLogic extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void showReportDialog() {
|
||||
FlutterNativeSplash.remove();
|
||||
showDialog(
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@ -15,6 +17,7 @@ import '../../util/SharedPreferencesHelper.dart';
|
||||
import '../../util/eventBus.dart';
|
||||
import '../../util/qiniu.dart';
|
||||
import '../../util/util.dart';
|
||||
import '../../view/notice.dart';
|
||||
import '../dialog/BaseDialog.dart';
|
||||
import 'state.dart';
|
||||
|
||||
@ -41,6 +44,12 @@ class UserinfoLogic extends GetxController {
|
||||
bool isDestroy = false;
|
||||
final startTime = DateTime.now();
|
||||
SharedPreferences? sharedPreferences;
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
timer?.cancel();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
@ -74,6 +83,10 @@ class UserinfoLogic extends GetxController {
|
||||
fetchQnToken(Api.getqiniuToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void showBlackDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
@ -98,6 +111,7 @@ class UserinfoLogic extends GetxController {
|
||||
if (bean.isSuccess()) {
|
||||
isMe = userId.isEmpty;
|
||||
isLike = bean.data.isFollow;
|
||||
|
||||
isLikeFoMsg =
|
||||
"${bean.data.likeMeCount}位圈友感兴趣,其中${bean.data.imageUrgeCount}位已催您更新";
|
||||
userInfoBean = bean.data.user;
|
||||
@ -107,6 +121,9 @@ class UserinfoLogic extends GetxController {
|
||||
if (isMe) {
|
||||
isOnline = true;
|
||||
} else {
|
||||
if(!isLike){
|
||||
startCountdown();
|
||||
}
|
||||
isOnline = userInfoBean!.isOnline;
|
||||
isBlackBeen = bean.data.isBlock;
|
||||
isDestroy = bean.data.isDestroy;
|
||||
@ -130,6 +147,27 @@ class UserinfoLogic extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
int countdown = 5;
|
||||
Timer? timer = null;
|
||||
|
||||
startCountdown(){
|
||||
|
||||
timer = Timer.periodic(const Duration(seconds: 1), (t) {
|
||||
if (countdown > 0) {
|
||||
countdown--;
|
||||
} else {
|
||||
showFloatingButtonOverlay(Get.context!,userInfoBean!.nickname!,ageMsg,userInfoBean!.avatarThumb,0,(){
|
||||
setLike();
|
||||
});
|
||||
|
||||
timer?.cancel(); // 倒计时结束,取消定时器
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Future<void> fetchMyAlbum(String url) async {
|
||||
var myAlbumData = await DioManager.instance.get(url: url);
|
||||
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(
|
||||
@ -196,6 +234,8 @@ class UserinfoLogic extends GetxController {
|
||||
(jsonData) => jsonData,
|
||||
);
|
||||
if (bean.isSuccess()) {
|
||||
|
||||
timer?.cancel();
|
||||
isLike = !isLike;
|
||||
update();
|
||||
}
|
||||
|
||||
@ -4,11 +4,11 @@ import 'package:circle_app/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../components/my_app_bar.dart';
|
||||
import '../../router/app_routers.dart';
|
||||
import '../../util/util.dart';
|
||||
import '../select_circle/logic.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class UserinfoPage extends StatefulWidget {
|
||||
@ -70,26 +70,46 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: logic.userInfoBean != null
|
||||
? "${logic.userInfoBean!.nickname}的主页"
|
||||
: "个人主页",
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
child: Stack(
|
||||
children: [
|
||||
Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: logic.userInfoBean != null
|
||||
? "${logic.userInfoBean!.nickname}的主页"
|
||||
: "个人主页",
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
child: buildContent(logic),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 27.sp,
|
||||
width: Get.width,
|
||||
child: _meInfoButton(logic),
|
||||
),
|
||||
!logic.isShowAlbum &&logic.isMe ? Positioned(
|
||||
bottom: 36.sp,
|
||||
right: 10.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
|
||||
Container(
|
||||
child: buildContent(logic),
|
||||
List<MyConfigData> numbers = [];
|
||||
|
||||
var data = await Get.toNamed(
|
||||
AppRoutes.Call_out,
|
||||
arguments: {'numbers': numbers});
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('send_msg'),
|
||||
width: 60.sp,
|
||||
))):Container()
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
bottom: 27.sp,
|
||||
width: Get.width,
|
||||
child: _meInfoButton(logic),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -172,7 +192,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
|
||||
final chatButton = GestureDetector(
|
||||
onTap: () {
|
||||
if(logic.isBlack||logic.isDestroy||logic.isBlackBeen){
|
||||
if (logic.isBlack || logic.isDestroy || logic.isBlackBeen) {
|
||||
showOKToast("私聊失败,存在拉黑关系或者该账户已注销");
|
||||
return;
|
||||
}
|
||||
@ -249,7 +269,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 19.sp,
|
||||
),
|
||||
@ -267,7 +287,9 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.sp),
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): _buildInfoRow(controller),
|
||||
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||
? Container()
|
||||
: _buildInfoRow(controller),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
@ -283,15 +305,17 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
: const Color(0xFF787575),
|
||||
),
|
||||
),
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): Text(
|
||||
controller.onLineCity,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: logic.isOnline
|
||||
? const Color(0xFF00FFF4)
|
||||
: const Color(0xFF787575),
|
||||
),
|
||||
),
|
||||
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||
? Container()
|
||||
: Text(
|
||||
controller.onLineCity,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: logic.isOnline
|
||||
? const Color(0xFF00FFF4)
|
||||
: const Color(0xFF787575),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
@ -299,7 +323,9 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
),
|
||||
SizedBox(
|
||||
height: 59.sp,
|
||||
child: logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): _buildInterestsListView(interests),
|
||||
child: logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||
? Container()
|
||||
: _buildInterestsListView(interests),
|
||||
),
|
||||
titleTab(controller),
|
||||
Expanded(
|
||||
@ -309,8 +335,12 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
_tabController.animateTo(index);
|
||||
},
|
||||
children: [
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container():_imageAdapter(controller),
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): HomeCallOutView(controller.userId),
|
||||
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||
? Container()
|
||||
: _imageAdapter(controller),
|
||||
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||
? Container()
|
||||
: HomeCallOutView(controller.userId),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -327,7 +357,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
itemBuilder: (context, index) {
|
||||
final interest = interests[index];
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.Signal_circle_list,
|
||||
arguments: interests[index].id);
|
||||
},
|
||||
@ -411,49 +441,51 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
);
|
||||
},
|
||||
),
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector(
|
||||
onTap: () {
|
||||
if (controller.isMe) {
|
||||
controller.isEdit = !controller.isEdit;
|
||||
controller.update();
|
||||
} else {
|
||||
controller.urgeChange();
|
||||
}
|
||||
},
|
||||
child: Visibility(
|
||||
visible: logic.isShowAlbum,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
if (controller.isMe) {
|
||||
controller.isEdit = !controller.isEdit;
|
||||
controller.update();
|
||||
} else {
|
||||
controller.urgeChange();
|
||||
}
|
||||
},
|
||||
child: Visibility(
|
||||
visible: logic.isShowAlbum,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 2.sp,
|
||||
horizontal: 12.sp,
|
||||
),
|
||||
child: Text(
|
||||
controller.isMe
|
||||
? controller.isEdit
|
||||
? "完成"
|
||||
: "管理"
|
||||
: controller.isUrgeStatus
|
||||
? "已催更"
|
||||
: "催更",
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 2.sp,
|
||||
horizontal: 12.sp,
|
||||
),
|
||||
child: Text(
|
||||
controller.isMe
|
||||
? controller.isEdit
|
||||
? "完成"
|
||||
: "管理"
|
||||
: controller.isUrgeStatus
|
||||
? "已催更"
|
||||
: "催更",
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -463,7 +495,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
//print(controller.state.imaglist);
|
||||
|
||||
// :
|
||||
return Container(
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 19.sp),
|
||||
child: Stack(
|
||||
children: [
|
||||
@ -599,7 +631,8 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
const SizedBox(width: 6),
|
||||
if (controller.isVip > 0)
|
||||
Image(
|
||||
image: AssetImage(getBaseImage( controller.isVip == 1 ? "vip" : 'year_vip')),
|
||||
image: AssetImage(
|
||||
getBaseImage(controller.isVip == 1 ? "vip" : 'year_vip')),
|
||||
width: 44.sp,
|
||||
height: 18.sp,
|
||||
),
|
||||
|
||||
@ -344,9 +344,9 @@ class _HomeCallOutViewState extends State<HomeCallOutView> with AutomaticKeepAli
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
lists.create_time!,
|
||||
"",
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
color: Colors.white, fontSize: 1.sp),
|
||||
),
|
||||
widget.userId.isNotEmpty
|
||||
? Container()
|
||||
@ -605,7 +605,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView> with AutomaticKeepAli
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
lists.create_time!,
|
||||
"",
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
|
||||
@ -83,7 +83,7 @@ class Open_vip_tipPage extends StatelessWidget {
|
||||
Positioned(
|
||||
top: 24.sp,
|
||||
child: Text(
|
||||
'会员九大特权',
|
||||
'十几种专属会员特权',
|
||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
)),
|
||||
Positioned(
|
||||
|
||||
@ -51,6 +51,15 @@ loginIM(String userId, String sig) async {
|
||||
);
|
||||
if (info.code == 0) {
|
||||
uploadBuzIDAndToken();
|
||||
V2TimCallback setC2CReceiveMessageOptRes = await TencentImSDKPlugin
|
||||
.v2TIMManager
|
||||
.getMessageManager()
|
||||
.setC2CReceiveMessageOpt(
|
||||
userIDList: ['qpqz_dev_10_10000000000','qpqz_prod_10_10000000000'], // 需要设置的用户id列表
|
||||
opt: ReceiveMsgOptEnum.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE); // 用户消息接收选项属性
|
||||
if (setC2CReceiveMessageOptRes.code == 0) {
|
||||
//设置成功
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -434,8 +443,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
Widget build(BuildContext context) {
|
||||
//填入设计稿中设备的屏幕尺寸,单位dp
|
||||
// configureDio();
|
||||
return
|
||||
ScreenUtilInit(
|
||||
return ScreenUtilInit(
|
||||
designSize: const Size(375, 812),
|
||||
minTextAdapt: true,
|
||||
splitScreenMode: true,
|
||||
|
||||
@ -45,7 +45,8 @@ class DioManager {
|
||||
// 接收数据的最长时限
|
||||
receiveTimeout: const Duration(seconds: 300),
|
||||
));
|
||||
_dio!.interceptors.add(LogInterceptor(responseBody: true));
|
||||
_dio!.interceptors.add(LogInterceptor(responseBody: true,
|
||||
));
|
||||
// _dio!.interceptors.add(ConnectivityInterceptor());
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:ui';
|
||||
|
||||
@ -13,6 +14,8 @@ import 'package:path_provider/path_provider.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:video_compress/video_compress.dart';
|
||||
|
||||
import '../app/circle/logic.dart';
|
||||
import '../app/select_circle/logic.dart';
|
||||
import 'SharedPreferencesHelper.dart';
|
||||
|
||||
class Util {}
|
||||
@ -154,8 +157,10 @@ String convertToTenThousand(int number) {
|
||||
pushLoginPage() async {
|
||||
await logoutIM();
|
||||
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
bool agreement = sharedPreferences.getBool(SharedPreferencesHelper.AGREEMENT)??false;
|
||||
String loginPhone = sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE)??"";
|
||||
bool agreement =
|
||||
sharedPreferences.getBool(SharedPreferencesHelper.AGREEMENT) ?? false;
|
||||
String loginPhone =
|
||||
sharedPreferences.getString(SharedPreferencesHelper.LOGINPHONE) ?? "";
|
||||
print(loginPhone);
|
||||
sharedPreferences.clear();
|
||||
sharedPreferences.setString(SharedPreferencesHelper.LOGINPHONE, loginPhone);
|
||||
@ -278,10 +283,8 @@ class CustomLoadFooter extends StatelessWidget {
|
||||
failedText: "加载失败",
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 获取应用程序的文档目录路径
|
||||
Future<String> getApplicationDocumentsDirectoryPath() async {
|
||||
final directory = await getApplicationDocumentsDirectory();
|
||||
@ -306,13 +309,11 @@ Future<String> getLibraryDirectoryPath() async {
|
||||
return directory.path;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//跳转到文明公约
|
||||
void navigateToCodeOfConduct() {
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "文明公约",
|
||||
"url": "https://docs.qq.com/doc/DZUtoZ3V0S3ltY2Zw"
|
||||
"url": "https://docs.qq.com/doc/DZUtoZ3V0S3ltY2Zw"
|
||||
});
|
||||
}
|
||||
|
||||
@ -320,7 +321,9 @@ void navigateToCodeOfConduct() {
|
||||
void navigateToUserAgreement() {
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "用户协议",
|
||||
"url": Platform.isIOS?"https://docs.qq.com/doc/DZVV1SkttZGlPUW1H":"https://iquanpai.com/app-h5/4_163.html"
|
||||
"url": Platform.isIOS
|
||||
? "https://docs.qq.com/doc/DZVV1SkttZGlPUW1H"
|
||||
: "https://iquanpai.com/app-h5/4_163.html"
|
||||
});
|
||||
}
|
||||
|
||||
@ -328,14 +331,19 @@ void navigateToUserAgreement() {
|
||||
void navigateToPrivacyPolicy() {
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "隐私协议",
|
||||
"url": Platform.isIOS?"https://docs.qq.com/doc/DZXhvcXV6b1RNTUx1":"https://iquanpai.com/app-h5/4_164.html"
|
||||
"url": Platform.isIOS
|
||||
? "https://docs.qq.com/doc/DZXhvcXV6b1RNTUx1"
|
||||
: "https://iquanpai.com/app-h5/4_164.html"
|
||||
});
|
||||
}
|
||||
|
||||
//发布内容规范
|
||||
void navigateToContentGuidelines() {
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "发布内容规范",
|
||||
"url": Platform.isIOS?"https://docs.qq.com/doc/DZVhLamZDQnJ0eHds":"https://iquanpai.com/app-h5/4_165.html"
|
||||
"url": Platform.isIOS
|
||||
? "https://docs.qq.com/doc/DZVhLamZDQnJ0eHds"
|
||||
: "https://iquanpai.com/app-h5/4_165.html"
|
||||
});
|
||||
}
|
||||
|
||||
@ -343,8 +351,57 @@ void navigateToContentGuidelines() {
|
||||
void navigateToPartnerAgreement() {
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "合伙人协议",
|
||||
"url": Platform.isIOS?"https://docs.qq.com/doc/DZUpwWFdNcGlsYld4":"https://iquanpai.com/app-h5/4_166.html"
|
||||
"url": Platform.isIOS
|
||||
? "https://docs.qq.com/doc/DZUpwWFdNcGlsYld4"
|
||||
: "https://iquanpai.com/app-h5/4_166.html"
|
||||
});
|
||||
}
|
||||
|
||||
//邀请攻略
|
||||
void navigateToInviteStrategy() {
|
||||
Get.toNamed(AppRoutes.WebViewActivity, arguments: {
|
||||
'title': "邀请攻略",
|
||||
"url": "https://leyuan666.com/app-h5/4_168.html"
|
||||
});
|
||||
}
|
||||
|
||||
void navigateToCustomRoute(BannerItem bannerItem) {
|
||||
print(bannerItem.param);
|
||||
switch (bannerItem.type) {
|
||||
case 1:
|
||||
Get.toNamed(AppRoutes.WebViewActivity,
|
||||
arguments: {'title': "", "url": bannerItem.param.toString()});
|
||||
break;
|
||||
case 2:
|
||||
switch (bannerItem.scene) {
|
||||
case "scene_2":
|
||||
List<MyConfigData> numbers = [];
|
||||
if(bannerItem.param!.isNotEmpty){
|
||||
String paramJson = bannerItem.param.toString();
|
||||
paramJson = paramJson.replaceAll(r'\', ''); // 去除反斜杠转义
|
||||
Map<String, dynamic> jsonData = json.decode(paramJson);
|
||||
numbers.add(MyConfigData(jsonData['id'].toString(), jsonData['name'], false));
|
||||
}
|
||||
Get.toNamed(AppRoutes.Call_out, arguments: {'numbers': numbers});
|
||||
break;
|
||||
case "scene_3":
|
||||
Get.toNamed(AppRoutes.FeedbackActivity);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (bannerItem.scene) {
|
||||
case "scene_1":
|
||||
Get.toNamed(AppRoutes.Invite);
|
||||
break;
|
||||
case "scene_4":
|
||||
if(bannerItem.param!.isEmpty){
|
||||
Get.toNamed(AppRoutes.UserInfoActivity);
|
||||
}else{
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: bannerItem.param.toString());
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
181
circle_app/lib/view/notice.dart
Normal file
181
circle_app/lib/view/notice.dart
Normal file
@ -0,0 +1,181 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
typedef void NoticeCallback();
|
||||
|
||||
|
||||
void showFloatingButtonOverlay(
|
||||
BuildContext context, String nickname, String ageMsg, String avatar,int event,NoticeCallback noticeCallback) {
|
||||
OverlayState? overlayState = Overlay.of(context);
|
||||
late OverlayEntry overlayEntry;
|
||||
bool showMessage = false;
|
||||
|
||||
int countdownSeconds = 8; // 倒计时秒数
|
||||
|
||||
// 创建 Timer
|
||||
late Timer countdownTimer;
|
||||
|
||||
// 创建 OverlayEntry
|
||||
overlayEntry = OverlayEntry(
|
||||
builder: (BuildContext context) {
|
||||
return Positioned(
|
||||
top: 30,
|
||||
// right: 16,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 500),
|
||||
curve: Curves.easeInOut,
|
||||
height: showMessage ? 95 : 0,
|
||||
child: Container(
|
||||
width: Get.width - 16,
|
||||
margin: EdgeInsets.all(10.sp),
|
||||
padding: EdgeInsets.fromLTRB(16.sp, 16.sp, 16.sp, 0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: const Color(0xFF353443),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ClipOval(
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
placeholder: null,
|
||||
imageUrl: avatar,
|
||||
width: 48.sp,
|
||||
height: 48.sp,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 50.sp,
|
||||
child: Text(
|
||||
nickname,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
color: Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.sp),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color.fromRGBO(141, 255, 248, 1.0),
|
||||
Color.fromRGBO(181, 211, 255, 1.0),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text( event == 0
|
||||
? "看了这么久,给我点个喜欢呗~"
|
||||
: event == 1
|
||||
? "我喜欢了你,可以喜欢我一下吗?"
|
||||
: event == 2
|
||||
? "你喜欢的人上线啦,赶紧找他聊天吧!"
|
||||
: "我也喜欢了你,一起聊聊呗~",
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 12.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,
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
// setState(() {});
|
||||
showMessage = true;
|
||||
countdownTimer = Timer.periodic(Duration(seconds: 1), (timer) {
|
||||
if (countdownSeconds > 0) {
|
||||
countdownSeconds--;
|
||||
// overlayEntry.markNeedsBuild(); // 刷新 OverlayEntry
|
||||
} else {
|
||||
timer.cancel(); // 取消计时器
|
||||
overlayEntry.remove(); // 移除 OverlayEntry
|
||||
}
|
||||
});
|
||||
// 将 OverlayEntry 添加到 Overlay 中
|
||||
overlayState?.insert(overlayEntry);
|
||||
}
|
||||
@ -93,7 +93,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
|
||||
#腾讯离线推送
|
||||
@ -142,6 +142,7 @@ flutter:
|
||||
- assets/images/mine/
|
||||
- assets/images/msg/
|
||||
- assets/images/circle/
|
||||
- assets/province.json
|
||||
# - images/a_dot_ham.jpeg
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
|
||||
Loading…
Reference in New Issue
Block a user