补代码
This commit is contained in:
parent
a74025c4c4
commit
10cb12fb66
@ -293,6 +293,6 @@ class AccountPage extends StatelessWidget {
|
||||
Future<void> getAuthorization() async{
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.remove("Authorization");
|
||||
Get.toNamed(AppRoutes.Login);
|
||||
Get.offAllNamed(AppRoutes.Login);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,118 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart';
|
||||
|
||||
import '../../network/api.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../router/app_routers.dart';
|
||||
import '../login/complete_material/logic.dart';
|
||||
import '../select_circle/logic.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class Call_outLogic extends GetxController {
|
||||
final Call_outState state = Call_outState();
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
bool isCheck = false;
|
||||
late ConfigBean configBean;
|
||||
String circleName = "";
|
||||
final ImagePicker _picker = ImagePicker();
|
||||
var storage = Storage();
|
||||
var quToken = '';
|
||||
|
||||
|
||||
@override
|
||||
void onInit() async{
|
||||
super.onInit();
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getCircleList, params: {});
|
||||
var bean = BaseResponse<ConfigBean>.fromJson(
|
||||
data, (data) => ConfigBean.fromJson(data));
|
||||
configBean = bean.data!;
|
||||
|
||||
|
||||
|
||||
var quniuData = await DioManager.instance.get(url: Api.getqiniuToken, params: {});
|
||||
var qiniuBean = BaseResponse<QnTokenData>.fromJson(
|
||||
quniuData, (quniuData) => QnTokenData.fromJson(quniuData));
|
||||
quToken = qiniuBean.data!.token.toString();
|
||||
|
||||
|
||||
}
|
||||
List<MyConfigData> numbers = [];
|
||||
startSelectCircleActivity() async {
|
||||
var data = await Get.toNamed(AppRoutes.SelectCircleActivity,
|
||||
arguments: {
|
||||
"interestMap":
|
||||
configBean.interestMap,
|
||||
"isRodio": true
|
||||
});
|
||||
if(null!=data){
|
||||
numbers = data;
|
||||
circleName = numbers[0].name;
|
||||
|
||||
print(circleName);
|
||||
update();
|
||||
}
|
||||
}
|
||||
showImg() async {
|
||||
try {
|
||||
if(state.imaglist.length==9){
|
||||
showToast("最多上传9张图片哦~");
|
||||
return;
|
||||
}
|
||||
final XFile? pickedFile = await _picker.pickImage(source: ImageSource.gallery,);
|
||||
// setState(() {
|
||||
_setImageFileListFromFile(pickedFile!);
|
||||
// });
|
||||
} catch (e) {
|
||||
print(e);
|
||||
// setState(() {
|
||||
// _pickImageError = e;
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
void _setImageFileListFromFile(XFile pickedFile) {
|
||||
SmartDialog.showLoading();
|
||||
PutController putController = PutController();
|
||||
putController.addStatusListener((StorageStatus status) {
|
||||
if (status == StorageStatus.Success) {
|
||||
var headUrl = "http://qiniuyun.ikuayou.com/" + pickedFile.name;
|
||||
state.imaglist.add(headUrl);
|
||||
|
||||
update();
|
||||
SmartDialog.dismiss();
|
||||
}
|
||||
print('状态变化: 当前任务状态:$status');
|
||||
});
|
||||
storage.putFile(File(pickedFile.path), quToken,
|
||||
options: PutOptions(controller: putController, key: pickedFile.name));
|
||||
}
|
||||
showVideo() async {
|
||||
if(state.imaglist.length!=0){
|
||||
showToast("不可以和图片一起上传哦~");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
final XFile? pickedFile = await _picker.pickVideo(
|
||||
source: ImageSource.gallery,
|
||||
);
|
||||
// setState(() {
|
||||
_setImageFileListFromFile(pickedFile!);
|
||||
// });
|
||||
} catch (e) {
|
||||
// setState(() {
|
||||
// _pickImageError = e;
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -2,4 +2,12 @@ class Call_outState {
|
||||
Call_outState() {
|
||||
///Initialize variables
|
||||
}
|
||||
List<String> imaglist = ["https://book.flutterchina.club/assets/img/logo.png",
|
||||
"https://book.flutterchina.club/assets/img/logo.png",
|
||||
"https://book.flutterchina.club/assets/img/logo.png",
|
||||
"https://book.flutterchina.club/assets/img/logo.png",
|
||||
"https://book.flutterchina.club/assets/img/logo.png",
|
||||
"https://book.flutterchina.club/assets/img/logo.png",];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../router/app_routers.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class Call_outPage extends StatelessWidget {
|
||||
@ -14,163 +15,407 @@ class Call_outPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getBaseImage('home_back')))),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: '世界喊话',
|
||||
actionWdiget: Image.asset(
|
||||
getCircleImage('push'),
|
||||
width: 54.sp,
|
||||
return GetBuilder<Call_outLogic>(builder: (logic) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getBaseImage('home_back')))),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: '世界喊话',
|
||||
actionWdiget: Image.asset(
|
||||
getCircleImage('push'),
|
||||
width: 54.sp,
|
||||
),
|
||||
onPressed: () {
|
||||
showToast('111');
|
||||
},
|
||||
),
|
||||
body: SafeArea(
|
||||
child: GetBuilder(builder: (Call_outLogic controller) {
|
||||
return Container(
|
||||
child: Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () async {
|
||||
logic.startSelectCircleActivity();
|
||||
},
|
||||
child: Container(
|
||||
height: 45.sp,
|
||||
padding: EdgeInsets.only(left: 17.sp, right: 17.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'选择圈子:',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
logic.circleName == ''
|
||||
? Container()
|
||||
: Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 7.sp, right: 7.sp),
|
||||
height: 21.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(
|
||||
21 * 0.5.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [
|
||||
Color(0xff0AFCFF),
|
||||
Color(0xffD739EA)
|
||||
])),
|
||||
child: Text(
|
||||
logic.circleName != null
|
||||
? logic.circleName
|
||||
: '',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp),
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
getHomeImage('icon_in'),
|
||||
width: 24.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
getCircleImage('line'),
|
||||
width: Get.width,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 15.sp),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
height: 200.sp,
|
||||
child: TextField(
|
||||
controller: controller.textEditingController,
|
||||
onChanged: (value) {
|
||||
controller.update();
|
||||
},
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.0.sp),
|
||||
maxLines: 32,
|
||||
maxLength: 200,
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
color: Color.fromRGBO(255, 255, 255, 0.6),
|
||||
fontSize: 14.sp),
|
||||
hintText: '请输入...(左下角上传图片或视频哦)',
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.only(
|
||||
left: 17.sp, right: 17.sp),
|
||||
counter: Text('')),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 15.sp,
|
||||
top: 190.sp,
|
||||
child: Text(
|
||||
'${controller.textEditingController.text.length}/200',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
)),
|
||||
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 220.sp),
|
||||
child: _imageAdapter(controller))
|
||||
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
height: 60.sp,
|
||||
padding: EdgeInsets.only(
|
||||
left: 17.sp, right: 17.sp, bottom: 5.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
logic.showImg();
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('photo'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
logic.showVideo();
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('video'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
controller.isCheck = !controller.isCheck;
|
||||
controller.update();
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage(controller.isCheck
|
||||
? 'check'
|
||||
: 'uncheck'),
|
||||
width: 17.5.sp,
|
||||
),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'使用至尊喊话',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
child: Text(
|
||||
'内容规范',
|
||||
style: TextStyle(
|
||||
color: Color(0xff00FFF4),
|
||||
fontSize: 14.sp),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
)),
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
Widget _imageAdapter(Call_outLogic controller) {
|
||||
return GridView.builder(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, // 每行显示的项目数量
|
||||
),
|
||||
itemCount: controller.state.imaglist.length, // 项目的总数量,包括固定图片和接口获取的项目
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.all(5.sp),
|
||||
child: Center(
|
||||
child: _buildImageItem(
|
||||
controller.state.imaglist[index],
|
||||
controller,index)),
|
||||
);
|
||||
|
||||
},
|
||||
);
|
||||
}
|
||||
Widget _buildImageItem(String url, Call_outLogic controller,int index) {
|
||||
return Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(0.0),
|
||||
child: Container(
|
||||
width: double.infinity, // 设置容器宽度为屏幕宽度
|
||||
height: double.infinity, // 设置容器高度为屏幕高度
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(0.0),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist':controller.state.imaglist,
|
||||
'index':index
|
||||
});
|
||||
},
|
||||
child: Image.network(
|
||||
fit: BoxFit.cover,
|
||||
url,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
showToast('111');
|
||||
},
|
||||
),
|
||||
body: SafeArea(
|
||||
child: GetBuilder(builder: (Call_outLogic controller) {
|
||||
return Container(
|
||||
)
|
||||
,
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// showToast("删除");
|
||||
_showDelImgDialog(Get.context!,controller,index);
|
||||
|
||||
},
|
||||
child: Image(
|
||||
image: AssetImage(getMineImage("icon_img_del")),
|
||||
width: 20.sp,
|
||||
height: 20.sp,
|
||||
),
|
||||
))
|
||||
],
|
||||
);
|
||||
}
|
||||
void _showDelImgDialog(BuildContext context,Call_outLogic controller,int index) {
|
||||
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(
|
||||
height: 45.sp,
|
||||
padding: EdgeInsets.only(left: 17.sp, right: 17.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'选择圈子:',
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 7.sp, right: 7.sp),
|
||||
height: 21.sp,
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.only(
|
||||
top: 12.sp, left: 14.sp, right: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"是否确认删除该形象照。",
|
||||
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(21 * 0.5.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [
|
||||
Color(0xff0AFCFF),
|
||||
Color(0xffD739EA)
|
||||
])),
|
||||
child: Text(
|
||||
'立即解锁',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
getHomeImage('icon_in'),
|
||||
width: 24.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
getCircleImage('line'),
|
||||
width: Get.width,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Expanded(child: Container(
|
||||
padding: EdgeInsets.only(top: 15.sp),
|
||||
child: Stack(
|
||||
children: [
|
||||
TextField(
|
||||
controller: controller.textEditingController,
|
||||
onChanged: (value) {
|
||||
controller.update();
|
||||
},
|
||||
style: TextStyle(color: Colors.white,fontSize: 14.0.sp),
|
||||
maxLines: 32,
|
||||
maxLength: 200,
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(color: Color.fromRGBO(255, 255, 255, 0.6),fontSize: 14.sp),
|
||||
hintText: '请输入...(左下角上传图片或视频哦)',
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.only(left: 17.sp,right: 17.sp),
|
||||
counter: Text('')
|
||||
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 15.sp,
|
||||
bottom: 10.sp,
|
||||
child: Text('${controller.textEditingController.text.length}/200',style: TextStyle(color: Colors.white,fontSize: 12.sp),))
|
||||
],
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 17.sp,right: 17.sp),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
child: Image.asset(
|
||||
getCircleImage('photo'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
GestureDetector(
|
||||
child: Image.asset(
|
||||
getCircleImage('video'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
controller.isCheck = !controller.isCheck;
|
||||
controller.update();
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(getCircleImage(controller.isCheck ? 'check' : 'uncheck'),width: 17.5.sp,),
|
||||
SizedBox(
|
||||
width: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'使用至尊喊话',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 16.sp),
|
||||
)
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
child: Text(
|
||||
'内容规范',
|
||||
style: TextStyle(
|
||||
color: Color(0xff00FFF4), fontSize: 14.sp),
|
||||
),
|
||||
SizedBox(width: 24.sp),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
controller.state.imaglist.removeAt(index);
|
||||
controller.update();
|
||||
|
||||
},
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,19 +13,15 @@ class CirclePage extends StatelessWidget {
|
||||
|
||||
final logic = Get.put(CircleLogic());
|
||||
final state = Get.find<CircleLogic>().state;
|
||||
var getContext;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
getContext = context;
|
||||
return GetBuilder<CircleLogic>(builder: (logic) {
|
||||
return Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
height: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.height,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
@ -46,25 +42,25 @@ class CirclePage extends StatelessWidget {
|
||||
//组件使用
|
||||
Expanded(
|
||||
child: Swiper(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _getPageByIndex(index);
|
||||
},
|
||||
onIndexChanged: (index) {
|
||||
controller.state.index = index;
|
||||
if(index==logic.circle.lists.length-1){
|
||||
logic.loadMore();
|
||||
}
|
||||
print(index.toString());
|
||||
controller.update();
|
||||
},
|
||||
index: controller.state.index,
|
||||
itemCount: logic.circle.lists.length,
|
||||
viewportFraction: 0.95,
|
||||
// scale: 0.9,
|
||||
loop: false,
|
||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||
))
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _getPageByIndex(index);
|
||||
},
|
||||
onIndexChanged: (index) {
|
||||
controller.state.index = index;
|
||||
if (index == logic.circle.lists.length - 1) {
|
||||
logic.loadMore();
|
||||
}
|
||||
print(index.toString());
|
||||
controller.update();
|
||||
},
|
||||
index: controller.state.index,
|
||||
itemCount: logic.circle.lists.length,
|
||||
viewportFraction: 0.95,
|
||||
// scale: 0.9,
|
||||
loop: false,
|
||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||
))
|
||||
]),
|
||||
);
|
||||
}),
|
||||
@ -139,34 +135,48 @@ class CirclePage extends StatelessWidget {
|
||||
circleWidget(String url, {double width = 30}) {
|
||||
return GestureDetector(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: width.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
url,
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: width.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
url,
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
_getPageByIndex(int myIndex) {
|
||||
var bean =logic.circle.lists[myIndex];
|
||||
TextSpan span = TextSpan(
|
||||
text: '查看更多',
|
||||
style: TextStyle(color: Color(0xFFFF4DF6), fontSize: 14.sp),
|
||||
);
|
||||
TextSpan descSpan = TextSpan(
|
||||
text: bean.intro,
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
);
|
||||
var bean = logic.circle.lists[myIndex];
|
||||
TextSpan descSpan;
|
||||
TextSpan span;
|
||||
if (bean.intro.length > 60) {
|
||||
String truncatedText = bean.intro.substring(0, 60);
|
||||
descSpan = TextSpan(
|
||||
text: truncatedText,
|
||||
style: TextStyle(color: Colors.white, fontSize: 10.sp),
|
||||
);
|
||||
span = TextSpan(
|
||||
text: '查看更多',
|
||||
style: TextStyle(color: Color(0xFFFF4DF6), fontSize: 10.sp),
|
||||
);
|
||||
} else {
|
||||
descSpan = TextSpan(
|
||||
text: bean.intro,
|
||||
style: TextStyle(color: Colors.white, fontSize: 10.sp),
|
||||
);
|
||||
span = TextSpan(
|
||||
text: '',
|
||||
style: TextStyle(color: Color(0xFFFF4DF6), fontSize: 10.sp),
|
||||
);
|
||||
}
|
||||
|
||||
List<JoinUser> urlList = bean.lastJoinUsers;
|
||||
List<Widget> widgets = [];
|
||||
@ -211,18 +221,25 @@ class CirclePage extends StatelessWidget {
|
||||
image: AssetImage(
|
||||
getCircleImage('circle_desc')))),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 12.sp),
|
||||
margin: EdgeInsets.only(top: 14.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width,
|
||||
child: RichText(
|
||||
overflow: TextOverflow.fade,
|
||||
maxLines: 2,
|
||||
text: TextSpan(children: <InlineSpan>[
|
||||
descSpan,
|
||||
span
|
||||
])),
|
||||
height: 30.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
_showTextContentDialog(
|
||||
context, bean.intro);
|
||||
},
|
||||
child: RichText(
|
||||
overflow: TextOverflow.fade,
|
||||
maxLines: 2,
|
||||
text: TextSpan(children: <InlineSpan>[
|
||||
descSpan,
|
||||
span
|
||||
])),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
@ -242,7 +259,7 @@ class CirclePage extends StatelessWidget {
|
||||
width: 8.sp,
|
||||
),
|
||||
Text(
|
||||
bean.viewTotal.toString(),
|
||||
'${convertToTenThousand(bean.viewTotal)}圈友',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp),
|
||||
@ -281,7 +298,7 @@ class CirclePage extends StatelessWidget {
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image:
|
||||
AssetImage(getCircleImage('top_circle_bg')))),
|
||||
AssetImage(getCircleImage('top_circle_bg')))),
|
||||
child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -312,41 +329,41 @@ class CirclePage extends StatelessWidget {
|
||||
),
|
||||
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(
|
||||
'${bean.joinTotal.toStringAsFixed(0)}万人看过',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Color(0xff03FEFB),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
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.joinTotal)}人看过',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Color(0xff03FEFB),
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
logic.outCircle(bean.id.toString(),bean.isJoin);
|
||||
// Get.toNamed(AppRoutes.Login);
|
||||
// Get.bottomSheet(tipWdiget(),
|
||||
// Get.bottomSheet(Open_vip_tipPage(),
|
||||
// isScrollControlled: true, enableDrag: false);
|
||||
if (bean.isJoin) {
|
||||
_showOutCircleDialog(getContext, logic, bean);
|
||||
} else {
|
||||
logic.outCircle(
|
||||
bean.id.toString(), bean.isJoin);
|
||||
}
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('add'),
|
||||
@ -382,6 +399,7 @@ class CirclePage extends StatelessWidget {
|
||||
Text descText = Text(
|
||||
bean.intro,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
maxLines: 2,
|
||||
);
|
||||
|
||||
List<JoinUser> urlList = bean.lastJoinUsers;
|
||||
@ -437,80 +455,79 @@ class CirclePage extends StatelessWidget {
|
||||
children: [
|
||||
GestureDetector(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: 42.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp',
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: 42.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp',
|
||||
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(
|
||||
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'圈子名称',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
Image.asset(
|
||||
getCircleImage('vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
],
|
||||
Text(
|
||||
'圈子名称',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
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(
|
||||
'男.33.DOM.异性恋',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
width: 8.sp,
|
||||
),
|
||||
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(
|
||||
'男.33.DOM.异性恋',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -527,7 +544,7 @@ class CirclePage extends StatelessWidget {
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
),
|
||||
),
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
@ -572,10 +589,9 @@ class CirclePage extends StatelessWidget {
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'1位圈友已私聊',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12
|
||||
.sp),
|
||||
)),
|
||||
'1位圈友已私聊',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
)),
|
||||
Image.asset(
|
||||
getCircleImage('chat'),
|
||||
width: 60.sp,
|
||||
@ -596,6 +612,7 @@ class CirclePage extends StatelessWidget {
|
||||
Text descText = Text(
|
||||
bean.intro,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
maxLines: 2,
|
||||
);
|
||||
|
||||
List<String> urlList = [
|
||||
@ -649,80 +666,79 @@ class CirclePage extends StatelessWidget {
|
||||
children: [
|
||||
GestureDetector(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: 42.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp',
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('avatar_bg'),
|
||||
width: 42.sp,
|
||||
),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp',
|
||||
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(
|
||||
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'圈子名称',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8.sp,
|
||||
),
|
||||
Image.asset(
|
||||
getCircleImage('vip'),
|
||||
width: 36.sp,
|
||||
)
|
||||
],
|
||||
Text(
|
||||
'圈子名称',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
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: LinearGradient(
|
||||
begin: Alignment(0.25, 0.5),
|
||||
end: Alignment(0.75, 0.5),
|
||||
colors: [
|
||||
Color(0xff8DFFF8),
|
||||
Color(0xffB5D3FF)
|
||||
])),
|
||||
child: Text(
|
||||
'男.33.DOM.异性恋',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
width: 8.sp,
|
||||
),
|
||||
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: LinearGradient(
|
||||
begin: Alignment(0.25, 0.5),
|
||||
end: Alignment(0.75, 0.5),
|
||||
colors: [
|
||||
Color(0xff8DFFF8),
|
||||
Color(0xffB5D3FF)
|
||||
])),
|
||||
child: Text(
|
||||
'男.33.DOM.异性恋',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -739,7 +755,7 @@ class CirclePage extends StatelessWidget {
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
),
|
||||
),
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
@ -784,10 +800,9 @@ class CirclePage extends StatelessWidget {
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'1位圈友已私聊',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12
|
||||
.sp),
|
||||
)),
|
||||
'1位圈友已私聊',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
)),
|
||||
Image.asset(
|
||||
getCircleImage('chat'),
|
||||
width: 60.sp,
|
||||
@ -905,4 +920,202 @@ class CirclePage extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showTextContentDialog(BuildContext context, String msg) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 300.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: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 12.sp, left: 14.sp, right: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
msg,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _showOutCircleDialog(
|
||||
BuildContext context, CircleLogic controller, Circle 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(
|
||||
"是否确认退出该圈子。",
|
||||
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.outCircle(bean.id.toString(), bean.isJoin);
|
||||
},
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,9 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../circle/view.dart';
|
||||
import '../minefragment/view.dart';
|
||||
import '../msg/view.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class HomeLogic extends GetxController {
|
||||
@ -12,6 +15,19 @@ class HomeLogic extends GetxController {
|
||||
Widget currentPage = Container();
|
||||
|
||||
final HomeState state = HomeState();
|
||||
|
||||
final List tabs = [];
|
||||
var circlePage = CirclePage();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
tabs.add(MsgPage());
|
||||
tabs.add(circlePage);
|
||||
tabs.add(MinefragmentPage());
|
||||
}
|
||||
|
||||
|
||||
String getInfo () {
|
||||
return getBaseImage('image');
|
||||
|
||||
|
||||
@ -16,12 +16,6 @@ class HomePage extends StatelessWidget {
|
||||
final logic = Get.lazyPut(() => HomeLogic());
|
||||
final state = Get.find<HomeLogic>().state;
|
||||
|
||||
final List _tabs = [
|
||||
MsgPage(),
|
||||
CirclePage(),
|
||||
MinefragmentPage(),
|
||||
];
|
||||
|
||||
|
||||
|
||||
@override
|
||||
@ -31,7 +25,8 @@ class HomePage extends StatelessWidget {
|
||||
onTap: () {
|
||||
// Get.toNamed(AppRoutes.Complete_materialPage);
|
||||
},
|
||||
child: Scaffold(
|
||||
child: Stack(children: [
|
||||
Scaffold(
|
||||
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
|
||||
bottomNavigationBar: Container(
|
||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
@ -39,7 +34,7 @@ class HomePage extends StatelessWidget {
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(left: 50.sp, right: 50.sp, top: 8.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF423055),
|
||||
color: Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
@ -50,13 +45,25 @@ class HomePage extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
funcItem(0, 'msg', 0 == controller.currentIndex, controller),
|
||||
funcItem(
|
||||
1, 'circle', 1 == controller.currentIndex, controller),
|
||||
funcItem(1, 'circle', 1 == controller.currentIndex, controller),
|
||||
funcItem(2, 'mine', 2 == controller.currentIndex, controller),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: _tabs[controller.currentIndex]),
|
||||
body: controller.tabs[controller.currentIndex],
|
||||
),
|
||||
Positioned(
|
||||
bottom: 56.sp,
|
||||
right: 0.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.Call_out);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('send_msg'),
|
||||
width: 60.sp,
|
||||
)))
|
||||
],),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@ -154,7 +154,10 @@ class Complete_materialPage extends StatelessWidget {
|
||||
), () async {
|
||||
var data = await Get.toNamed(
|
||||
AppRoutes.SelectCircleActivity,
|
||||
arguments: controller.configBean.interestMap);
|
||||
arguments: {
|
||||
"interestMap" :controller.configBean.interestMap,
|
||||
"isRodio" :false
|
||||
});
|
||||
if (data != null) {
|
||||
controller.numbers = data;
|
||||
controller.update();
|
||||
|
||||
@ -380,7 +380,12 @@ class MinefragmentPage extends StatelessWidget {
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
imgList.add("https://book.flutterchina.club/assets/img/logo.png");
|
||||
Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist':imgList,
|
||||
'index':0
|
||||
});
|
||||
|
||||
},
|
||||
child: Image.network(
|
||||
'https://book.flutterchina.club/assets/img/logo.png',
|
||||
|
||||
@ -5,26 +5,25 @@ import '../../network/dio_manager.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class Select_circleLogic extends GetxController {
|
||||
late Map<String, dynamic> interestMap = Get.arguments['interestMap'];
|
||||
bool isRodio = Get.arguments['isRodio'];
|
||||
|
||||
|
||||
late Map<String, dynamic> interestMap = Get.arguments;
|
||||
@override
|
||||
void onInit() async {
|
||||
interestMap.forEach((key, value) {
|
||||
arrList.add(MyConfigData(key,value, false));
|
||||
});
|
||||
interestMap.forEach((key, value) {
|
||||
arrList.add(MyConfigData(key, value, false));
|
||||
});
|
||||
update();
|
||||
|
||||
}
|
||||
|
||||
final Select_circleState state = Select_circleState();
|
||||
List<MyConfigData> arrList = <MyConfigData>[
|
||||
];
|
||||
List<MyConfigData> arrList = <MyConfigData>[];
|
||||
|
||||
List<MyConfigData> getItemList() {
|
||||
return arrList;
|
||||
}
|
||||
}
|
||||
|
||||
class ConfigBean {
|
||||
late Map<String, dynamic> genderMap;
|
||||
late Map<String, dynamic> roleMap;
|
||||
@ -39,11 +38,11 @@ class ConfigBean {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MyConfigData {
|
||||
String id ;
|
||||
String id;
|
||||
|
||||
String name;
|
||||
bool isSelect;
|
||||
|
||||
MyConfigData(this.id,this.name, this.isSelect);
|
||||
MyConfigData(this.id, this.name, this.isSelect);
|
||||
}
|
||||
|
||||
@ -34,16 +34,15 @@ class Select_circlePage extends StatelessWidget {
|
||||
// showToast("提交");
|
||||
List<MyConfigData> numbers = [];
|
||||
controller.arrList.forEach((element) {
|
||||
if(element.isSelect){
|
||||
if (element.isSelect) {
|
||||
numbers.add(element);
|
||||
}
|
||||
});
|
||||
if(numbers.length>0){
|
||||
if (numbers.length > 0) {
|
||||
Navigator.pop(context, numbers);
|
||||
}else{
|
||||
} else {
|
||||
showToast("请选择兴趣圈子");
|
||||
}
|
||||
|
||||
},
|
||||
),
|
||||
body: Column(
|
||||
@ -61,6 +60,7 @@ class Select_circlePage extends StatelessWidget {
|
||||
);
|
||||
});
|
||||
}
|
||||
var selectIndex = -1;
|
||||
|
||||
Widget _reportAdapter(Select_circleLogic controller) {
|
||||
return GridView.builder(
|
||||
@ -75,9 +75,18 @@ class Select_circlePage extends StatelessWidget {
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
controller.arrList[index].isSelect =
|
||||
!controller.arrList[index].isSelect;
|
||||
controller.update();
|
||||
if (controller.isRodio) {
|
||||
if(selectIndex != -1){
|
||||
controller.arrList[selectIndex].isSelect = false;
|
||||
print(selectIndex);
|
||||
}
|
||||
selectIndex = index;
|
||||
controller.arrList[index].isSelect = true;
|
||||
controller.update();
|
||||
} else {
|
||||
controller.arrList[index].isSelect = !controller.arrList[index].isSelect;
|
||||
controller.update();
|
||||
}
|
||||
},
|
||||
child: _getItemSelect(controller.arrList[index]),
|
||||
);
|
||||
@ -88,7 +97,8 @@ class Select_circlePage extends StatelessWidget {
|
||||
Widget _getItemSelect(MyConfigData bean) {
|
||||
if (bean.isSelect) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(left: 8.sp, right: 8.sp, top: 6.sp, bottom: 6.sp),
|
||||
margin:
|
||||
EdgeInsets.only(left: 8.sp, right: 8.sp, top: 6.sp, bottom: 6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20.sp),
|
||||
gradient: LinearGradient(
|
||||
@ -112,7 +122,8 @@ class Select_circlePage extends StatelessWidget {
|
||||
);
|
||||
} else {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(left: 8.sp, right: 8.sp, top: 6.sp, bottom: 6.sp),
|
||||
margin:
|
||||
EdgeInsets.only(left: 8.sp, right: 8.sp, top: 6.sp, bottom: 6.sp),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20.0), // 设置圆角半径
|
||||
|
||||
@ -1,8 +1,21 @@
|
||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'state.dart';
|
||||
|
||||
class SwiperLogic extends GetxController {
|
||||
final SwiperState state = SwiperState();
|
||||
List<String> imgList = Get.arguments ;
|
||||
List<String> imgList = Get.arguments['imaglist'] ;
|
||||
int index = Get.arguments['index'] ;
|
||||
SwiperController swiperController = SwiperController();
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
}
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
// swiperController.move(index);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,8 +13,10 @@ class SwiperPage extends StatefulWidget {
|
||||
|
||||
class _SwiperPageState extends State<SwiperPage> {
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return GetBuilder<SwiperLogic>(builder: (logic) {
|
||||
return Scaffold(
|
||||
appBar: null,
|
||||
@ -26,6 +28,8 @@ class _SwiperPageState extends State<SwiperPage> {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
child: Swiper(
|
||||
controller: logic.swiperController,
|
||||
index:logic.index,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
|
||||
@ -485,7 +485,11 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
imgList.add("https://book.flutterchina.club/assets/img/logo.png");
|
||||
Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist':imgList,
|
||||
'index':0
|
||||
});
|
||||
},
|
||||
child: Image.network(
|
||||
'https://book.flutterchina.club/assets/img/logo.png',
|
||||
@ -503,7 +507,12 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
borderRadius: BorderRadius.circular(0.0),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.Swiper,arguments:controller.state.imaglist);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:controller.state.imaglist);
|
||||
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist':controller.state.imaglist,
|
||||
'index':index
|
||||
});
|
||||
},
|
||||
child: Image.network(
|
||||
url,
|
||||
|
||||
@ -109,7 +109,7 @@ class AppPages {
|
||||
),
|
||||
GetPage(
|
||||
name: AppRoutes.Call_out,
|
||||
page: () => Call_outPage(),
|
||||
page: () => FlutterSmartDialog(child:Call_outPage() ,) ,
|
||||
binding: Call_outBinding(),
|
||||
),
|
||||
GetPage(name: AppRoutes.Login, page: () => LoginPage()),
|
||||
|
||||
@ -86,4 +86,14 @@ String filterText(String text) {
|
||||
text = text.replaceAll(tag, '\n\n');
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String convertToTenThousand(int number) {
|
||||
if (number >= 10000) {
|
||||
double result = number / 10000;
|
||||
return '${result.toStringAsFixed(1)}万';
|
||||
} else {
|
||||
return number.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user