1.4.1提交
This commit is contained in:
parent
2d5cd8826c
commit
0db8ba7a3b
@ -71,8 +71,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 32
|
versionCode 33
|
||||||
versionName "1.4.0"
|
versionName "1.4.1"
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
vivo_APPID: "105669716",
|
vivo_APPID: "105669716",
|
||||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
|||||||
import 'package:circle_app/app/circle/widgets/like_view.dart';
|
import 'package:circle_app/app/circle/widgets/like_view.dart';
|
||||||
import 'package:circle_app/app/circle/widgets/vicinity.dart';
|
import 'package:circle_app/app/circle/widgets/vicinity.dart';
|
||||||
import 'package:circle_app/app/dialog/ScreenBottomSheetDialog.dart';
|
import 'package:circle_app/app/dialog/ScreenBottomSheetDialog.dart';
|
||||||
import 'package:circle_app/app/like/view.dart';
|
import 'package:circle_app/app/circle/view.dart';
|
||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/eventBus.dart';
|
import 'package:circle_app/util/eventBus.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import 'package:circle_app/app/circle/logic.dart';
|
|||||||
import 'package:circle_app/app/circle/state.dart';
|
import 'package:circle_app/app/circle/state.dart';
|
||||||
import 'package:circle_app/app/circle/widgets/list_logic.dart';
|
import 'package:circle_app/app/circle/widgets/list_logic.dart';
|
||||||
import 'package:circle_app/app/circle/widgets/video_item.dart';
|
import 'package:circle_app/app/circle/widgets/video_item.dart';
|
||||||
import 'package:circle_app/app/like/logic.dart';
|
import 'package:circle_app/app/circle/logic.dart';
|
||||||
import 'package:circle_app/app/select_circle/logic.dart';
|
import 'package:circle_app/app/select_circle/logic.dart';
|
||||||
import 'package:circle_app/common/Widgets/base_tip_widget.dart';
|
import 'package:circle_app/common/Widgets/base_tip_widget.dart';
|
||||||
import 'package:circle_app/common/Widgets/circle_share.dart';
|
import 'package:circle_app/common/Widgets/circle_share.dart';
|
||||||
@ -23,6 +23,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
|
|
||||||
import '../../../util/SharedPreferencesHelper.dart';
|
import '../../../util/SharedPreferencesHelper.dart';
|
||||||
import '../../../util/eventBus.dart';
|
import '../../../util/eventBus.dart';
|
||||||
|
import '../../circle_list/logic.dart';
|
||||||
|
|
||||||
class InfoListView extends StatefulWidget {
|
class InfoListView extends StatefulWidget {
|
||||||
// Get.lazyPut(() => ListLogic());
|
// Get.lazyPut(() => ListLogic());
|
||||||
|
|||||||
10
circle_app/lib/app/circle_list/binding.dart
Normal file
10
circle_app/lib/app/circle_list/binding.dart
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class LikeBinding extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.lazyPut(() => LikeLogic());
|
||||||
|
}
|
||||||
|
}
|
||||||
205
circle_app/lib/app/circle_list/logic.dart
Normal file
205
circle_app/lib/app/circle_list/logic.dart
Normal file
@ -0,0 +1,205 @@
|
|||||||
|
import 'package:circle_app/app/circle/logic.dart';
|
||||||
|
import 'package:circle_app/app/home/logic.dart';
|
||||||
|
import 'package:circle_app/app/invite/logic.dart';
|
||||||
|
import 'package:circle_app/network/api.dart';
|
||||||
|
import 'package:circle_app/network/dio_manager.dart';
|
||||||
|
import 'package:circle_app/util/util.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class LikeLogic extends GetxController {
|
||||||
|
int currentIndex = -1;
|
||||||
|
|
||||||
|
int page = 1;
|
||||||
|
int myPage = 1;
|
||||||
|
|
||||||
|
InterestsBean circle = InterestsBean(lists: []);
|
||||||
|
InterestsBean mycircle = InterestsBean(lists: []);
|
||||||
|
|
||||||
|
ScrollController leftCtr = ScrollController();
|
||||||
|
ScrollController rightCtr = ScrollController();
|
||||||
|
ScrollController myCircleCtr = ScrollController();
|
||||||
|
|
||||||
|
bool isMore = true;
|
||||||
|
bool isMyMore = true;
|
||||||
|
bool isLoad = true;
|
||||||
|
|
||||||
|
List<bool> hasNewList = [];
|
||||||
|
|
||||||
|
Data? homeData;
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
// leftCtr.addListener(() {
|
||||||
|
// if (leftCtr.position.pixels ==
|
||||||
|
// leftCtr.position.maxScrollExtent) {
|
||||||
|
// loadMore();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
rightCtr.addListener(() {
|
||||||
|
if (rightCtr.position.pixels ==
|
||||||
|
rightCtr.position.maxScrollExtent) {
|
||||||
|
loadMore();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//
|
||||||
|
// myCircleCtr.addListener(() {
|
||||||
|
// if (myCircleCtr.position.pixels ==
|
||||||
|
// myCircleCtr.position.maxScrollExtent) {
|
||||||
|
// loadMyMore();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
loadInviteData();
|
||||||
|
loadCircleListData();
|
||||||
|
loadMyCircleData();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadData() {
|
||||||
|
loadInviteData();
|
||||||
|
loadCircleListData();
|
||||||
|
loadMyCircleData();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadInviteData() async {
|
||||||
|
|
||||||
|
var data = await DioManager.instance.get(url: Api.inviteMainPage);
|
||||||
|
if (data['code'] == 200) {
|
||||||
|
Autogenerated result = Autogenerated.fromJson(data);
|
||||||
|
|
||||||
|
homeData = result.data;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loadCircleListData() async {
|
||||||
|
var data = await DioManager.instance.get(
|
||||||
|
url: Api.getCircleInterests, params: {"page": page, 'page_size': 20});
|
||||||
|
var bean = BaseResponse<InterestsBean>.fromJson(
|
||||||
|
data, (data) => InterestsBean.fromJson(data));
|
||||||
|
if (bean.data is InterestsBean && bean.isSuccess()) {
|
||||||
|
if (page == 1) {
|
||||||
|
circle = bean.data!;
|
||||||
|
} else {
|
||||||
|
circle.lists.addAll(bean.data!.lists);
|
||||||
|
}
|
||||||
|
|
||||||
|
isLoad = false;
|
||||||
|
if (bean.data!.lists.length < 20) {
|
||||||
|
isMore = false;
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loadMyCircleData() async {
|
||||||
|
var data = await DioManager.instance
|
||||||
|
.get(url: Api.getMyCircleAll);
|
||||||
|
|
||||||
|
// var bean = BaseResponse<InterestsBean>.fromJson(
|
||||||
|
// data, (data) => InterestsBean.fromJson(data));
|
||||||
|
|
||||||
|
if (data['code'] == 200) {
|
||||||
|
List circleList = data['data'];
|
||||||
|
if (circleList.isNotEmpty) {
|
||||||
|
List<Circle> infoList = [];
|
||||||
|
circleList.forEach((element) {
|
||||||
|
var info = Circle.fromJson(element);
|
||||||
|
infoList.add(info);
|
||||||
|
});
|
||||||
|
mycircle.lists = infoList;
|
||||||
|
if (currentIndex >= mycircle.lists.length - 1) {
|
||||||
|
currentIndex = mycircle.lists.length -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
loadCalloutsNew();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadMore() {
|
||||||
|
if (isMore) {
|
||||||
|
page = page + 1;
|
||||||
|
loadCircleListData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void relaodData() {
|
||||||
|
page = 1;
|
||||||
|
loadCircleListData();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadMyMore() {
|
||||||
|
if (isMyMore) {
|
||||||
|
myPage = myPage + 1;
|
||||||
|
loadMyCircleData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void relaodMyData() {
|
||||||
|
myPage = 1;
|
||||||
|
loadMyCircleData();
|
||||||
|
}
|
||||||
|
|
||||||
|
outCircle(String interest_id, bool isStatus) async {
|
||||||
|
var data = await DioManager.instance.post(
|
||||||
|
url: "${Api.outCrrcle}$interest_id/join",
|
||||||
|
params: {"status": isStatus ? "0" : "1"});
|
||||||
|
var bean = BaseResponse<String>.fromJson(data, (data) => data);
|
||||||
|
if (bean.code == 200) {
|
||||||
|
circle.lists.forEach((element) {
|
||||||
|
if (element.id.toString() == interest_id.toString()) {
|
||||||
|
element.isJoin = !isStatus;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
relaodMyData();
|
||||||
|
}
|
||||||
|
showOKToast(bean.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
setTopCircle(String interest_id,bool isStatus) async {
|
||||||
|
var data = await DioManager.instance.post(
|
||||||
|
url: Api.circleTop,
|
||||||
|
params: {"interestId": interest_id,'isTop' :isStatus ? 1 : 0});
|
||||||
|
var bean = BaseResponse<String>.fromJson(data, (data) => data);
|
||||||
|
if (bean.code == 200) {
|
||||||
|
relaodMyData();
|
||||||
|
}
|
||||||
|
showOKToast(bean.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
loadCalloutsNew() async {
|
||||||
|
List<String> idList = [];
|
||||||
|
mycircle.lists.forEach((element) {
|
||||||
|
idList.add(element.id.toString());
|
||||||
|
});
|
||||||
|
var data = await DioManager.instance.post(
|
||||||
|
url:Api.calloutsNew,
|
||||||
|
params: {"interestIds":idList});
|
||||||
|
|
||||||
|
if (data['code'] == 200) {
|
||||||
|
hasNewList.clear();
|
||||||
|
List infoList = data['data'];
|
||||||
|
bool isHasNew = false;
|
||||||
|
if (infoList.isNotEmpty) {
|
||||||
|
infoList.forEach((element) {
|
||||||
|
// "hasNew" -> false
|
||||||
|
hasNewList.add(element['hasNew']);
|
||||||
|
if (element['hasNew']) {
|
||||||
|
isHasNew = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
HomeLogic logic = Get.find<HomeLogic>();
|
||||||
|
logic.showcirlceUnred.value = isHasNew;
|
||||||
|
// logic.update();
|
||||||
|
// update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
819
circle_app/lib/app/circle_list/view.dart
Normal file
819
circle_app/lib/app/circle_list/view.dart
Normal file
@ -0,0 +1,819 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
import 'package:circle_app/app/circle/logic.dart';
|
||||||
|
import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
||||||
|
import 'package:circle_app/app/select_circle/logic.dart';
|
||||||
|
import 'package:circle_app/common/Widgets/circle_share.dart';
|
||||||
|
import 'package:circle_app/common/Widgets/text_more.dart';
|
||||||
|
import 'package:circle_app/main.dart';
|
||||||
|
import 'package:circle_app/network/dio_manager.dart';
|
||||||
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
|
import 'package:circle_app/util/util.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class CircleListPage extends StatefulWidget {
|
||||||
|
CircleListPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CircleListPage> createState() => _CircleListPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CircleListPageState extends State<CircleListPage> with RouteAware {
|
||||||
|
final ctr = Get.lazyPut(() => LikeLogic());
|
||||||
|
|
||||||
|
final logic = Get.find<LikeLogic>();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeDependencies() {
|
||||||
|
// TODO: implement didChangeDependencies
|
||||||
|
super.didChangeDependencies();
|
||||||
|
|
||||||
|
/// 路由订阅
|
||||||
|
routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
routeObserver.unsubscribe(this);
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
void didPopNext() {
|
||||||
|
print('didPopNext');
|
||||||
|
logic.loadMyCircleData();
|
||||||
|
}
|
||||||
|
|
||||||
|
///当前页面进入时触发
|
||||||
|
void didPush() {
|
||||||
|
print('didPopNext');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void didPop() {
|
||||||
|
print('didPop');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
body: SafeArea(
|
||||||
|
child: GetBuilder<LikeLogic>(builder: (logic) {
|
||||||
|
return logic.isLoad
|
||||||
|
? loaddingWidget(true)
|
||||||
|
: Container(
|
||||||
|
width: Get.width,
|
||||||
|
height: Get.height,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 65.sp,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
leftItem('', logic.currentIndex == -1, false, -1),
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
height: 20,
|
||||||
|
child: Container(
|
||||||
|
width: 33.sp,
|
||||||
|
height: 1.sp,
|
||||||
|
color: Color(0x4DFFFFFF),
|
||||||
|
)),
|
||||||
|
Expanded(
|
||||||
|
child: MediaQuery.removePadding(
|
||||||
|
removeTop: true,
|
||||||
|
context: context,
|
||||||
|
child: ListView.builder(
|
||||||
|
controller: logic.myCircleCtr,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return leftItem(
|
||||||
|
logic.mycircle.lists[index].title,
|
||||||
|
logic.currentIndex == index,
|
||||||
|
logic.hasNewList.length > index
|
||||||
|
? logic.hasNewList[index]
|
||||||
|
: false,
|
||||||
|
index);
|
||||||
|
},
|
||||||
|
itemCount: logic.mycircle.lists.length,
|
||||||
|
)))
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: logic.currentIndex == -1
|
||||||
|
? circleInfoListView()
|
||||||
|
: InfoListView(
|
||||||
|
logic.currentIndex,
|
||||||
|
logic.mycircle.lists[logic.currentIndex],
|
||||||
|
logic,
|
||||||
|
key: ValueKey(
|
||||||
|
'${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),
|
||||||
|
)))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
circleInfoListView() {
|
||||||
|
return Stack(
|
||||||
|
fit: StackFit.expand,
|
||||||
|
children: [
|
||||||
|
RefreshIndicator(
|
||||||
|
onRefresh: () async {
|
||||||
|
logic.relaodData();
|
||||||
|
},
|
||||||
|
child: ListView.builder(
|
||||||
|
controller: logic.rightCtr ,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
if (index == logic.circle.lists.length) {
|
||||||
|
return loaddingWidget(logic.isMore);
|
||||||
|
}
|
||||||
|
return circleInfoItem(logic.circle.lists[index],index);
|
||||||
|
},
|
||||||
|
itemCount: logic.circle.lists.length + 1,
|
||||||
|
)),
|
||||||
|
Positioned(
|
||||||
|
bottom: 36.sp,
|
||||||
|
right: 10.sp,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
var data = await Get.toNamed(
|
||||||
|
AppRoutes.Call_out,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
getCircleImage('send_msg'),
|
||||||
|
width: 70.sp,
|
||||||
|
)))
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
goDetailPage(Circle bean,int index) async {
|
||||||
|
// if (!bean.isJoin) {
|
||||||
|
// await logic.outCircle(
|
||||||
|
// bean.id.toString(),
|
||||||
|
// bean.isJoin);
|
||||||
|
// }
|
||||||
|
|
||||||
|
var result = await Get.toNamed(AppRoutes.Signal_circle_list, arguments: bean.id);
|
||||||
|
var data = await DioManager.instance.get(
|
||||||
|
url: "/up-service/interest/${bean.id}",);
|
||||||
|
if (data["code"] == 200) {
|
||||||
|
var bean = Circle.fromJson(data['data']);
|
||||||
|
logic.circle.lists[index] = bean;
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
goAndJoinDetailPage(Circle bean,int index) async {
|
||||||
|
if (!bean.isJoin) {
|
||||||
|
await logic.outCircle(
|
||||||
|
bean.id.toString(),
|
||||||
|
bean.isJoin);
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = await Get.toNamed(AppRoutes.Signal_circle_list, arguments: bean.id);
|
||||||
|
var data = await DioManager.instance.get(
|
||||||
|
url: "/up-service/interest/${bean.id}",);
|
||||||
|
if (data["code"] == 200) {
|
||||||
|
var bean = Circle.fromJson(data['data']);
|
||||||
|
logic.circle.lists[index] = bean;
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
circleInfoItem(Circle bean,int index) {
|
||||||
|
List<JoinUser> urlList = bean.lastJoinUsers;
|
||||||
|
List<Widget> widgets = [];
|
||||||
|
int i = 0;
|
||||||
|
// print(urlList);
|
||||||
|
if (null != urlList) {
|
||||||
|
urlList.forEach((element) {
|
||||||
|
if (widgets.length > 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
widgets.add(Positioned(
|
||||||
|
left: 15.sp * i,
|
||||||
|
child: circleWidget(
|
||||||
|
element.avatar! ??
|
||||||
|
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
|
||||||
|
element.id.toString()),
|
||||||
|
));
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
goDetailPage(bean, index);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(bottom: 10.sp),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(10.sp),
|
||||||
|
topRight: Radius.circular(10.sp)),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||||
|
height: 72.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
image: AssetImage(getCircleImage('top_circle_bg')))),
|
||||||
|
child: Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 42.sp,
|
||||||
|
height: 42.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
colors: [
|
||||||
|
Color(0xFF71F3F2),
|
||||||
|
Color(0xFFF558FF),
|
||||||
|
],
|
||||||
|
stops: [0.0365, 0.9427],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.all(1.sp),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
imageUrl: bean.image,
|
||||||
|
width: 40.sp,
|
||||||
|
height: 40.sp,
|
||||||
|
memCacheHeight: 40,
|
||||||
|
memCacheWidth: 40,
|
||||||
|
fit: BoxFit.cover),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||||
|
// alignment: Alignment.,
|
||||||
|
height: 72.sp,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
bean.title,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 18.sp,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 4.sp,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${convertToTenThousand(bean.viewTotal)}人看过',
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: TextStyle(
|
||||||
|
color: const Color(0xff03FEFB),
|
||||||
|
fontSize: 12.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
GestureDetector(
|
||||||
|
//加入圈子
|
||||||
|
onTap: () async {
|
||||||
|
if (bean.isJoin) {
|
||||||
|
Get.bottomSheet(CircleShare('', '', bean),
|
||||||
|
isScrollControlled: true, enableDrag: false);
|
||||||
|
} else {
|
||||||
|
goAndJoinDetailPage(bean, index);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
getCircleImage('add'),
|
||||||
|
width: 77.sp,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
!bean.isJoin ? '申请加入' : '分享有奖',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white, fontSize: 12.sp),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||||
|
// height:urlList.length==0?47.sp: 118.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
image: AssetImage(getCircleImage('circle_desc')))),
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(bottom: 7.sp),
|
||||||
|
width: Get.width - 80.sp,
|
||||||
|
// height: 50.sp,
|
||||||
|
child: HideText(
|
||||||
|
text: bean.intro,
|
||||||
|
maxWidth: Get.width - 89.sp,
|
||||||
|
additionText: '查看更多',
|
||||||
|
maxLines: 3,
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 17.sp),
|
||||||
|
additionStyle: TextStyle(
|
||||||
|
color: const Color(0xFFFF4DF6), fontSize: 17.sp),
|
||||||
|
onTap: () {
|
||||||
|
goDetailPage(bean, index);
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
urlList.length == 0
|
||||||
|
? Container()
|
||||||
|
: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 30.sp,
|
||||||
|
width:
|
||||||
|
30.0.sp + 14.sp * (widgets.length - 1.sp),
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: widgets,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 4.sp,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${convertToTenThousand(bean.joinTotal)}圈友加入',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white, fontSize: 12.sp),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 4.sp,
|
||||||
|
),
|
||||||
|
// GestureDetector(
|
||||||
|
// onTap: () {
|
||||||
|
// // Get.bottomSheet(
|
||||||
|
// // CircleShare(logic.homeData!.inviteCode!,logic.homeData!.link!,bean), isScrollControlled: true,
|
||||||
|
// // enableDrag: false
|
||||||
|
// // );
|
||||||
|
// },
|
||||||
|
// behavior: HitTestBehavior.opaque,
|
||||||
|
// child: Container(
|
||||||
|
// height: 30.sp,
|
||||||
|
// alignment: Alignment.center,
|
||||||
|
// child: Image.asset(
|
||||||
|
// getCircleImage('play'),
|
||||||
|
// width: 20.sp,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
circleWidget(String url, String userId, {double width = 24}) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
|
||||||
|
},
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
getCircleImage('avatar_bg'),
|
||||||
|
width: width.sp,
|
||||||
|
),
|
||||||
|
ClipOval(
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
imageUrl: url ??
|
||||||
|
"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png",
|
||||||
|
width: (width - 1).sp,
|
||||||
|
height: (width - 1).sp,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
memCacheHeight: width.toInt() - 1,
|
||||||
|
memCacheWidth: width.toInt() - 1,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
leftItem(String text, bool isSelcted, bool isUnread, int index) {
|
||||||
|
return GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap: () async {
|
||||||
|
logic.currentIndex = index;
|
||||||
|
|
||||||
|
if (index >= 0) {
|
||||||
|
logic.hasNewList[index] = false;
|
||||||
|
logic.update();
|
||||||
|
Future.delayed(Duration(seconds: 1), () {
|
||||||
|
logic.loadCalloutsNew();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
logic.update();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLongPress: () {
|
||||||
|
if (index >= 0) {
|
||||||
|
int count = 0;
|
||||||
|
for(int i = 0; i < logic.mycircle.lists.length; i++) {
|
||||||
|
if (logic.mycircle.lists[i].is_top) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (count == 5 || i > 5) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count == 5 && !logic.mycircle.lists[index].is_top) {
|
||||||
|
showOKToast('最多置顶5个,可长按已置顶圈子取消置顶哦~');
|
||||||
|
} else {
|
||||||
|
_showSetTopCircleDialog(Get.context!,logic,logic.mycircle.lists[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 65.sp,
|
||||||
|
height: 65.sp,
|
||||||
|
color: isSelcted ? Colors.white.withOpacity(0.3) : Colors.transparent,
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
if (text.isEmpty)
|
||||||
|
topCicleStatusItem(
|
||||||
|
isSelcted,
|
||||||
|
Image.asset(
|
||||||
|
getCircleImage('circile_all_icon'),
|
||||||
|
width: 55.sp,
|
||||||
|
)),
|
||||||
|
if (text.isNotEmpty)
|
||||||
|
cicleStatusItem(
|
||||||
|
isSelcted,
|
||||||
|
Container(
|
||||||
|
// margin: EdgeInsets.all(6.sp),
|
||||||
|
// padding: EdgeInsets.only(left: 4.sp),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
// padding: EdgeInsets.all(6.sp),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(7.sp),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [Color(0xFF3F6967), Color(0xFF5C3769)])),
|
||||||
|
child: Text(
|
||||||
|
text,
|
||||||
|
maxLines: 2,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 13.sp,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
if (isUnread)
|
||||||
|
Positioned(
|
||||||
|
right: 6.sp,
|
||||||
|
top: 6.sp,
|
||||||
|
child: Container(
|
||||||
|
width: 15.sp,
|
||||||
|
height: 15.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [Color(0xFFC343F9), Color(0xFFFB34B2)]),
|
||||||
|
border:
|
||||||
|
Border.all(color: Color(0xFF170730), width: 1.sp)),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
cicleStatusItem(bool isSelected, Widget widget) {
|
||||||
|
return Container(
|
||||||
|
width: 48.sp,
|
||||||
|
height: 48.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(7.0),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
colors: isSelected
|
||||||
|
? [
|
||||||
|
Color(0xFF71F3F2),
|
||||||
|
Color(0xFFF558FF),
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
Colors.transparent,
|
||||||
|
Colors.transparent,
|
||||||
|
],
|
||||||
|
stops: [0.0365, 0.9427],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(7.0),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(isSelected ? 1.sp : 0.sp),
|
||||||
|
color: Color(0x14022AFF),
|
||||||
|
child: widget,
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
topCicleStatusItem(bool isSelected, Widget widget) {
|
||||||
|
return Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
width: 48.sp,
|
||||||
|
height: 48.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(7.0),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
colors: isSelected
|
||||||
|
? [
|
||||||
|
Color(0xFF71F3F2),
|
||||||
|
Color(0xFFF558FF),
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
Colors.transparent,
|
||||||
|
Colors.transparent,
|
||||||
|
],
|
||||||
|
stops: [0.0365, 0.9427],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: 47.sp,
|
||||||
|
height: 47.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(7.sp),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [Color(0xFF3F6967), Color(0xFF5C3769)])),
|
||||||
|
// padding: EdgeInsets.all(isSelected ? 1.sp : 0),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(7.0),
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.all(isSelected ? 1.sp : 0.sp),
|
||||||
|
color: Color(0x14022AFF),
|
||||||
|
child: widget,
|
||||||
|
))),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _showTextContentDialog(BuildContext context, String msg, String title) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Dialog(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
child: Container(
|
||||||
|
height: 300.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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 15,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Center(
|
||||||
|
child: Text(title,
|
||||||
|
style: TextStyle(
|
||||||
|
color: const Color(0xFFF7FAFA), fontSize: 16.sp)),
|
||||||
|
)),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 24.sp, bottom: 24.sp),
|
||||||
|
child: Container(
|
||||||
|
margin:
|
||||||
|
EdgeInsets.only(top: 12.sp, left: 14.sp, right: 14.sp),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Text(
|
||||||
|
msg,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 8.sp,
|
||||||
|
right: 10.sp,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
Icons.close,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 20.sp,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _showSetTopCircleDialog(BuildContext context, var controller, var bean) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Dialog(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
child: Container(
|
||||||
|
height: 160.sp,
|
||||||
|
padding: EdgeInsets.all(1.0),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
gradient: 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: 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: 12.sp, left: 14.sp, right: 14.sp),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
bean.is_top ? "是否取消置顶该圈子。" : "是否置顶该圈子。",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 30.sp),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(17),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0x26FFFFFF),
|
||||||
|
Color(0x26FFFFFF),
|
||||||
|
],
|
||||||
|
begin: Alignment.centerLeft,
|
||||||
|
end: Alignment.centerRight,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: 10.sp,
|
||||||
|
bottom: 10.sp,
|
||||||
|
left: 52.sp,
|
||||||
|
right: 52.sp),
|
||||||
|
child: Text(
|
||||||
|
"否",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 24.sp),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
logic.setTopCircle(bean.id.toString(), !bean.is_top);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 24.sp),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(17),
|
||||||
|
gradient: 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: Text(
|
||||||
|
"是",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
193
circle_app/lib/app/circle_list/widgets/circie_info_edit.dart
Normal file
193
circle_app/lib/app/circle_list/widgets/circie_info_edit.dart
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
import 'package:circle_app/common/colors/app_color.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../util/util.dart';
|
||||||
|
|
||||||
|
class CircieInfoEdit extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_CircieInfoEditState createState() => new _CircieInfoEditState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CircieInfoEditState extends State<CircieInfoEdit> {
|
||||||
|
// TODO: add state variables and methods
|
||||||
|
|
||||||
|
TextEditingController nameController = TextEditingController();
|
||||||
|
TextEditingController descController = TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// TODO: add widget build method
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(child: Container()),
|
||||||
|
Container(
|
||||||
|
height: 592.sp,
|
||||||
|
width: Get.width,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFF423055),
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(16.sp),
|
||||||
|
topRight: Radius.circular(16.sp))),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 8.sp),
|
||||||
|
width: 30.sp,
|
||||||
|
height: 3.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0x33FFFFFF),
|
||||||
|
borderRadius: BorderRadius.circular(1.5.sp)),
|
||||||
|
),
|
||||||
|
//圈子信息
|
||||||
|
Container(
|
||||||
|
height: 130.sp,
|
||||||
|
margin:
|
||||||
|
EdgeInsets.only(left: 10.sp, right: 10.sp, top: 14.sp),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0x1AFFFFFF),
|
||||||
|
borderRadius: BorderRadius.circular(10.sp)),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'更换圈子封面',
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
'点击上传',
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||||
|
)),
|
||||||
|
Image(
|
||||||
|
image: AssetImage(getHomeImage("icon_in")),
|
||||||
|
width: 24.sp,
|
||||||
|
height: 24.sp,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 1.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: AppColor.mainVerLinearGradient),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 200.sp,
|
||||||
|
child: TextField(
|
||||||
|
onChanged: (msg) {},
|
||||||
|
controller: nameController,
|
||||||
|
maxLength: 6,
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: '请输入圈子名称',
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
color: Colors.white70, fontSize: 16.sp),
|
||||||
|
border: InputBorder.none,
|
||||||
|
counterText: '',
|
||||||
|
contentPadding: EdgeInsets.only(left: 16.sp)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||||
|
height: 1.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: AppColor.mainHorLinearGradient),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 200.sp,
|
||||||
|
child: TextField(
|
||||||
|
onChanged: (msg) {},
|
||||||
|
controller: nameController,
|
||||||
|
maxLength: 100,
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: '请输入圈子描述',
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
color: Colors.white70, fontSize: 16.sp),
|
||||||
|
border: InputBorder.none,
|
||||||
|
counterText: '',
|
||||||
|
contentPadding: EdgeInsets.only(left: 16.sp)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||||
|
height: 1.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: AppColor.mainHorLinearGradient),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
//圈子活动
|
||||||
|
Container(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'每日任务0/5',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16.sp,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Expanded(child: Container()),
|
||||||
|
Image.asset(
|
||||||
|
getMineImage('bi_icon1'),
|
||||||
|
width: 20.sp,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'300',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 58.sp,
|
||||||
|
margin:
|
||||||
|
EdgeInsets.only(left: 10.sp, right: 10.sp, top: 14.sp),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0x1AFFFFFF),
|
||||||
|
borderRadius: BorderRadius.circular(10.sp)),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'发布今日第一条喊话',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white, fontSize: 14.sp),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'高质量的喊话更容易吸引图友加入',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0x99FFFFFF), fontSize: 12.sp),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Image(
|
||||||
|
image: AssetImage(getHomeImage("icon_in")),
|
||||||
|
width: 24.sp,
|
||||||
|
height: 24.sp,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
148
circle_app/lib/app/circle_list/widgets/create_circle.dart
Normal file
148
circle_app/lib/app/circle_list/widgets/create_circle.dart
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
import 'package:circle_app/common/colors/app_color.dart';
|
||||||
|
import 'package:circle_app/util/util.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:gradient_borders/gradient_borders.dart';
|
||||||
|
|
||||||
|
class CreateCircle extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_CreateCircleState createState() => new _CreateCircleState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CreateCircleState extends State<CreateCircle> {
|
||||||
|
// TODO: add state variables and methods
|
||||||
|
String circleAvatartUrl = '';
|
||||||
|
TextEditingController nameController = TextEditingController();
|
||||||
|
TextEditingController descController = TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// TODO: add widget build method
|
||||||
|
return Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: GradientBoxBorder(
|
||||||
|
gradient: AppColor.mainVerLinearGradient,
|
||||||
|
width: 1.sp,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(8.sp),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFF4C3E5F),
|
||||||
|
Color(0xFF324140),
|
||||||
|
],
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
)),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 18.sp),
|
||||||
|
child: Text(
|
||||||
|
'创建圈子',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0xFFF7FAFA),
|
||||||
|
fontSize: 16.sp,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {},
|
||||||
|
child: Image.asset(
|
||||||
|
getCircleImage('add'),
|
||||||
|
width: 106.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 200.sp,
|
||||||
|
child: TextField(
|
||||||
|
onChanged: (msg) {},
|
||||||
|
controller: nameController,
|
||||||
|
maxLength: 6,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: '请输入圈子名称',
|
||||||
|
hintStyle:
|
||||||
|
TextStyle(color: Colors.white70, fontSize: 16.sp),
|
||||||
|
border: InputBorder.none,
|
||||||
|
counterText: '',
|
||||||
|
contentPadding: EdgeInsets.only(left: 16.sp)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||||
|
height: 1.sp,
|
||||||
|
decoration:
|
||||||
|
BoxDecoration(gradient: AppColor.mainHorLinearGradient),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 200.sp,
|
||||||
|
child: TextField(
|
||||||
|
onChanged: (msg) {},
|
||||||
|
controller: nameController,
|
||||||
|
maxLength: 100,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: '请输入圈子描述',
|
||||||
|
hintStyle:
|
||||||
|
TextStyle(color: Colors.white70, fontSize: 16.sp),
|
||||||
|
border: InputBorder.none,
|
||||||
|
counterText: '',
|
||||||
|
contentPadding: EdgeInsets.only(left: 16.sp)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||||
|
height: 1.sp,
|
||||||
|
decoration:
|
||||||
|
BoxDecoration(gradient: AppColor.mainHorLinearGradient),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 14.sp, left: 10.sp),
|
||||||
|
child: Text(
|
||||||
|
'温馨提示',
|
||||||
|
style: TextStyle(color: AppColor.mainColor, fontSize: 12.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 4.sp, left: 10.sp),
|
||||||
|
child: Text(
|
||||||
|
'1、圈子名称不超过6个字,描述不超过100字;;',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 4.sp, left: 10.sp),
|
||||||
|
child: Text(
|
||||||
|
'2、名称和描述不要包含特殊字符或违规词汇,通过人工审核后才会发布;',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 4.sp, left: 10.sp),
|
||||||
|
child: Text(
|
||||||
|
'3、优质园子和圈主有机会获得丰厚奖励哦~',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Container(
|
||||||
|
width: 190.sp,
|
||||||
|
height: 42.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(21.sp),
|
||||||
|
gradient: AppColor.mainHorLinearGradient
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text('立即创建',style: TextStyle(color: Colors.white,fontSize: 16.sp,fontWeight: FontWeight.bold),),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,7 +5,6 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:circle_app/app/chat/widget/svg_dialog.dart';
|
import 'package:circle_app/app/chat/widget/svg_dialog.dart';
|
||||||
import 'package:circle_app/app/circle/logic.dart';
|
import 'package:circle_app/app/circle/logic.dart';
|
||||||
import 'package:circle_app/app/like/view.dart';
|
|
||||||
import 'package:circle_app/app/minefragment/logic.dart';
|
import 'package:circle_app/app/minefragment/logic.dart';
|
||||||
import 'package:circle_app/app/msg/logic.dart';
|
import 'package:circle_app/app/msg/logic.dart';
|
||||||
import 'package:circle_app/main.dart';
|
import 'package:circle_app/main.dart';
|
||||||
@ -31,8 +30,9 @@ import '../../util/SharedPreferencesHelper.dart';
|
|||||||
import '../../util/eventBus.dart';
|
import '../../util/eventBus.dart';
|
||||||
import '../../view/notice.dart';
|
import '../../view/notice.dart';
|
||||||
import '../circle/view.dart';
|
import '../circle/view.dart';
|
||||||
|
import '../circle_list/logic.dart';
|
||||||
|
import '../circle_list/view.dart';
|
||||||
import '../dialog/UpdateDialog.dart';
|
import '../dialog/UpdateDialog.dart';
|
||||||
import '../like/logic.dart';
|
|
||||||
import '../minefragment/view.dart';
|
import '../minefragment/view.dart';
|
||||||
import '../msg/view.dart';
|
import '../msg/view.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
@ -86,7 +86,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
|||||||
setFirstData();
|
setFirstData();
|
||||||
|
|
||||||
tabs.add(CirclePage());
|
tabs.add(CirclePage());
|
||||||
tabs.add(LikePage());
|
tabs.add(CircleListPage());
|
||||||
tabs.add(MsgPage());
|
tabs.add(MsgPage());
|
||||||
tabs.add(MinefragmentPage());
|
tabs.add(MinefragmentPage());
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import 'package:circle_app/app/circle/view.dart';
|
import 'package:circle_app/app/circle/view.dart';
|
||||||
import 'package:circle_app/app/like/view.dart';
|
|
||||||
import 'package:circle_app/app/minefragment/view.dart';
|
import 'package:circle_app/app/minefragment/view.dart';
|
||||||
import 'package:circle_app/app/msg/view.dart';
|
import 'package:circle_app/app/msg/view.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
@ -9,6 +8,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
|
import '../circle_list/view.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
@ -112,7 +112,7 @@ class _HomePageState extends State<HomePage>
|
|||||||
controller: logic.tabController,
|
controller: logic.tabController,
|
||||||
children: [
|
children: [
|
||||||
const CirclePage(),
|
const CirclePage(),
|
||||||
LikePage(),
|
CircleListPage(),
|
||||||
MsgPage(),
|
MsgPage(),
|
||||||
MinefragmentPage()
|
MinefragmentPage()
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
|
|
||||||
class Api {
|
class Api {
|
||||||
static const baseUrl = 'https://leyuan666.com/zuul-service/';
|
static const baseUrl2 = 'https://wlybiz.cdtszn.net/zuul-service/';
|
||||||
|
static const baseUrl1 = 'https://wlybiz.leyuan666.com/zuul-service/';
|
||||||
|
|
||||||
|
static const baseUrl = 'http://192.168.3.55:2000/';
|
||||||
// static const baseUrl = 'http://192.168.3.55:2000/';
|
|
||||||
|
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'dart:math';
|
||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
@ -9,7 +10,7 @@ import '../util/device.dart';
|
|||||||
import 'api.dart';
|
import 'api.dart';
|
||||||
import 'package:connectivity/connectivity.dart';
|
import 'package:connectivity/connectivity.dart';
|
||||||
|
|
||||||
const String baseUrl = Api.baseUrl;
|
// const String baseUrl = Api.baseUrl;
|
||||||
|
|
||||||
/// Dio 请求方法
|
/// Dio 请求方法
|
||||||
|
|
||||||
@ -36,9 +37,10 @@ class DioManager {
|
|||||||
Dio? _dio;
|
Dio? _dio;
|
||||||
|
|
||||||
DioManager._init() {
|
DioManager._init() {
|
||||||
|
int type = Random().nextInt(2);
|
||||||
_dio ??= Dio(BaseOptions(
|
_dio ??= Dio(BaseOptions(
|
||||||
// 请求基地址
|
// baseUrl2
|
||||||
baseUrl: baseUrl,
|
baseUrl: type == 1 ? Api.baseUrl2 : Api.baseUrl1,
|
||||||
// 连接服务器超时时间,单位是毫秒
|
// 连接服务器超时时间,单位是毫秒
|
||||||
connectTimeout: const Duration(seconds: 30),
|
connectTimeout: const Duration(seconds: 30),
|
||||||
// 接收数据的最长时限
|
// 接收数据的最长时限
|
||||||
@ -53,7 +55,7 @@ class DioManager {
|
|||||||
setReceiveTimeout (int time) {
|
setReceiveTimeout (int time) {
|
||||||
_dio!.options = BaseOptions(
|
_dio!.options = BaseOptions(
|
||||||
// 请求基地址
|
// 请求基地址
|
||||||
baseUrl: baseUrl,
|
baseUrl: _dio!.options!.baseUrl,
|
||||||
// 连接服务器超时时间,单位是毫秒
|
// 连接服务器超时时间,单位是毫秒
|
||||||
connectTimeout: const Duration(seconds: 30),
|
connectTimeout: const Duration(seconds: 30),
|
||||||
// 接收数据的最长时限
|
// 接收数据的最长时限
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user