补代码
This commit is contained in:
parent
a74025c4c4
commit
10cb12fb66
@ -293,6 +293,6 @@ class AccountPage extends StatelessWidget {
|
|||||||
Future<void> getAuthorization() async{
|
Future<void> getAuthorization() async{
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
prefs.remove("Authorization");
|
prefs.remove("Authorization");
|
||||||
Get.toNamed(AppRoutes.Login);
|
Get.offAllNamed(AppRoutes.Login);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,118 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'dart:io';
|
||||||
import 'package:get/get.dart';
|
|
||||||
|
|
||||||
|
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';
|
import 'state.dart';
|
||||||
|
|
||||||
class Call_outLogic extends GetxController {
|
class Call_outLogic extends GetxController {
|
||||||
final Call_outState state = Call_outState();
|
final Call_outState state = Call_outState();
|
||||||
TextEditingController textEditingController = TextEditingController();
|
TextEditingController textEditingController = TextEditingController();
|
||||||
bool isCheck = false;
|
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() {
|
Call_outState() {
|
||||||
///Initialize variables
|
///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:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../router/app_routers.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class Call_outPage extends StatelessWidget {
|
class Call_outPage extends StatelessWidget {
|
||||||
@ -14,6 +15,7 @@ class Call_outPage extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<Call_outLogic>(builder: (logic) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
FocusManager.instance.primaryFocus?.unfocus();
|
||||||
@ -42,24 +44,32 @@ class Call_outPage extends StatelessWidget {
|
|||||||
return Container(
|
return Container(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap: () async {
|
||||||
|
logic.startSelectCircleActivity();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
height: 45.sp,
|
height: 45.sp,
|
||||||
padding: EdgeInsets.only(left: 17.sp, right: 17.sp),
|
padding: EdgeInsets.only(left: 17.sp, right: 17.sp),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'选择圈子:',
|
'选择圈子:',
|
||||||
style:
|
style: TextStyle(
|
||||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
color: Colors.white, fontSize: 16.sp),
|
||||||
),
|
),
|
||||||
Expanded(child: Container()),
|
Expanded(child: Container()),
|
||||||
Container(
|
logic.circleName == ''
|
||||||
padding: EdgeInsets.only(left: 7.sp, right: 7.sp),
|
? Container()
|
||||||
|
: Container(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 7.sp, right: 7.sp),
|
||||||
height: 21.sp,
|
height: 21.sp,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(
|
||||||
BorderRadius.circular(21 * 0.5.sp),
|
21 * 0.5.sp),
|
||||||
gradient: const LinearGradient(
|
gradient: const LinearGradient(
|
||||||
begin: Alignment.centerLeft,
|
begin: Alignment.centerLeft,
|
||||||
end: Alignment.centerRight,
|
end: Alignment.centerRight,
|
||||||
@ -68,9 +78,12 @@ class Call_outPage extends StatelessWidget {
|
|||||||
Color(0xffD739EA)
|
Color(0xffD739EA)
|
||||||
])),
|
])),
|
||||||
child: Text(
|
child: Text(
|
||||||
'立即解锁',
|
logic.circleName != null
|
||||||
|
? logic.circleName
|
||||||
|
: '',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 12.sp),
|
color: Colors.white,
|
||||||
|
fontSize: 12.sp),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
@ -80,44 +93,65 @@ class Call_outPage extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
getCircleImage('line'),
|
getCircleImage('line'),
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
Expanded(child: Container(
|
Expanded(
|
||||||
|
child: Container(
|
||||||
padding: EdgeInsets.only(top: 15.sp),
|
padding: EdgeInsets.only(top: 15.sp),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
TextField(
|
Container(
|
||||||
|
height: 200.sp,
|
||||||
|
child: TextField(
|
||||||
controller: controller.textEditingController,
|
controller: controller.textEditingController,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
controller.update();
|
controller.update();
|
||||||
},
|
},
|
||||||
style: TextStyle(color: Colors.white,fontSize: 14.0.sp),
|
style: TextStyle(
|
||||||
|
color: Colors.white, fontSize: 14.0.sp),
|
||||||
maxLines: 32,
|
maxLines: 32,
|
||||||
maxLength: 200,
|
maxLength: 200,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintStyle: TextStyle(color: Color.fromRGBO(255, 255, 255, 0.6),fontSize: 14.sp),
|
hintStyle: TextStyle(
|
||||||
|
color: Color.fromRGBO(255, 255, 255, 0.6),
|
||||||
|
fontSize: 14.sp),
|
||||||
hintText: '请输入...(左下角上传图片或视频哦)',
|
hintText: '请输入...(左下角上传图片或视频哦)',
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
contentPadding: EdgeInsets.only(left: 17.sp,right: 17.sp),
|
contentPadding: EdgeInsets.only(
|
||||||
counter: Text('')
|
left: 17.sp, right: 17.sp),
|
||||||
|
counter: Text('')),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
right: 15.sp,
|
right: 15.sp,
|
||||||
bottom: 10.sp,
|
top: 190.sp,
|
||||||
child: Text('${controller.textEditingController.text.length}/200',style: TextStyle(color: Colors.white,fontSize: 12.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(
|
Container(
|
||||||
padding: EdgeInsets.only(left: 17.sp,right: 17.sp),
|
height: 60.sp,
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 17.sp, right: 17.sp, bottom: 5.sp),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
logic.showImg();
|
||||||
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
getCircleImage('photo'),
|
getCircleImage('photo'),
|
||||||
width: 30.sp,
|
width: 30.sp,
|
||||||
@ -127,6 +161,9 @@ class Call_outPage extends StatelessWidget {
|
|||||||
width: 16,
|
width: 16,
|
||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
logic.showVideo();
|
||||||
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
getCircleImage('video'),
|
getCircleImage('video'),
|
||||||
width: 30.sp,
|
width: 30.sp,
|
||||||
@ -141,14 +178,20 @@ class Call_outPage extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(getCircleImage(controller.isCheck ? 'check' : 'uncheck'),width: 17.5.sp,),
|
Image.asset(
|
||||||
|
getCircleImage(controller.isCheck
|
||||||
|
? 'check'
|
||||||
|
: 'uncheck'),
|
||||||
|
width: 17.5.sp,
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 4.sp,
|
width: 4.sp,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'使用至尊喊话',
|
'使用至尊喊话',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white, fontSize: 16.sp),
|
color: Colors.white,
|
||||||
|
fontSize: 16.sp),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -158,7 +201,8 @@ class Call_outPage extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'内容规范',
|
'内容规范',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff00FFF4), fontSize: 14.sp),
|
color: Color(0xff00FFF4),
|
||||||
|
fontSize: 14.sp),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -171,6 +215,207 @@ class Call_outPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
;
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
,
|
||||||
|
),
|
||||||
|
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(
|
||||||
|
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);
|
||||||
|
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 logic = Get.put(CircleLogic());
|
||||||
final state = Get.find<CircleLogic>().state;
|
final state = Get.find<CircleLogic>().state;
|
||||||
|
var getContext;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
getContext = context;
|
||||||
return GetBuilder<CircleLogic>(builder: (logic) {
|
return GetBuilder<CircleLogic>(builder: (logic) {
|
||||||
return Container(
|
return Container(
|
||||||
width: MediaQuery
|
width: MediaQuery.of(context).size.width,
|
||||||
.of(context)
|
height: MediaQuery.of(context).size.height,
|
||||||
.size
|
|
||||||
.width,
|
|
||||||
height: MediaQuery
|
|
||||||
.of(context)
|
|
||||||
.size
|
|
||||||
.height,
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(0xFF423055),
|
color: Color(0xFF423055),
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
@ -159,14 +155,28 @@ class CirclePage extends StatelessWidget {
|
|||||||
|
|
||||||
_getPageByIndex(int myIndex) {
|
_getPageByIndex(int myIndex) {
|
||||||
var bean = logic.circle.lists[myIndex];
|
var bean = logic.circle.lists[myIndex];
|
||||||
TextSpan span = TextSpan(
|
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: '查看更多',
|
text: '查看更多',
|
||||||
style: TextStyle(color: Color(0xFFFF4DF6), fontSize: 14.sp),
|
style: TextStyle(color: Color(0xFFFF4DF6), fontSize: 10.sp),
|
||||||
);
|
);
|
||||||
TextSpan descSpan = TextSpan(
|
} else {
|
||||||
|
descSpan = TextSpan(
|
||||||
text: bean.intro,
|
text: bean.intro,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
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<JoinUser> urlList = bean.lastJoinUsers;
|
||||||
List<Widget> widgets = [];
|
List<Widget> widgets = [];
|
||||||
@ -211,11 +221,17 @@ class CirclePage extends StatelessWidget {
|
|||||||
image: AssetImage(
|
image: AssetImage(
|
||||||
getCircleImage('circle_desc')))),
|
getCircleImage('circle_desc')))),
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(top: 12.sp),
|
margin: EdgeInsets.only(top: 14.sp),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
|
height: 30.sp,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
_showTextContentDialog(
|
||||||
|
context, bean.intro);
|
||||||
|
},
|
||||||
child: RichText(
|
child: RichText(
|
||||||
overflow: TextOverflow.fade,
|
overflow: TextOverflow.fade,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
@ -224,6 +240,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
span
|
span
|
||||||
])),
|
])),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@ -242,7 +259,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
width: 8.sp,
|
width: 8.sp,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
bean.viewTotal.toString(),
|
'${convertToTenThousand(bean.viewTotal)}圈友',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12.sp),
|
fontSize: 12.sp),
|
||||||
@ -312,8 +329,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||||
left: 8.sp, top: 12.sp),
|
|
||||||
// alignment: Alignment.,
|
// alignment: Alignment.,
|
||||||
height: 72.sp,
|
height: 72.sp,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -330,7 +346,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
height: 4.sp,
|
height: 4.sp,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${bean.joinTotal.toStringAsFixed(0)}万人看过',
|
'${convertToTenThousand(bean.joinTotal)}人看过',
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xff03FEFB),
|
color: Color(0xff03FEFB),
|
||||||
@ -342,11 +358,12 @@ class CirclePage extends StatelessWidget {
|
|||||||
)),
|
)),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
logic.outCircle(bean.id.toString(),bean.isJoin);
|
if (bean.isJoin) {
|
||||||
// Get.toNamed(AppRoutes.Login);
|
_showOutCircleDialog(getContext, logic, bean);
|
||||||
// Get.bottomSheet(tipWdiget(),
|
} else {
|
||||||
// Get.bottomSheet(Open_vip_tipPage(),
|
logic.outCircle(
|
||||||
// isScrollControlled: true, enableDrag: false);
|
bean.id.toString(), bean.isJoin);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
getCircleImage('add'),
|
getCircleImage('add'),
|
||||||
@ -382,6 +399,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
Text descText = Text(
|
Text descText = Text(
|
||||||
bean.intro,
|
bean.intro,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||||
|
maxLines: 2,
|
||||||
);
|
);
|
||||||
|
|
||||||
List<JoinUser> urlList = bean.lastJoinUsers;
|
List<JoinUser> urlList = bean.lastJoinUsers;
|
||||||
@ -489,8 +507,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(left: 6.sp, right: 6.sp),
|
EdgeInsets.only(left: 6.sp, right: 6.sp),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(9.sp),
|
||||||
9.sp),
|
|
||||||
gradient: const LinearGradient(
|
gradient: const LinearGradient(
|
||||||
begin: Alignment(0.25, 0.5),
|
begin: Alignment(0.25, 0.5),
|
||||||
end: Alignment(0.75, 0.5),
|
end: Alignment(0.75, 0.5),
|
||||||
@ -573,8 +590,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'1位圈友已私聊',
|
'1位圈友已私聊',
|
||||||
style: TextStyle(color: Colors.white, fontSize: 12
|
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||||
.sp),
|
|
||||||
)),
|
)),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
getCircleImage('chat'),
|
getCircleImage('chat'),
|
||||||
@ -596,6 +612,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
Text descText = Text(
|
Text descText = Text(
|
||||||
bean.intro,
|
bean.intro,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||||
|
maxLines: 2,
|
||||||
);
|
);
|
||||||
|
|
||||||
List<String> urlList = [
|
List<String> urlList = [
|
||||||
@ -701,8 +718,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(left: 6.sp, right: 6.sp),
|
EdgeInsets.only(left: 6.sp, right: 6.sp),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(9.sp),
|
||||||
9.sp),
|
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin: Alignment(0.25, 0.5),
|
begin: Alignment(0.25, 0.5),
|
||||||
end: Alignment(0.75, 0.5),
|
end: Alignment(0.75, 0.5),
|
||||||
@ -785,8 +801,7 @@ class CirclePage extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'1位圈友已私聊',
|
'1位圈友已私聊',
|
||||||
style: TextStyle(color: Colors.white, fontSize: 12
|
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||||
.sp),
|
|
||||||
)),
|
)),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
getCircleImage('chat'),
|
getCircleImage('chat'),
|
||||||
@ -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:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../circle/view.dart';
|
||||||
|
import '../minefragment/view.dart';
|
||||||
|
import '../msg/view.dart';
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
class HomeLogic extends GetxController {
|
class HomeLogic extends GetxController {
|
||||||
@ -12,6 +15,19 @@ class HomeLogic extends GetxController {
|
|||||||
Widget currentPage = Container();
|
Widget currentPage = Container();
|
||||||
|
|
||||||
final HomeState state = HomeState();
|
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 () {
|
String getInfo () {
|
||||||
return getBaseImage('image');
|
return getBaseImage('image');
|
||||||
|
|
||||||
|
|||||||
@ -16,12 +16,6 @@ class HomePage extends StatelessWidget {
|
|||||||
final logic = Get.lazyPut(() => HomeLogic());
|
final logic = Get.lazyPut(() => HomeLogic());
|
||||||
final state = Get.find<HomeLogic>().state;
|
final state = Get.find<HomeLogic>().state;
|
||||||
|
|
||||||
final List _tabs = [
|
|
||||||
MsgPage(),
|
|
||||||
CirclePage(),
|
|
||||||
MinefragmentPage(),
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -31,7 +25,8 @@ class HomePage extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
// Get.toNamed(AppRoutes.Complete_materialPage);
|
// Get.toNamed(AppRoutes.Complete_materialPage);
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Stack(children: [
|
||||||
|
Scaffold(
|
||||||
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
|
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
|
||||||
bottomNavigationBar: Container(
|
bottomNavigationBar: Container(
|
||||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||||
@ -50,13 +45,25 @@ class HomePage extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
funcItem(0, 'msg', 0 == controller.currentIndex, controller),
|
funcItem(0, 'msg', 0 == controller.currentIndex, controller),
|
||||||
funcItem(
|
funcItem(1, 'circle', 1 == controller.currentIndex, controller),
|
||||||
1, 'circle', 1 == controller.currentIndex, controller),
|
|
||||||
funcItem(2, 'mine', 2 == 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 {
|
), () async {
|
||||||
var data = await Get.toNamed(
|
var data = await Get.toNamed(
|
||||||
AppRoutes.SelectCircleActivity,
|
AppRoutes.SelectCircleActivity,
|
||||||
arguments: controller.configBean.interestMap);
|
arguments: {
|
||||||
|
"interestMap" :controller.configBean.interestMap,
|
||||||
|
"isRodio" :false
|
||||||
|
});
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
controller.numbers = data;
|
controller.numbers = data;
|
||||||
controller.update();
|
controller.update();
|
||||||
|
|||||||
@ -380,7 +380,12 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
var imgList = <String>[];
|
var imgList = <String>[];
|
||||||
imgList.add("https://book.flutterchina.club/assets/img/logo.png");
|
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(
|
child: Image.network(
|
||||||
'https://book.flutterchina.club/assets/img/logo.png',
|
'https://book.flutterchina.club/assets/img/logo.png',
|
||||||
|
|||||||
@ -5,26 +5,25 @@ import '../../network/dio_manager.dart';
|
|||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
class Select_circleLogic extends GetxController {
|
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
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
interestMap.forEach((key, value) {
|
interestMap.forEach((key, value) {
|
||||||
arrList.add(MyConfigData(key, value, false));
|
arrList.add(MyConfigData(key, value, false));
|
||||||
});
|
});
|
||||||
update();
|
update();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final Select_circleState state = Select_circleState();
|
final Select_circleState state = Select_circleState();
|
||||||
List<MyConfigData> arrList = <MyConfigData>[
|
List<MyConfigData> arrList = <MyConfigData>[];
|
||||||
];
|
|
||||||
|
|
||||||
List<MyConfigData> getItemList() {
|
List<MyConfigData> getItemList() {
|
||||||
return arrList;
|
return arrList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ConfigBean {
|
class ConfigBean {
|
||||||
late Map<String, dynamic> genderMap;
|
late Map<String, dynamic> genderMap;
|
||||||
late Map<String, dynamic> roleMap;
|
late Map<String, dynamic> roleMap;
|
||||||
@ -39,9 +38,9 @@ class ConfigBean {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class MyConfigData {
|
class MyConfigData {
|
||||||
String id;
|
String id;
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
bool isSelect;
|
bool isSelect;
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,6 @@ class Select_circlePage extends StatelessWidget {
|
|||||||
} else {
|
} else {
|
||||||
showToast("请选择兴趣圈子");
|
showToast("请选择兴趣圈子");
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
@ -61,6 +60,7 @@ class Select_circlePage extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
var selectIndex = -1;
|
||||||
|
|
||||||
Widget _reportAdapter(Select_circleLogic controller) {
|
Widget _reportAdapter(Select_circleLogic controller) {
|
||||||
return GridView.builder(
|
return GridView.builder(
|
||||||
@ -75,9 +75,18 @@ class Select_circlePage extends StatelessWidget {
|
|||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.arrList[index].isSelect =
|
if (controller.isRodio) {
|
||||||
!controller.arrList[index].isSelect;
|
if(selectIndex != -1){
|
||||||
|
controller.arrList[selectIndex].isSelect = false;
|
||||||
|
print(selectIndex);
|
||||||
|
}
|
||||||
|
selectIndex = index;
|
||||||
|
controller.arrList[index].isSelect = true;
|
||||||
controller.update();
|
controller.update();
|
||||||
|
} else {
|
||||||
|
controller.arrList[index].isSelect = !controller.arrList[index].isSelect;
|
||||||
|
controller.update();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: _getItemSelect(controller.arrList[index]),
|
child: _getItemSelect(controller.arrList[index]),
|
||||||
);
|
);
|
||||||
@ -88,7 +97,8 @@ class Select_circlePage extends StatelessWidget {
|
|||||||
Widget _getItemSelect(MyConfigData bean) {
|
Widget _getItemSelect(MyConfigData bean) {
|
||||||
if (bean.isSelect) {
|
if (bean.isSelect) {
|
||||||
return Container(
|
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(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(20.sp),
|
borderRadius: BorderRadius.circular(20.sp),
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
@ -112,7 +122,8 @@ class Select_circlePage extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Container(
|
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(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(20.0), // 设置圆角半径
|
borderRadius: BorderRadius.circular(20.0), // 设置圆角半径
|
||||||
|
|||||||
@ -1,8 +1,21 @@
|
|||||||
|
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
class SwiperLogic extends GetxController {
|
class SwiperLogic extends GetxController {
|
||||||
final SwiperState state = SwiperState();
|
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> {
|
class _SwiperPageState extends State<SwiperPage> {
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
return GetBuilder<SwiperLogic>(builder: (logic) {
|
return GetBuilder<SwiperLogic>(builder: (logic) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: null,
|
appBar: null,
|
||||||
@ -26,6 +28,8 @@ class _SwiperPageState extends State<SwiperPage> {
|
|||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
}),
|
}),
|
||||||
child: Swiper(
|
child: Swiper(
|
||||||
|
controller: logic.swiperController,
|
||||||
|
index:logic.index,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
|||||||
@ -485,7 +485,11 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
var imgList = <String>[];
|
var imgList = <String>[];
|
||||||
imgList.add("https://book.flutterchina.club/assets/img/logo.png");
|
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(
|
child: Image.network(
|
||||||
'https://book.flutterchina.club/assets/img/logo.png',
|
'https://book.flutterchina.club/assets/img/logo.png',
|
||||||
@ -503,7 +507,12 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
borderRadius: BorderRadius.circular(0.0),
|
borderRadius: BorderRadius.circular(0.0),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
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(
|
child: Image.network(
|
||||||
url,
|
url,
|
||||||
|
|||||||
@ -109,7 +109,7 @@ class AppPages {
|
|||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: AppRoutes.Call_out,
|
name: AppRoutes.Call_out,
|
||||||
page: () => Call_outPage(),
|
page: () => FlutterSmartDialog(child:Call_outPage() ,) ,
|
||||||
binding: Call_outBinding(),
|
binding: Call_outBinding(),
|
||||||
),
|
),
|
||||||
GetPage(name: AppRoutes.Login, page: () => LoginPage()),
|
GetPage(name: AppRoutes.Login, page: () => LoginPage()),
|
||||||
|
|||||||
@ -87,3 +87,13 @@ String filterText(String text) {
|
|||||||
}
|
}
|
||||||
return text;
|
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