版本更新和ui细节

This commit is contained in:
YangYuhao 2023-07-19 17:52:53 +08:00
parent 459e5ca108
commit 20d1a38988
22 changed files with 1094 additions and 726 deletions

View File

@ -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")
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -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 {

View File

@ -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: [

View File

@ -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)),
),
),

View File

@ -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) {

View File

@ -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

View 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'],
);
}
}

View File

@ -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)),
),
),

View File

@ -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(

View File

@ -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.;

View File

@ -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: [

View File

@ -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),

View File

@ -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, //
),

View File

@ -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) {
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);
if (userId.isEmpty) {
fetchUserInfo(Api.getUserInfo);
fetchMyAlbum(Api.getMyAlbum);
} else {
showToast(bean.msg);
fetchUserInfo("${Api.getUserInfoTA + userId}/home");
fetchMyAlbum("${Api.getTaAlbum + userId}/albums");
fetchUrgeStatus("${Api.getUrgeStatus + userId}/urge/album/status");
}
SmartDialog.dismiss();
fetchQnToken(Api.getqiniuToken);
}
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);
});
}
} else {
isMe = false;
var data = await DioManager.instance
.get(url: "${Api.getUserInfoTA + userId}/home");
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;
isLikeFoMsg = "${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新";
userInfoBean = bean.data.user;
isVip = userInfoBean?.vip ?? 0;
imId = bean.data.accountId;
onLineCity = userInfoBean!.isOnline == true ? "在线" : "离线";
if (userInfoBean!.city != null) {
onLineCity = "$onLineCity·${userInfoBean!.city}";
if (isMe) {
isOnline = true;
}else{
isOnline = userInfoBean!.isOnline;
}
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age,
userInfoBean!.role, userInfoBean!.orientation);
onLineCity = isOnline ? "在线" : "离线";
if (userInfoBean?.city != null) {
onLineCity = "$onLineCity·${userInfoBean!.city}";
}else{
onLineCity = "$onLineCity·外星";
}
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, userInfoBean!.role, userInfoBean!.orientation);
} else {
showToast(bean.msg);
}
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));
});
}
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;
//}
}
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");

View File

@ -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,10 +195,13 @@ 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(
Container(
padding: EdgeInsets.symmetric(horizontal: 19.sp),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_imagelistView(controller),
Expanded(
@ -210,7 +209,11 @@ class _MyTabbedScreenState extends State<UserinfoPage>
),
],
),
Row(
),
Container(
padding: EdgeInsets.symmetric(horizontal: 19.sp,),
margin: EdgeInsets.only(top: 19.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
@ -242,7 +245,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
Text(
controller.onLineCity,
style: TextStyle(
fontSize: 12,
fontSize: 12.sp,
color: logic.isOnline
? const Color(0xFF00FFF4)
: const Color(0xFF787575),
@ -252,17 +255,39 @@ class _MyTabbedScreenState extends State<UserinfoPage>
),
],
),
),
SizedBox(
height: 59.sp,
child: ListView.builder(
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),
padding: EdgeInsets.symmetric(vertical: 18.sp,horizontal: 19.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(
@ -297,33 +322,17 @@ class _MyTabbedScreenState extends State<UserinfoPage>
),
),
),
),
);
},
),
),
titleTab(controller),
Expanded(
child: TabBarView(
controller: _tabController,
children: [
_imageAdapter(controller),
Container(
margin: EdgeInsets.only(bottom: 26.sp),
child: HomeCallOutView(controller.userId),
),
],
),
),
],
),
);
}
Widget titleTab(UserinfoLogic controller) {
return Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: 10.sp),
height: 27.sp,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -331,6 +340,14 @@ 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),
@ -342,6 +359,13 @@ class _MyTabbedScreenState extends State<UserinfoPage>
),
Tab(text: "喊话"),
],
onTap: (index){
_pageController.animateToPage(
index, //
duration: const Duration(milliseconds: 300), //
curve: Curves.ease, // 线
);
},
),
GestureDetector(
onTap: () {
@ -393,7 +417,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
Widget _imageAdapter(UserinfoLogic controller) {
return Stack(
return Container(
padding: EdgeInsets.symmetric(horizontal: 19.sp),
child: Stack(
children: [
Column(
children: [
@ -406,9 +432,8 @@ class _MyTabbedScreenState extends State<UserinfoPage>
),
),
Expanded(
child: Container(
margin: const EdgeInsets.only(bottom: 58.0),
child: GridView.builder(
padding: const EdgeInsets.only(bottom: 58.0),
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
@ -461,7 +486,6 @@ class _MyTabbedScreenState extends State<UserinfoPage>
},
),
),
),
],
),
if (logic.isMe)
@ -471,7 +495,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
bottom: 26.sp,
child: GestureDetector(
onTap: () async {
var data = await Get.toNamed(
await Get.toNamed(
AppRoutes.Complete_materialPage,
arguments: "user",
);
@ -506,6 +530,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
),
),
],
),
);
}
@ -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(

View File

@ -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,9 +125,21 @@ 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(
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(
margin: EdgeInsets.only(top: 10.sp),
width: Get.width,
height: widgetHeight,
@ -180,14 +196,15 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
),
GestureDetector(
onTap: () {
listsLg?.pushMsgPage(lists, lists.id.toString());
listsLg?.pushMsgPage(
lists, lists.id.toString());
},
child: ClipOval(
child: Image.network(
lists.user!.avatar!,
width: 40.sp,
height: 40.sp,
fit: BoxFit.fill,
fit: BoxFit.cover,
),
),
)
@ -228,10 +245,11 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
Container(
alignment: Alignment.center,
height: 18.sp,
padding:
EdgeInsets.only(left: 6.sp, right: 6.sp),
padding: EdgeInsets.only(
left: 6.sp, right: 6.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(9.sp),
borderRadius:
BorderRadius.circular(9.sp),
gradient: const LinearGradient(
begin: Alignment(0.25, 0.5),
end: Alignment(0.75, 0.5),
@ -239,15 +257,17 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
Color(0xff8DFFF8),
Color(0xffB5D3FF)
])),
child: Text(
getAgeCOntent(lists.user!.gender!, lists.user!.age!,
lists.user!.role!, lists.user!.orientation!),
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,
fontSize: 10.sp,
),
),
)
@ -315,22 +335,28 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
children: [
Text(
lists.create_time!,
style:
TextStyle(color: Colors.white, fontSize: 12.sp),
style: TextStyle(
color: Colors.white, fontSize: 12.sp),
),
widget.userId.isNotEmpty
? Container()
: GestureDetector(
onTap: () {
showTipPiker(lists.id!.toString(), listsLg!.lists.indexOf(lists));
showTipPiker(lists.id!.toString(),
listsLg!.lists.indexOf(lists));
},
child: Image.asset(getCircleImage('delete'),width: 14.sp,))
child: Image.asset(
getCircleImage('delete'),
width: 14.sp,
))
],
))
],
),
)
]));
])),
],
);
}
///
@ -363,10 +389,22 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
double titleHeight = textWidth(lists.interest!['title']);
return Container(
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(
margin: EdgeInsets.only(top: 10.sp),
width: Get.width,
height: picHeight > 0 ? 105.sp + contentHeight(lists.content!) + picHeight : 100.sp + contentHeight(lists.content!),
height: picHeight > 0
? 105.sp + contentHeight(lists.content!) + picHeight
: 100.sp + contentHeight(lists.content!),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
@ -422,7 +460,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
lists.user!.avatar!,
width: 40.sp,
height: 40.sp,
fit: BoxFit.fill,
fit: BoxFit.cover,
),
))
],
@ -474,8 +512,11 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
Color(0xffB5D3FF)
])),
child: Text(
getAgeCOntent(lists.user!.gender!, lists.user!.age!,
lists.user!.role!, lists.user!.orientation!),
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,
@ -562,9 +603,13 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
? Container()
: GestureDetector(
onTap: () {
showTipPiker(lists.id!.toString(), listsLg!.lists.indexOf(lists));
showTipPiker(lists.id!.toString(),
listsLg!.lists.indexOf(lists));
},
child: Image.asset(getCircleImage('delete'),width: 14.sp,))
child: Image.asset(
getCircleImage('delete'),
width: 14.sp,
))
],
))
],
@ -572,6 +617,8 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
)
],
),
),
],
);
}
@ -608,7 +655,8 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
locale: WidgetsBinding.instance!.window.locale,
maxLines: 1,
textDirection: TextDirection.ltr,
textScaleFactor: 1, //
textScaleFactor: 1,
//
text: TextSpan(
text: value,
style: TextStyle(
@ -618,7 +666,7 @@ 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,
@ -632,10 +680,13 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
),
actions: <Widget>[
CupertinoDialogAction(
child: const Text("确定",style: TextStyle(color: Colors.red),),
child: const Text(
"确定",
style: TextStyle(color: Colors.red),
),
onPressed: () {
Get.back();
listsLg?.removeData(callOutId,index);
listsLg?.removeData(callOutId, index);
},
),
CupertinoDialogAction(
@ -649,7 +700,6 @@ class _HomeCallOutViewState extends State<HomeCallOutView> {
),
isScrollControlled: true,
enableDrag: false,
);
}
}

View File

@ -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)),

View File

@ -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) {

View File

@ -60,6 +60,10 @@ class Api {
//
static const APP_VERSION = 'user-service/app/version';
//
static const outCrrcle = 'up-service/interest/';

View File

@ -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 {
);
}
}