Merge branch 'android_1.0.1' of /Users/wangaoqing/fluttle_app/circle_app with conflicts.
This commit is contained in:
parent
d2db9f1478
commit
e855bf7b42
@ -65,8 +65,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 2
|
versionCode 4
|
||||||
versionName "1.0.1"
|
versionName "1.0.3"
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
vivo_APPID: "105669716",
|
vivo_APPID: "105669716",
|
||||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||||
|
|||||||
@ -56,6 +56,7 @@ class CircleLogic extends GetxController {
|
|||||||
if (circle.lists.length < 20) {
|
if (circle.lists.length < 20) {
|
||||||
isMore = false;
|
isMore = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
myVip = await getVip();
|
myVip = await getVip();
|
||||||
|
|||||||
@ -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';
|
||||||
|
|
||||||
@ -23,6 +23,7 @@ double myProgress = 0;
|
|||||||
|
|
||||||
class _CustomDialogState extends State<UpdateDialog> {
|
class _CustomDialogState extends State<UpdateDialog> {
|
||||||
bool isDownload = false;
|
bool isDownload = false;
|
||||||
|
bool isShowWeb = false;
|
||||||
|
|
||||||
void incrementCounter() {}
|
void incrementCounter() {}
|
||||||
|
|
||||||
@ -111,42 +112,78 @@ class _CustomDialogState extends State<UpdateDialog> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
//incrementCounter();
|
//incrementCounter();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Column(
|
||||||
margin: EdgeInsets.only(top: 24.sp),
|
children: [
|
||||||
child: CircularProgressIndicator(
|
Container(
|
||||||
value: myProgress,
|
margin: EdgeInsets.only(top: 4.sp),
|
||||||
backgroundColor: Colors.grey,
|
child: CircularProgressIndicator(
|
||||||
valueColor: const AlwaysStoppedAnimation<Color>(
|
value: myProgress,
|
||||||
Color(0xFF30FFD9)),
|
backgroundColor: Colors.grey,
|
||||||
strokeWidth: 4.0.sp,
|
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(
|
: GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
final String appStoreUrl = widget.updateInfo.downloadUrl; // App Store链接示例
|
final String appStoreUrl = widget
|
||||||
|
.updateInfo.downloadUrl; // App Store链接示例
|
||||||
if (await canLaunch(appStoreUrl)) {
|
if (await canLaunch(appStoreUrl)) {
|
||||||
await launch(appStoreUrl,forceSafariVC : false);
|
await launch(appStoreUrl,
|
||||||
|
forceSafariVC: false);
|
||||||
} else {
|
} else {
|
||||||
throw 'Could not open App Store.';
|
throw 'Could not open App Store.';
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
updataApk(appStoreUrl);
|
||||||
setDownloadUi();
|
setDownloadUi();
|
||||||
}else{
|
await Future.delayed(Duration(seconds: 10));
|
||||||
|
setState(() {
|
||||||
|
isShowWeb = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
if (await canLaunch(appStoreUrl)) {
|
if (await canLaunch(appStoreUrl)) {
|
||||||
await launch(appStoreUrl,forceSafariVC : false);
|
await launch(appStoreUrl,
|
||||||
|
forceSafariVC: false);
|
||||||
} else {
|
} else {
|
||||||
throw 'Could not open App Store.';
|
throw 'Could not open App Store.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Navigator.pop(context);
|
//Navigator.pop(context);
|
||||||
@ -188,12 +225,17 @@ class _CustomDialogState extends State<UpdateDialog> {
|
|||||||
Positioned(
|
Positioned(
|
||||||
right: 8.sp,
|
right: 8.sp,
|
||||||
top: 8.sp,
|
top: 8.sp,
|
||||||
child: widget.isDismiss? GestureDetector(
|
child: widget.isDismiss
|
||||||
onTap: (){
|
? GestureDetector(
|
||||||
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
child: Icon(Icons.close,color: Colors.white,size: 24.sp,)):Container())
|
child: Icon(
|
||||||
|
Icons.close,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 24.sp,
|
||||||
|
))
|
||||||
|
: Container())
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -218,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -253,22 +253,20 @@ class MsgPage extends StatelessWidget {
|
|||||||
width: Get.width,
|
width: Get.width,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Column(
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
Image.asset(
|
||||||
Image.asset(
|
getMsgImage('msg_first'),
|
||||||
getMsgImage('msg_first'),
|
width: 50.sp,
|
||||||
width: 50.sp,
|
),
|
||||||
),
|
SizedBox(
|
||||||
SizedBox(
|
height: 4.sp,
|
||||||
height: 4.sp,
|
),
|
||||||
),
|
Text(
|
||||||
Text(
|
'抢占第一',
|
||||||
'抢占第一',
|
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
),
|
||||||
),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
|||||||
@ -23,31 +23,26 @@ class SplashLogic extends GetxController {
|
|||||||
void onReady() async {
|
void onReady() async {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
// await Future.delayed(Duration(seconds: 30));
|
// await Future.delayed(Duration(seconds: 30));
|
||||||
if ((await getAuthorization()).isEmpty) {
|
if ((await getAuthorization()).isEmpty) {
|
||||||
if(Platform.isIOS){
|
if (Platform.isIOS) {
|
||||||
pushLoginPage();
|
pushLoginPage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bool isAgreemement = await getAgreemement();
|
bool isAgreemement = await getAgreemement();
|
||||||
if(!isAgreemement){
|
if (!isAgreemement) {
|
||||||
showReportDialog();
|
showReportDialog();
|
||||||
}else{
|
} else {
|
||||||
pushLoginPage();
|
pushLoginPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var data =
|
var data =
|
||||||
await DioManager.instance.put(url: Api.refreshToken, params: {});
|
await DioManager.instance.put(url: Api.refreshToken, params: {});
|
||||||
var bean = BaseResponse<LoginData>.fromJson(
|
var bean = BaseResponse<LoginData>.fromJson(
|
||||||
data, (data) => LoginData.fromJson(data));
|
data, (data) => LoginData.fromJson(data));
|
||||||
if (bean.code == 200) {
|
if (bean.code == 200) {
|
||||||
@ -65,7 +60,10 @@ class SplashLogic extends GetxController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return;
|
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();
|
pushLoginPage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -73,7 +71,7 @@ class SplashLogic extends GetxController {
|
|||||||
if (bean.code == 500) {
|
if (bean.code == 500) {
|
||||||
await Future.delayed(Duration(seconds: 5));
|
await Future.delayed(Duration(seconds: 5));
|
||||||
onInit();
|
onInit();
|
||||||
}else {
|
} else {
|
||||||
pushLoginPage();
|
pushLoginPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +79,6 @@ class SplashLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void showReportDialog() {
|
void showReportDialog() {
|
||||||
FlutterNativeSplash.remove();
|
FlutterNativeSplash.remove();
|
||||||
showDialog(
|
showDialog(
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
@ -15,6 +17,7 @@ import '../../util/SharedPreferencesHelper.dart';
|
|||||||
import '../../util/eventBus.dart';
|
import '../../util/eventBus.dart';
|
||||||
import '../../util/qiniu.dart';
|
import '../../util/qiniu.dart';
|
||||||
import '../../util/util.dart';
|
import '../../util/util.dart';
|
||||||
|
import '../../view/notice.dart';
|
||||||
import '../dialog/BaseDialog.dart';
|
import '../dialog/BaseDialog.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
@ -41,6 +44,12 @@ class UserinfoLogic extends GetxController {
|
|||||||
bool isDestroy = false;
|
bool isDestroy = false;
|
||||||
final startTime = DateTime.now();
|
final startTime = DateTime.now();
|
||||||
SharedPreferences? sharedPreferences;
|
SharedPreferences? sharedPreferences;
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
timer?.cancel();
|
||||||
|
super.onClose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
@ -74,6 +83,10 @@ class UserinfoLogic extends GetxController {
|
|||||||
fetchQnToken(Api.getqiniuToken);
|
fetchQnToken(Api.getqiniuToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void showBlackDialog(BuildContext context) {
|
void showBlackDialog(BuildContext context) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -98,6 +111,7 @@ class UserinfoLogic extends GetxController {
|
|||||||
if (bean.isSuccess()) {
|
if (bean.isSuccess()) {
|
||||||
isMe = userId.isEmpty;
|
isMe = userId.isEmpty;
|
||||||
isLike = bean.data.isFollow;
|
isLike = bean.data.isFollow;
|
||||||
|
|
||||||
isLikeFoMsg =
|
isLikeFoMsg =
|
||||||
"${bean.data.likeMeCount}位圈友感兴趣,其中${bean.data.imageUrgeCount}位已催您更新";
|
"${bean.data.likeMeCount}位圈友感兴趣,其中${bean.data.imageUrgeCount}位已催您更新";
|
||||||
userInfoBean = bean.data.user;
|
userInfoBean = bean.data.user;
|
||||||
@ -107,6 +121,9 @@ class UserinfoLogic extends GetxController {
|
|||||||
if (isMe) {
|
if (isMe) {
|
||||||
isOnline = true;
|
isOnline = true;
|
||||||
} else {
|
} else {
|
||||||
|
if(!isLike){
|
||||||
|
startCountdown();
|
||||||
|
}
|
||||||
isOnline = userInfoBean!.isOnline;
|
isOnline = userInfoBean!.isOnline;
|
||||||
isBlackBeen = bean.data.isBlock;
|
isBlackBeen = bean.data.isBlock;
|
||||||
isDestroy = bean.data.isDestroy;
|
isDestroy = bean.data.isDestroy;
|
||||||
@ -130,6 +147,27 @@ class UserinfoLogic extends GetxController {
|
|||||||
update();
|
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,(){
|
||||||
|
setLike();
|
||||||
|
});
|
||||||
|
|
||||||
|
timer?.cancel(); // 倒计时结束,取消定时器
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Future<void> fetchMyAlbum(String url) async {
|
Future<void> fetchMyAlbum(String url) async {
|
||||||
var myAlbumData = await DioManager.instance.get(url: url);
|
var myAlbumData = await DioManager.instance.get(url: url);
|
||||||
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(
|
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(
|
||||||
@ -196,6 +234,8 @@ class UserinfoLogic extends GetxController {
|
|||||||
(jsonData) => jsonData,
|
(jsonData) => jsonData,
|
||||||
);
|
);
|
||||||
if (bean.isSuccess()) {
|
if (bean.isSuccess()) {
|
||||||
|
|
||||||
|
timer?.cancel();
|
||||||
isLike = !isLike;
|
isLike = !isLike;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import 'package:circle_app/main.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 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
|
||||||
|
|
||||||
import '../../components/my_app_bar.dart';
|
import '../../components/my_app_bar.dart';
|
||||||
import '../../router/app_routers.dart';
|
import '../../router/app_routers.dart';
|
||||||
@ -70,26 +69,30 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Scaffold(
|
child: Stack(
|
||||||
backgroundColor: Colors.transparent,
|
children: [
|
||||||
appBar: MyAppBar(
|
Scaffold(
|
||||||
centerTitle: logic.userInfoBean != null
|
backgroundColor: Colors.transparent,
|
||||||
? "${logic.userInfoBean!.nickname}的主页"
|
appBar: MyAppBar(
|
||||||
: "个人主页",
|
centerTitle: logic.userInfoBean != null
|
||||||
),
|
? "${logic.userInfoBean!.nickname}的主页"
|
||||||
body: Stack(
|
: "个人主页",
|
||||||
children: [
|
),
|
||||||
|
body: Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: buildContent(logic),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 27.sp,
|
||||||
|
width: Get.width,
|
||||||
|
child: _meInfoButton(logic),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
Container(
|
],
|
||||||
child: buildContent(logic),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
bottom: 27.sp,
|
|
||||||
width: Get.width,
|
|
||||||
child: _meInfoButton(logic),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -172,7 +175,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) {
|
||||||
showOKToast("私聊失败,存在拉黑关系或者该账户已注销");
|
showOKToast("私聊失败,存在拉黑关系或者该账户已注销");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -249,7 +252,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 19.sp,
|
horizontal: 19.sp,
|
||||||
),
|
),
|
||||||
@ -267,7 +270,9 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8.sp),
|
SizedBox(width: 8.sp),
|
||||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): _buildInfoRow(controller),
|
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||||
|
? Container()
|
||||||
|
: _buildInfoRow(controller),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
@ -283,15 +288,17 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
: const Color(0xFF787575),
|
: const Color(0xFF787575),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): Text(
|
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||||
controller.onLineCity,
|
? Container()
|
||||||
style: TextStyle(
|
: Text(
|
||||||
fontSize: 12.sp,
|
controller.onLineCity,
|
||||||
color: logic.isOnline
|
style: TextStyle(
|
||||||
? const Color(0xFF00FFF4)
|
fontSize: 12.sp,
|
||||||
: const Color(0xFF787575),
|
color: logic.isOnline
|
||||||
),
|
? const Color(0xFF00FFF4)
|
||||||
),
|
: const Color(0xFF787575),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -299,7 +306,9 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 59.sp,
|
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),
|
titleTab(controller),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -309,8 +318,12 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
_tabController.animateTo(index);
|
_tabController.animateTo(index);
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container():_imageAdapter(controller),
|
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): HomeCallOutView(controller.userId),
|
? Container()
|
||||||
|
: _imageAdapter(controller),
|
||||||
|
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||||
|
? Container()
|
||||||
|
: HomeCallOutView(controller.userId),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -327,7 +340,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final interest = interests[index];
|
final interest = interests[index];
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: (){
|
onTap: () {
|
||||||
Get.toNamed(AppRoutes.Signal_circle_list,
|
Get.toNamed(AppRoutes.Signal_circle_list,
|
||||||
arguments: interests[index].id);
|
arguments: interests[index].id);
|
||||||
},
|
},
|
||||||
@ -411,49 +424,51 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector(
|
logic.isBlack || logic.isDestroy || logic.isBlackBeen
|
||||||
onTap: () {
|
? Container()
|
||||||
if (controller.isMe) {
|
: GestureDetector(
|
||||||
controller.isEdit = !controller.isEdit;
|
onTap: () {
|
||||||
controller.update();
|
if (controller.isMe) {
|
||||||
} else {
|
controller.isEdit = !controller.isEdit;
|
||||||
controller.urgeChange();
|
controller.update();
|
||||||
}
|
} else {
|
||||||
},
|
controller.urgeChange();
|
||||||
child: Visibility(
|
}
|
||||||
visible: logic.isShowAlbum,
|
},
|
||||||
child: Container(
|
child: Visibility(
|
||||||
decoration: BoxDecoration(
|
visible: logic.isShowAlbum,
|
||||||
borderRadius: BorderRadius.circular(17),
|
child: Container(
|
||||||
gradient: const LinearGradient(
|
decoration: BoxDecoration(
|
||||||
colors: [
|
borderRadius: BorderRadius.circular(17),
|
||||||
Color(0xFF06F9FA),
|
gradient: const LinearGradient(
|
||||||
Color(0xFFDC5BFD),
|
colors: [
|
||||||
],
|
Color(0xFF06F9FA),
|
||||||
begin: Alignment.centerLeft,
|
Color(0xFFDC5BFD),
|
||||||
end: Alignment.centerRight,
|
],
|
||||||
|
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 +478,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
//print(controller.state.imaglist);
|
//print(controller.state.imaglist);
|
||||||
|
|
||||||
// :
|
// :
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 19.sp),
|
padding: EdgeInsets.symmetric(horizontal: 19.sp),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
@ -599,7 +614,8 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
if (controller.isVip > 0)
|
if (controller.isVip > 0)
|
||||||
Image(
|
Image(
|
||||||
image: AssetImage(getBaseImage( controller.isVip == 1 ? "vip" : 'year_vip')),
|
image: AssetImage(
|
||||||
|
getBaseImage(controller.isVip == 1 ? "vip" : 'year_vip')),
|
||||||
width: 44.sp,
|
width: 44.sp,
|
||||||
height: 18.sp,
|
height: 18.sp,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -415,6 +415,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
listener: V2TimSDKListener(onConnectSuccess: () {
|
listener: V2TimSDKListener(onConnectSuccess: () {
|
||||||
print('IM登录成功');
|
print('IM登录成功');
|
||||||
// loginIM();
|
// loginIM();
|
||||||
|
},onUserStatusChanged:(List<V2TimUserStatus> userStatusList){
|
||||||
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,8 +436,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
//填入设计稿中设备的屏幕尺寸,单位dp
|
//填入设计稿中设备的屏幕尺寸,单位dp
|
||||||
// configureDio();
|
// configureDio();
|
||||||
return
|
return ScreenUtilInit(
|
||||||
ScreenUtilInit(
|
|
||||||
designSize: const Size(375, 812),
|
designSize: const Size(375, 812),
|
||||||
minTextAdapt: true,
|
minTextAdapt: true,
|
||||||
splitScreenMode: true,
|
splitScreenMode: true,
|
||||||
|
|||||||
170
circle_app/lib/view/notice.dart
Normal file
170
circle_app/lib/view/notice.dart
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
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,NoticeCallback noticeCallback) {
|
||||||
|
OverlayState? overlayState = Overlay.of(context);
|
||||||
|
late OverlayEntry overlayEntry;
|
||||||
|
bool showMessage = false;
|
||||||
|
|
||||||
|
int countdownSeconds = 5; // 倒计时秒数
|
||||||
|
|
||||||
|
// 创建 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(
|
||||||
|
"看了这么久,给我点个喜欢呗~",
|
||||||
|
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(
|
||||||
|
"喜欢",
|
||||||
|
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:
|
||||||
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
|
||||||
#腾讯离线推送
|
#腾讯离线推送
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user