版本更新和ui细节
This commit is contained in:
parent
459e5ca108
commit
20d1a38988
@ -1,6 +1,13 @@
|
||||
package com.leyuan.app
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.PersistableBundle
|
||||
import android.util.Log
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity: FlutterActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
|
||||
super.onCreate(savedInstanceState, persistentState)
|
||||
Log.e("tag","11111111111")
|
||||
}
|
||||
}
|
||||
|
||||
BIN
circle_app/assets/images/base/ic_launcher.png
Normal file
BIN
circle_app/assets/images/base/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
@ -1,10 +1,16 @@
|
||||
// import 'package:flutter_install_app/flutter_install_app.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// import 'package:flutter_install_app/flutter_install_app.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../network/api.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../util/util.dart';
|
||||
import '../dialog/UpdateDialog.dart';
|
||||
import 'state.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
@ -14,7 +20,6 @@ class AboutappLogic extends GetxController {
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
getVersion();
|
||||
// getAppVersion();
|
||||
@ -27,23 +32,27 @@ class AboutappLogic extends GetxController {
|
||||
return version;
|
||||
}
|
||||
|
||||
updataApk() async {
|
||||
SmartDialog.showLoading();
|
||||
var filePath = await getApplicationSupportDirectoryPath();
|
||||
filePath = filePath+"kuayou.apk";
|
||||
// var data = await DioManager.instance
|
||||
// .download("https://xidi-official-website.oss-cn-shenzhen.aliyuncs.com/%E8%B7%A8%E5%8F%8B_2.3.4.apk", filePath, (received, total) {
|
||||
// double progress = received / total * 100;
|
||||
// print('Download progress: $progress%');
|
||||
// })
|
||||
// .then((value) =>
|
||||
// print(value))
|
||||
// .catchError((error) {
|
||||
// SmartDialog.dismiss();
|
||||
// print(error);
|
||||
// });
|
||||
// await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
getUpVersion() async {
|
||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
data, (data) => UpdateInfo.fromJson(data));
|
||||
if (bean.isSuccess() && bean.data.update == 1) {
|
||||
showReportDialog(Get.context!, bean.data.constraint == 0, bean.data);
|
||||
}
|
||||
}
|
||||
|
||||
void showReportDialog(
|
||||
BuildContext context, bool isDismiss, UpdateInfo updateInfo) {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: isDismiss,
|
||||
builder: (BuildContext context) {
|
||||
return UpdateDialog(
|
||||
isDismiss: isDismiss,
|
||||
updateInfo: updateInfo,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getAppVersion() async {
|
||||
|
||||
@ -4,6 +4,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../components/my_app_bar.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../dialog/UpdateDialog.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
|
||||
@ -43,7 +45,7 @@ class AboutappPage extends StatelessWidget {
|
||||
// showToast("13");
|
||||
},
|
||||
child:Image.asset(
|
||||
getBaseImage("icon_login"), // Replace with your image path
|
||||
getBaseImage("ic_launcher"), // Replace with your image path
|
||||
width: 100.sp,
|
||||
height: 100.sp,
|
||||
fit: BoxFit.contain,
|
||||
@ -146,7 +148,7 @@ class AboutappPage extends StatelessWidget {
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: (){
|
||||
logic.updataApk();
|
||||
logic.getUpVersion();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
|
||||
@ -100,8 +100,8 @@ class BlacklistPage extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
item.nickname,
|
||||
style: const TextStyle(color: Colors.white70,
|
||||
fontSize: 12,
|
||||
style: TextStyle(color: Colors.white70,
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
SizedBox(width: 4.sp),
|
||||
@ -116,6 +116,8 @@ class BlacklistPage extends StatelessWidget {
|
||||
width: 150.sp,
|
||||
child: Text(
|
||||
item.signature,
|
||||
overflow: TextOverflow.ellipsis, // 超出部分使用省略号表示
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB7BECC)),
|
||||
),
|
||||
),
|
||||
|
||||
@ -155,7 +155,9 @@ class Call_outLogic extends GetxController {
|
||||
if (beandata.isSuccess()) {
|
||||
showToast(beandata.msg);
|
||||
final logic = Get.put(CircleLogic());
|
||||
logic.setCircle(numbers[0].id);
|
||||
logic.refresh();
|
||||
logic.update();
|
||||
// Navigator.pop(Get.context!, numbers);
|
||||
Get.back();
|
||||
} else if (beandata.code == 30503) {
|
||||
|
||||
@ -44,7 +44,7 @@ class CircleLogic extends GetxController {
|
||||
|
||||
outCircle(String interest_id, bool isStatus) async {
|
||||
var data = await DioManager.instance.post(
|
||||
url: Api.outCrrcle + interest_id + "/join",
|
||||
url: "${Api.outCrrcle}$interest_id/join",
|
||||
params: {"status": isStatus ? "0" : "1"});
|
||||
var bean = BaseResponse<String>.fromJson(data, (data) => data);
|
||||
if (bean.code == 200) {
|
||||
@ -57,6 +57,15 @@ class CircleLogic extends GetxController {
|
||||
showToast(bean.msg);
|
||||
}
|
||||
|
||||
|
||||
setCircle(String circleId){
|
||||
circle.lists.forEach((element) {
|
||||
if (element.id.toString() == circleId.toString()) {
|
||||
element.isJoin = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//访问我的圈子人数
|
||||
loadCirclePeopleData() async {
|
||||
var data = await DioManager.instance
|
||||
|
||||
226
circle_app/lib/app/dialog/UpdateDialog.dart
Normal file
226
circle_app/lib/app/dialog/UpdateDialog.dart
Normal file
@ -0,0 +1,226 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../main.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../util/util.dart';
|
||||
|
||||
class UpdateDialog extends StatefulWidget {
|
||||
final bool isDismiss;
|
||||
final UpdateInfo updateInfo;
|
||||
|
||||
UpdateDialog({required this.isDismiss, required this.updateInfo});
|
||||
|
||||
@override
|
||||
_CustomDialogState createState() => _CustomDialogState();
|
||||
}
|
||||
|
||||
class _CustomDialogState extends State<UpdateDialog> {
|
||||
double progress = 0;
|
||||
bool isDownload = false;
|
||||
|
||||
void incrementCounter() {
|
||||
setState(() {
|
||||
progress = progress + 0.1;
|
||||
});
|
||||
}
|
||||
|
||||
void setDownloadUi() {
|
||||
setState(() {
|
||||
isDownload = true;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
return widget.isDismiss;
|
||||
},
|
||||
child: Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 277.sp,
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(1.sp),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
"发现新版本",
|
||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Image(
|
||||
image: AssetImage(getBaseImage("ic_launcher")),
|
||||
width: 70.sp,
|
||||
height: 70.sp,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 12.sp, left: 14.sp, right: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
widget.updateInfo.updateInfo,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
isDownload
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
if (Platform.isIOS) {
|
||||
final String appStoreUrl = 'https://apps.apple.com/app/id$iOSAPPid'; // App Store链接示例
|
||||
if (await canLaunch(appStoreUrl)) {
|
||||
await launch(appStoreUrl);
|
||||
} else {
|
||||
throw 'Could not open App Store.';
|
||||
}
|
||||
} else {
|
||||
updataApk(widget.updateInfo.downloadUrl);
|
||||
}
|
||||
|
||||
//incrementCounter();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
child: CircularProgressIndicator(
|
||||
value: progress,
|
||||
backgroundColor: Colors.grey,
|
||||
valueColor: const AlwaysStoppedAnimation<Color>(
|
||||
Colors.blue),
|
||||
strokeWidth: 4.0.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
setDownloadUi();
|
||||
|
||||
//Navigator.pop(context);
|
||||
// logic.setBlock();
|
||||
},
|
||||
child: Container(
|
||||
width: 200.sp,
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 10.sp,
|
||||
bottom: 10.sp,
|
||||
left: 52.sp,
|
||||
right: 52.sp),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"立即更新",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
updataApk(String downloadUrl) async {
|
||||
//SmartDialog.showLoading();
|
||||
var filePath = await getApplicationSupportDirectoryPath();
|
||||
filePath = filePath + "kuayou.apk";
|
||||
var data = await DioManager.instance
|
||||
.download(
|
||||
"https://xidi-official-website.oss-cn-shenzhen.aliyuncs.com/%E8%B7%A8%E5%8F%8B_2.3.4.apk",
|
||||
filePath, (received, total) {
|
||||
double progress = received / total * 100;
|
||||
print('Download progress: $progress%');
|
||||
})
|
||||
.then((value) => print(value))
|
||||
.catchError((error) {
|
||||
// SmartDialog.dismiss();
|
||||
print(error);
|
||||
});
|
||||
//await AppInstaller.installApk(filePath, actionRequired: false);
|
||||
}
|
||||
|
||||
class UpdateInfo {
|
||||
final String version; //最新版本号
|
||||
final int update; //是否要更新
|
||||
final int constraint; //是否强制
|
||||
final String publishTime;
|
||||
final String downloadUrl;
|
||||
final String updateInfo;
|
||||
|
||||
UpdateInfo({
|
||||
required this.version,
|
||||
required this.update,
|
||||
required this.constraint,
|
||||
required this.publishTime,
|
||||
required this.downloadUrl,
|
||||
required this.updateInfo,
|
||||
});
|
||||
|
||||
factory UpdateInfo.fromJson(Map<String, dynamic> json) {
|
||||
return UpdateInfo(
|
||||
version: json['version'],
|
||||
update: json['update'],
|
||||
constraint: json['constraint'],
|
||||
publishTime: json['publish_time'],
|
||||
downloadUrl: json['download_url'],
|
||||
updateInfo: json['update_info'],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -110,9 +110,11 @@ class FriendslistPage extends StatelessWidget {
|
||||
|
||||
SizedBox(height: 8.sp),
|
||||
SizedBox(
|
||||
width: 150.sp,
|
||||
width: 200.sp,
|
||||
child: Text(
|
||||
item.signature,
|
||||
overflow: TextOverflow.ellipsis, // 超出部分使用省略号表示
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB7BECC)),
|
||||
),
|
||||
),
|
||||
|
||||
@ -47,7 +47,7 @@ class HelpPage extends StatelessWidget {
|
||||
child: Text(
|
||||
'04-10 19:51',
|
||||
style: TextStyle(
|
||||
color: Color(0xFFB7BECC),
|
||||
color: const Color(0xFFB7BECC),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
@ -165,7 +165,7 @@ class HelpPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 30.sp),
|
||||
child: Row(
|
||||
@ -189,7 +189,7 @@ class HelpPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: Color(0xFF21BEAB),
|
||||
backgroundColor: const Color(0xFF21BEAB),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16.sp, vertical: 4.sp),
|
||||
shape: RoundedRectangleBorder(
|
||||
@ -215,7 +215,7 @@ class HelpPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: Color(0xFF21BEAB),
|
||||
backgroundColor: const Color(0xFF21BEAB),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16.sp, vertical: 4.sp),
|
||||
shape: RoundedRectangleBorder(
|
||||
|
||||
@ -6,9 +6,11 @@ import 'package:circle_app/network/dio_manager.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../circle/view.dart';
|
||||
import '../dialog/UpdateDialog.dart';
|
||||
import '../minefragment/view.dart';
|
||||
import '../msg/view.dart';
|
||||
import 'state.dart';
|
||||
@ -34,6 +36,33 @@ class HomeLogic extends GetxController {
|
||||
tabs.add(MinefragmentPage());
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() async{
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
data, (data) => UpdateInfo.fromJson(data));
|
||||
if(bean.isSuccess()&&bean.data.update==1){
|
||||
showReportDialog(Get.context!,bean.data.constraint==0,bean.data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void showReportDialog(BuildContext context,bool isDismiss,UpdateInfo updateInfo) {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: isDismiss,
|
||||
builder: (BuildContext context) {
|
||||
return UpdateDialog(isDismiss: isDismiss,updateInfo : updateInfo,);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void getIMData() async {
|
||||
// _coreInstance.;
|
||||
|
||||
@ -23,9 +23,11 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return GetBuilder(builder: (HomeLogic controller) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
controller.onReady();
|
||||
// Get.toNamed(AppRoutes.Complete_materialPage);
|
||||
},
|
||||
child: ExitAppConfirmation(child: Stack(children: [
|
||||
|
||||
@ -27,7 +27,7 @@ class LikelistPage extends StatelessWidget {
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
appBar: const MyAppBar(
|
||||
centerTitle: "喜欢我的",
|
||||
),
|
||||
body: SafeArea(
|
||||
@ -117,17 +117,19 @@ class LikelistPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8.sp),
|
||||
Container(
|
||||
width: 150.sp,
|
||||
SizedBox(
|
||||
width: 200.sp,
|
||||
child: Text(
|
||||
item.user.signature,
|
||||
style: TextStyle(fontSize: 12.sp, color: Color(0xFFB7BECC)),
|
||||
overflow: TextOverflow.ellipsis, // 超出部分使用省略号表示
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB7BECC)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Pla
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
logic.setLike(index);
|
||||
@ -136,7 +138,7 @@ class LikelistPage extends StatelessWidget {
|
||||
width: 75.sp,
|
||||
height: 28.sp,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFFF4D7C),
|
||||
color: const Color(0xFFFF4D7C),
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
child: Center(
|
||||
@ -162,7 +164,7 @@ class LikelistPage extends StatelessWidget {
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.sp),
|
||||
gradient: LinearGradient(
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color.fromRGBO(141, 255, 248, 1.0),
|
||||
Color.fromRGBO(181, 211, 255, 1.0),
|
||||
|
||||
@ -83,6 +83,8 @@ class MyfeedbacklistPage extends StatelessWidget {
|
||||
SizedBox(
|
||||
height: 120.sp,
|
||||
child: GridView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, // 每行显示的项目数量
|
||||
),
|
||||
|
||||
@ -31,108 +31,93 @@ class UserinfoLogic extends GetxController {
|
||||
bool isShowAlbum = true;
|
||||
bool isLike = false;
|
||||
final startTime = DateTime.now();
|
||||
SharedPreferences? sharedPreferences;
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
SmartDialog.showLoading();
|
||||
if (userId != '') {
|
||||
SharedPreferences sharedPreferences =
|
||||
await SharedPreferences.getInstance();
|
||||
if (sharedPreferences.getInt(SharedPreferencesHelper.USERID) != 0 &&
|
||||
sharedPreferences.getInt(SharedPreferencesHelper.USERID).toString() ==
|
||||
userId) {
|
||||
userId = '';
|
||||
}
|
||||
|
||||
sharedPreferences = await SharedPreferences.getInstance();
|
||||
int? sharedUserId = sharedPreferences!.getInt(SharedPreferencesHelper.USERID);
|
||||
|
||||
if (userId.isNotEmpty && sharedUserId != null && sharedUserId.toString() == userId) {
|
||||
userId = '';
|
||||
}
|
||||
|
||||
state.imaglist.clear();
|
||||
if (userId == '') {
|
||||
isMe = true;
|
||||
var data = await DioManager.instance.get(url: Api.getUserInfo);
|
||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||
data, (data) => ResponseBean.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
isLikeFoMsg =
|
||||
"${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新";
|
||||
|
||||
userInfoBean = bean.data.user;
|
||||
isVip = userInfoBean!.vip;
|
||||
//访问自己强制在线
|
||||
userInfoBean!.isOnline = true;
|
||||
onLineCity = userInfoBean!.isOnline ? "在线" : "离线";
|
||||
isOnline = userInfoBean!.isOnline;
|
||||
if (userInfoBean!.city != null) {
|
||||
onLineCity = "$onLineCity·${userInfoBean!.city}";
|
||||
}
|
||||
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age,
|
||||
userInfoBean!.role, userInfoBean!.orientation);
|
||||
} else {
|
||||
showToast(bean.msg);
|
||||
}
|
||||
|
||||
var myAlbumData = await DioManager.instance.get(
|
||||
url: Api.getMyAlbum,
|
||||
);
|
||||
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(myAlbumData,
|
||||
(myAlbumData) => AlbumResponseBean.fromJson(myAlbumData));
|
||||
if (myAlbumBean.isSuccess()) {
|
||||
myAlbumBean.data.lists.forEach((element) {
|
||||
state.imaglist.add(element);
|
||||
});
|
||||
}
|
||||
if (userId.isEmpty) {
|
||||
fetchUserInfo(Api.getUserInfo);
|
||||
fetchMyAlbum(Api.getMyAlbum);
|
||||
} else {
|
||||
isMe = false;
|
||||
var data = await DioManager.instance
|
||||
.get(url: "${Api.getUserInfoTA + userId}/home");
|
||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||
data, (data) => ResponseBean.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
isLike = bean.data.isFollow;
|
||||
isLikeFoMsg =
|
||||
"${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新";
|
||||
userInfoBean = bean.data!.user;
|
||||
isVip = userInfoBean!.vip;
|
||||
imId = bean.data.accountId;
|
||||
onLineCity = userInfoBean!.isOnline == true ? "在线" : "离线";
|
||||
if (userInfoBean!.city != null) {
|
||||
onLineCity = "$onLineCity·${userInfoBean!.city}";
|
||||
}
|
||||
fetchUserInfo("${Api.getUserInfoTA + userId}/home");
|
||||
fetchMyAlbum("${Api.getTaAlbum + userId}/albums");
|
||||
fetchUrgeStatus("${Api.getUrgeStatus + userId}/urge/album/status");
|
||||
}
|
||||
SmartDialog.dismiss();
|
||||
fetchQnToken(Api.getqiniuToken);
|
||||
}
|
||||
|
||||
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age,
|
||||
userInfoBean!.role, userInfoBean!.orientation);
|
||||
} else {
|
||||
showToast(bean.msg);
|
||||
Future<void> fetchUserInfo(String url) async {
|
||||
var data = await DioManager.instance.get(url: url);
|
||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||
data, (data) => ResponseBean.fromJson(data));
|
||||
|
||||
if (bean.isSuccess()) {
|
||||
isMe = userId.isEmpty;
|
||||
isLike = bean.data.isFollow;
|
||||
isLikeFoMsg = "${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新";
|
||||
userInfoBean = bean.data.user;
|
||||
isVip = userInfoBean?.vip ?? 0;
|
||||
imId = bean.data.accountId;
|
||||
if (isMe) {
|
||||
isOnline = true;
|
||||
}else{
|
||||
isOnline = userInfoBean!.isOnline;
|
||||
}
|
||||
|
||||
var myAlbumData = await DioManager.instance
|
||||
.get(url: "${Api.getTaAlbum + userId}/albums");
|
||||
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(myAlbumData,
|
||||
(myAlbumData) => AlbumResponseBean.fromJson(myAlbumData));
|
||||
if (myAlbumBean.isSuccess()) {
|
||||
myAlbumBean.data.lists.forEach((element) {
|
||||
state.imaglist.add(AlbumListItem(
|
||||
id: element.id, type: element.type, url: element.url));
|
||||
});
|
||||
onLineCity = isOnline ? "在线" : "离线";
|
||||
if (userInfoBean?.city != null) {
|
||||
onLineCity = "$onLineCity·${userInfoBean!.city}";
|
||||
}else{
|
||||
onLineCity = "$onLineCity·外星";
|
||||
}
|
||||
|
||||
var urgedata = await DioManager.instance
|
||||
.get(url: "${Api.getUrgeStatus + userId}/urge/album/status");
|
||||
var urgeBean = BaseResponse<UrgentStatus>.fromJson(
|
||||
urgedata, (urgedata) => UrgentStatus.fromJson(urgedata));
|
||||
//if(urgedata.isSuccess()){
|
||||
isUrgeStatus = urgeBean.data.isUrgent;
|
||||
//}
|
||||
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, userInfoBean!.role, userInfoBean!.orientation);
|
||||
} else {
|
||||
showToast(bean.msg);
|
||||
}
|
||||
update();
|
||||
SmartDialog.dismiss();
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getqiniuToken, params: {});
|
||||
}
|
||||
|
||||
Future<void> fetchMyAlbum(String url) async {
|
||||
var myAlbumData = await DioManager.instance.get(url: url);
|
||||
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(
|
||||
myAlbumData, (myAlbumData) => AlbumResponseBean.fromJson(myAlbumData));
|
||||
|
||||
if (myAlbumBean.isSuccess()) {
|
||||
state.imaglist.addAll(myAlbumBean.data.lists);
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
Future<void> fetchUrgeStatus(String url) async {
|
||||
var urgedata = await DioManager.instance.get(url: url);
|
||||
var urgeBean = BaseResponse<UrgentStatus>.fromJson(
|
||||
urgedata, (urgedata) => UrgentStatus.fromJson(urgedata));
|
||||
isUrgeStatus = urgeBean.data?.isUrgent ?? false;
|
||||
update();
|
||||
}
|
||||
|
||||
Future<void> fetchQnToken(String url) async {
|
||||
var data = await DioManager.instance.get(url: url, params: {});
|
||||
var bean = BaseResponse<QnTokenData>.fromJson(
|
||||
data, (data) => QnTokenData.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
quToken = bean.data!.token.toString();
|
||||
quToken = bean.data?.token.toString() ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
urgeChange() async {
|
||||
var data = await DioManager.instance
|
||||
.post(url: "${Api.urgeAlbum + userId}/urge/album");
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/chat/logic.dart';
|
||||
import 'package:circle_app/app/userinfo/widgets/home_call_out.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -22,6 +20,7 @@ class UserinfoPage extends StatefulWidget {
|
||||
class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late TabController _tabController;
|
||||
late PageController _pageController;
|
||||
|
||||
ScrollController scrollController = ScrollController();
|
||||
bool isShowBlackTitle = false;
|
||||
@ -29,8 +28,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_pageController = PageController();
|
||||
_tabController = TabController(
|
||||
length: 2, vsync: this, animationDuration: const Duration(milliseconds: 200));
|
||||
length: 2, vsync: this);
|
||||
_tabController.animation!.addListener(_handleTabChange);
|
||||
// _tabController.addListener(_handleTabChange);
|
||||
// _tabController
|
||||
@ -144,10 +144,6 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
final chatButton = GestureDetector(
|
||||
onTap: () {
|
||||
if (logic.userInfoBean != null) {
|
||||
|
||||
|
||||
|
||||
|
||||
pushChatPage(logic.userInfoBean!.id.toString(),logic.imId, logic.userInfoBean!.nickname);
|
||||
}
|
||||
},
|
||||
@ -199,131 +195,144 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
final interests = userInfoBean?.interests ?? [];
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 19.sp, vertical: 14.sp),
|
||||
padding: EdgeInsets.symmetric(vertical: 14.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
_imagelistView(controller),
|
||||
Expanded(
|
||||
child: buildUserContainer(controller),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
userInfoBean?.nickname ?? "",
|
||||
style: const TextStyle(
|
||||
color: Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.sp),
|
||||
_buildInfoRow(controller),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 5.sp),
|
||||
width: 5.sp,
|
||||
height: 5.sp,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: logic.isOnline
|
||||
? const Color(0xFF00FFF4)
|
||||
: const Color(0xFF787575),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
controller.onLineCity,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: logic.isOnline
|
||||
? const Color(0xFF00FFF4)
|
||||
: const Color(0xFF787575),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 59.sp,
|
||||
child: ListView.builder(
|
||||
itemCount: interests.length,
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: EdgeInsets.symmetric(vertical: 18.sp),
|
||||
itemBuilder: (context, index) {
|
||||
final interest = interests[index];
|
||||
return Container(
|
||||
margin: EdgeInsets.only(right: 11.sp),
|
||||
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.2.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interest.title,
|
||||
style: const TextStyle(
|
||||
fontSize: 11.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
titleTab(controller),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 19.sp),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_imageAdapter(controller),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 26.sp),
|
||||
child: HomeCallOutView(controller.userId),
|
||||
_imagelistView(controller),
|
||||
Expanded(
|
||||
child: buildUserContainer(controller),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 19.sp,),
|
||||
margin: EdgeInsets.only(top: 19.sp),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
userInfoBean?.nickname ?? "",
|
||||
style: const TextStyle(
|
||||
color: Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.sp),
|
||||
_buildInfoRow(controller),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 5.sp),
|
||||
width: 5.sp,
|
||||
height: 5.sp,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: logic.isOnline
|
||||
? const Color(0xFF00FFF4)
|
||||
: const Color(0xFF787575),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
controller.onLineCity,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: logic.isOnline
|
||||
? const Color(0xFF00FFF4)
|
||||
: const Color(0xFF787575),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 59.sp,
|
||||
|
||||
child: _buildInterestsListView(interests),
|
||||
),
|
||||
titleTab(controller),
|
||||
Expanded(
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
onPageChanged: (index) {
|
||||
_tabController.animateTo(index);
|
||||
},
|
||||
children: [
|
||||
_imageAdapter(controller),
|
||||
HomeCallOutView(controller.userId),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
Widget _buildInterestsListView(List<Interest> interests) {
|
||||
return ListView.builder(
|
||||
itemCount: interests.length,
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: EdgeInsets.symmetric(vertical: 18.sp,horizontal: 19.sp),
|
||||
itemBuilder: (context, index) {
|
||||
final interest = interests[index];
|
||||
return Container(
|
||||
margin: EdgeInsets.only(right: 11.sp),
|
||||
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.2.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interest.title,
|
||||
style: const TextStyle(
|
||||
fontSize: 11.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget titleTab(UserinfoLogic controller) {
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.sp),
|
||||
height: 27.sp,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@ -331,17 +340,32 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
indicator: UnderlineTabIndicator(
|
||||
borderSide: BorderSide(
|
||||
color:const Color(0xFF00FFF4) ,
|
||||
width: 2.sp,
|
||||
),
|
||||
insets: EdgeInsets.symmetric(horizontal: 6.0.sp),
|
||||
borderRadius: BorderRadius.circular(18.0),
|
||||
),
|
||||
indicatorColor: const Color(0xFF00FFF4),
|
||||
indicatorWeight: 2.sp,
|
||||
labelColor: const Color(0xFF00FFF4),
|
||||
unselectedLabelColor: const Color(0xB3FFFFFF),
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
tabs: const [
|
||||
tabs: const [
|
||||
Tab(
|
||||
text: "形象照",
|
||||
),
|
||||
Tab(text: "喊话"),
|
||||
],
|
||||
onTap: (index){
|
||||
_pageController.animateToPage(
|
||||
index, // 目标页面索引
|
||||
duration: const Duration(milliseconds: 300), // 动画时长
|
||||
curve: Curves.ease, // 动画曲线
|
||||
);
|
||||
},
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
@ -393,22 +417,23 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
|
||||
|
||||
Widget _imageAdapter(UserinfoLogic controller) {
|
||||
return Stack(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
if (controller.isMe)
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
|
||||
child: Text(
|
||||
controller.isLikeFoMsg,
|
||||
style: const TextStyle(color: Colors.white30),
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 19.sp),
|
||||
child: Stack(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
if (controller.isMe)
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
|
||||
child: Text(
|
||||
controller.isLikeFoMsg,
|
||||
style: const TextStyle(color: Colors.white30),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 58.0),
|
||||
Expanded(
|
||||
child: GridView.builder(
|
||||
padding: const EdgeInsets.only(bottom: 58.0),
|
||||
shrinkWrap: true,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
@ -461,51 +486,51 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (logic.isMe)
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 26.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
var data = await Get.toNamed(
|
||||
AppRoutes.Complete_materialPage,
|
||||
arguments: "user",
|
||||
);
|
||||
logic.onInit();
|
||||
},
|
||||
child: Center(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
],
|
||||
),
|
||||
if (logic.isMe)
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 26.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
await Get.toNamed(
|
||||
AppRoutes.Complete_materialPage,
|
||||
arguments: "user",
|
||||
);
|
||||
logic.onInit();
|
||||
},
|
||||
child: Center(
|
||||
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: 10.sp,
|
||||
horizontal: 55.sp,
|
||||
),
|
||||
child: const Text(
|
||||
"完善个人形象",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.sp,
|
||||
horizontal: 55.sp,
|
||||
),
|
||||
child: const Text(
|
||||
"完善个人形象",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -552,11 +577,12 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
|
||||
Widget buildUserContainer(UserinfoLogic controller) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 1.sp, vertical: 14.sp),
|
||||
margin: EdgeInsets.only( left: 3.sp),
|
||||
height: 58.sp,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(getMineImage("icon_user_content")),
|
||||
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
@ -581,6 +607,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
|
||||
width: 68.sp,
|
||||
height: 68.sp,
|
||||
decoration: const BoxDecoration(
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/circle/state.dart';
|
||||
import 'package:circle_app/app/circle/widgets/video_item.dart';
|
||||
@ -16,6 +15,7 @@ class HomeCallOutView extends StatefulWidget {
|
||||
// Get.lazyPut(() => ListLogic());
|
||||
|
||||
String userId;
|
||||
|
||||
HomeCallOutView(this.userId, {super.key});
|
||||
|
||||
@override
|
||||
@ -23,7 +23,6 @@ class HomeCallOutView extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
|
||||
HomeCallOutLogic? listsLg;
|
||||
|
||||
@override
|
||||
@ -56,7 +55,10 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
Container(
|
||||
height: Get.height,
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom + 30.sp),
|
||||
margin: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).padding.bottom + 56.sp,
|
||||
left: 19.sp,
|
||||
right: 19.sp),
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
listLogic.refreshData();
|
||||
@ -78,9 +80,12 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
}
|
||||
} else {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: listLogic.callOutMore ? 0 : 10.sp),
|
||||
child: loaddingWidget(
|
||||
listLogic.callOutMore),
|
||||
margin: EdgeInsets.only(
|
||||
top: listLogic.callOutMore
|
||||
? 0
|
||||
: 10.sp),
|
||||
child:
|
||||
loaddingWidget(listLogic.callOutMore),
|
||||
);
|
||||
}
|
||||
}),
|
||||
@ -100,7 +105,6 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
maxLines: 2,
|
||||
);
|
||||
|
||||
|
||||
double picHeight = 0.0;
|
||||
|
||||
int type = 0;
|
||||
@ -121,216 +125,238 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
}
|
||||
}
|
||||
double titleHeight = textWidth(lists.interest!['title']);
|
||||
double widgetHeight = 115.sp + contentHeight(lists.content!) + (picHeight > 0 ? picHeight + 5 : 0);
|
||||
double widgetHeight = 115.sp +
|
||||
contentHeight(lists.content!) +
|
||||
(picHeight > 0 ? picHeight + 5 : 0);
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
height: widgetHeight,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
getCircleImage('pic_bg'),
|
||||
))),
|
||||
child: Stack(children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
top: 2.sp,
|
||||
child: Image.asset(getCircleImage('vip_say')),
|
||||
height: 18.sp,
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 14.sp,bottom: 10.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
lists.create_time.toString(),
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
Positioned(
|
||||
right: 2.sp,
|
||||
top: 2.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('location'),
|
||||
width: titleHeight + 15.sp,
|
||||
height: 20.sp,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
Text(
|
||||
lists.interest!['title'],
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: widgetHeight,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 72.sp,
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
height: widgetHeight,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
getCircleImage('pic_bg'),
|
||||
))),
|
||||
child: Stack(children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
top: 2.sp,
|
||||
child: Image.asset(getCircleImage('vip_say')),
|
||||
height: 18.sp,
|
||||
),
|
||||
Positioned(
|
||||
right: 2.sp,
|
||||
top: 2.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('location'),
|
||||
width: titleHeight + 15.sp,
|
||||
height: 20.sp,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
Text(
|
||||
lists.interest!['title'],
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: widgetHeight,
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 72.sp,
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: 42.sp,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
listsLg?.pushMsgPage(lists, lists.id.toString());
|
||||
},
|
||||
child: ClipOval(
|
||||
child: Image.network(
|
||||
lists.user!.avatar!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.fill,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: 42.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
listsLg?.pushMsgPage(
|
||||
lists, lists.id.toString());
|
||||
},
|
||||
child: ClipOval(
|
||||
child: Image.network(
|
||||
lists.user!.avatar!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
lists.user!.nickname!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
lists.user!.nickname!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
lists.user!.vip! == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage('vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
height: 4.sp,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 18.sp,
|
||||
padding: EdgeInsets.only(
|
||||
left: 6.sp, right: 6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(9.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.25, 0.5),
|
||||
end: Alignment(0.75, 0.5),
|
||||
colors: [
|
||||
Color(0xff8DFFF8),
|
||||
Color(0xffB5D3FF)
|
||||
])),
|
||||
child: Text(
|
||||
getAgeCOntent(
|
||||
lists.user!.gender!,
|
||||
lists.user!.age!,
|
||||
lists.user!.role!,
|
||||
lists.user!.orientation!),
|
||||
|
||||
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 10.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
lists.user!.vip! == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage('vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 18.sp,
|
||||
padding:
|
||||
EdgeInsets.only(left: 6.sp, right: 6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(9.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.25, 0.5),
|
||||
end: Alignment(0.75, 0.5),
|
||||
colors: [
|
||||
Color(0xff8DFFF8),
|
||||
Color(0xffB5D3FF)
|
||||
])),
|
||||
|
||||
child: Text(
|
||||
getAgeCOntent(lists.user!.gender!, lists.user!.age!,
|
||||
lists.user!.role!, lists.user!.orientation!),
|
||||
|
||||
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp,
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.topLeft,
|
||||
// margin: EdgeInsets.only(top: 4.sp),
|
||||
child: descText,
|
||||
),
|
||||
Container(
|
||||
height: picHeight,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
child: picHeight == 140.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(lists.album![0]!.url!))
|
||||
: GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
lists.create_time!,
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
widget.userId.isNotEmpty
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
showTipPiker(lists.id!.toString(),
|
||||
listsLg!.lists.indexOf(lists));
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('delete'),
|
||||
width: 14.sp,
|
||||
))
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.topLeft,
|
||||
// margin: EdgeInsets.only(top: 4.sp),
|
||||
child: descText,
|
||||
),
|
||||
Container(
|
||||
height: picHeight,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
child: picHeight == 140.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(lists.album![0]!.url!))
|
||||
: GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
lists.create_time!,
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
widget.userId.isNotEmpty
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
showTipPiker(lists.id!.toString(), listsLg!.lists.indexOf(lists));
|
||||
},
|
||||
child: Image.asset(getCircleImage('delete'),width: 14.sp,))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
]));
|
||||
)
|
||||
])),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
///普通图文喊话
|
||||
@ -363,215 +389,236 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
|
||||
double titleHeight = textWidth(lists.interest!['title']);
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
height: picHeight > 0 ? 105.sp + contentHeight(lists.content!) + picHeight : 100.sp + contentHeight(lists.content!),
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
getCircleImage('normal_bg'),
|
||||
))),
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
right: 2.sp,
|
||||
top: 2.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('location'),
|
||||
width: titleHeight + 15.sp,
|
||||
height: 20.sp,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
Text(
|
||||
lists.interest!['title'],
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
// height: 18.sp,
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 14.sp,bottom: 10.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
lists.create_time.toString(),
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
Container(
|
||||
// height: 130.sp + contentHeight(lists.content!) + picHeight,
|
||||
width: Get.width,
|
||||
// color: Colors.blue,
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 72.sp,
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
height: picHeight > 0
|
||||
? 105.sp + contentHeight(lists.content!) + picHeight
|
||||
: 100.sp + contentHeight(lists.content!),
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
getCircleImage('normal_bg'),
|
||||
))),
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
right: 2.sp,
|
||||
top: 2.sp,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('location'),
|
||||
width: titleHeight + 15.sp,
|
||||
height: 20.sp,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
Text(
|
||||
lists.interest!['title'],
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
// height: 18.sp,
|
||||
),
|
||||
Container(
|
||||
// height: 130.sp + contentHeight(lists.content!) + picHeight,
|
||||
width: Get.width,
|
||||
// color: Colors.blue,
|
||||
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 72.sp,
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: 42.sp,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: ClipOval(
|
||||
child: Image.network(
|
||||
lists.user!.avatar!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
))
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: 42.sp,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: ClipOval(
|
||||
child: Image.network(
|
||||
lists.user!.avatar!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
))
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
lists.user!.nickname! ?? '',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
lists.user!.nickname! ?? '',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
lists.user!.vip! == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage('vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
height: 4.sp,
|
||||
),
|
||||
lists.user!.vip! == 0
|
||||
? Container()
|
||||
: Image.asset(
|
||||
getCircleImage('vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 18.sp,
|
||||
padding:
|
||||
EdgeInsets.only(left: 6.sp, right: 6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(9.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.25, 0.5),
|
||||
end: Alignment(0.75, 0.5),
|
||||
colors: [
|
||||
Color(0xff8DFFF8),
|
||||
Color(0xffB5D3FF)
|
||||
])),
|
||||
child: Text(
|
||||
getAgeCOntent(lists.user!.gender!, lists.user!.age!,
|
||||
lists.user!.role!, lists.user!.orientation!),
|
||||
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.topLeft,
|
||||
// margin: EdgeInsets.only(top: 4.sp),
|
||||
child: descText,
|
||||
),
|
||||
picHeight > 0
|
||||
? Container(
|
||||
height: picHeight,
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
child: picHeight == 140.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(lists.album![0].url!))
|
||||
: GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 18.sp,
|
||||
padding:
|
||||
EdgeInsets.only(left: 6.sp, right: 6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(9.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.25, 0.5),
|
||||
end: Alignment(0.75, 0.5),
|
||||
colors: [
|
||||
Color(0xff8DFFF8),
|
||||
Color(0xffB5D3FF)
|
||||
])),
|
||||
child: Text(
|
||||
getAgeCOntent(
|
||||
lists.user!.gender!,
|
||||
lists.user!.age!,
|
||||
lists.user!.role!,
|
||||
lists.user!.orientation!),
|
||||
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
if (album.type == 2) {
|
||||
return ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(album.url!));
|
||||
}
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}))
|
||||
: Container(),
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
lists.create_time!,
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
widget.userId.isNotEmpty
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
showTipPiker(lists.id!.toString(), listsLg!.lists.indexOf(lists));
|
||||
},
|
||||
child: Image.asset(getCircleImage('delete'),width: 14.sp,))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.topLeft,
|
||||
// margin: EdgeInsets.only(top: 4.sp),
|
||||
child: descText,
|
||||
),
|
||||
picHeight > 0
|
||||
? Container(
|
||||
height: picHeight,
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
child: picHeight == 140.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(lists.album![0].url!))
|
||||
: GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
if (album.type == 2) {
|
||||
return ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(album.url!));
|
||||
}
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}))
|
||||
: Container(),
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
lists.create_time!,
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
widget.userId.isNotEmpty
|
||||
? Container()
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
showTipPiker(lists.id!.toString(),
|
||||
listsLg!.lists.indexOf(lists));
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('delete'),
|
||||
width: 14.sp,
|
||||
))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -604,11 +651,12 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
double textWidth(value) {
|
||||
TextPainter painter = TextPainter(
|
||||
|
||||
///AUTO:华为手机如果不指定locale的时候,该方法算出来的文字高度是比系统计算偏小的。
|
||||
///AUTO:华为手机如果不指定locale的时候,该方法算出来的文字高度是比系统计算偏小的。
|
||||
locale: WidgetsBinding.instance!.window.locale,
|
||||
maxLines: 1,
|
||||
textDirection: TextDirection.ltr,
|
||||
textScaleFactor: 1, //字体缩放大小
|
||||
textScaleFactor: 1,
|
||||
//字体缩放大小
|
||||
text: TextSpan(
|
||||
text: value,
|
||||
style: TextStyle(
|
||||
@ -618,38 +666,40 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
|
||||
return painter.width;
|
||||
}
|
||||
|
||||
showTipPiker(String callOutId,int index) {
|
||||
showTipPiker(String callOutId, int index) {
|
||||
return Get.bottomSheet(
|
||||
Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: CupertinoAlertDialog(
|
||||
content: SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: const <Widget>[
|
||||
Text("是否要删除该喊话?"),
|
||||
],
|
||||
),
|
||||
Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: CupertinoAlertDialog(
|
||||
content: SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: const <Widget>[
|
||||
Text("是否要删除该喊话?"),
|
||||
],
|
||||
),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: const Text("确定",style: TextStyle(color: Colors.red),),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
listsLg?.removeData(callOutId,index);
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: const Text("取消"),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: const Text(
|
||||
"确定",
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
listsLg?.removeData(callOutId, index);
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: const Text("取消"),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false,
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,30 +108,29 @@ class VisitorlistPage extends StatelessWidget {
|
||||
// Placeholder image
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 8.sp),
|
||||
Container(
|
||||
width: 150.sp,
|
||||
SizedBox(
|
||||
width: 200.sp,
|
||||
child: Text(
|
||||
item.user.signature,
|
||||
style: TextStyle(fontSize: 12.sp, color: Color(0xFFB7BECC)),
|
||||
overflow: TextOverflow.ellipsis, // 超出部分使用省略号表示
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 12.sp, color: const Color(0xFFB7BECC)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Pla
|
||||
Spacer(),
|
||||
const Spacer(),
|
||||
GestureDetector(onTap: (){
|
||||
pushChatPage(item.user.id.toString(),item.accountId, item.user.nickname);
|
||||
|
||||
|
||||
},
|
||||
child: Container(
|
||||
width: 60.sp,
|
||||
height: 28.sp,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFFF4D7C),
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
color: const Color(0xFFFF4D7C),
|
||||
borderRadius: BorderRadius.circular(14.sp),
|
||||
),
|
||||
child: Center(
|
||||
child: Text("私聊", style: TextStyle(fontSize: 14.sp, color: Colors.white)),
|
||||
|
||||
@ -25,6 +25,12 @@ void main() {
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
int IMsdkAppID = 1400799631;
|
||||
|
||||
String iOSAPPid = "";
|
||||
|
||||
|
||||
|
||||
|
||||
//登录IM
|
||||
loginIM(String userId,String sig) async {
|
||||
@ -210,7 +216,7 @@ class _MyAppState extends State<MyApp> {
|
||||
initIM() {
|
||||
coreInstance.init(
|
||||
sdkAppID:
|
||||
1400799631, // Replace 0 with the SDKAppID of your IM application when integrating
|
||||
IMsdkAppID, // Replace 0 with the SDKAppID of your IM application when integrating
|
||||
// language: LanguageEnum.en, // 界面语言配置,若不配置,则跟随系统语言
|
||||
loglevel: LogLevelEnum.V2TIM_LOG_DEBUG,
|
||||
onTUIKitCallbackListener: (TIMCallback callbackValue) {
|
||||
|
||||
@ -60,6 +60,10 @@ class Api {
|
||||
|
||||
|
||||
|
||||
|
||||
//版本信息
|
||||
static const APP_VERSION = 'user-service/app/version';
|
||||
|
||||
//入圈出圈
|
||||
static const outCrrcle = 'up-service/interest/';
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
import '../util/device.dart';
|
||||
import 'api.dart';
|
||||
@ -347,3 +348,5 @@ class QnTokenData {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user