补代码

This commit is contained in:
YangYuhao 2023-06-27 17:20:59 +08:00
parent a74025c4c4
commit 10cb12fb66
16 changed files with 1070 additions and 419 deletions

View File

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

View File

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

View File

@ -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",];
} }

View File

@ -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,163 +15,407 @@ class Call_outPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GetBuilder<Call_outLogic>(builder: (logic) {
onTap: () { return GestureDetector(
FocusManager.instance.primaryFocus?.unfocus(); onTap: () {
}, FocusManager.instance.primaryFocus?.unfocus();
child: Container( },
width: MediaQuery.of(context).size.width, child: Container(
height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width,
decoration: BoxDecoration( height: MediaQuery.of(context).size.height,
image: DecorationImage( decoration: BoxDecoration(
fit: BoxFit.fill, image: DecorationImage(
image: AssetImage(getBaseImage('home_back')))), fit: BoxFit.fill,
child: Scaffold( image: AssetImage(getBaseImage('home_back')))),
backgroundColor: Colors.transparent, child: Scaffold(
appBar: MyAppBar( backgroundColor: Colors.transparent,
centerTitle: '世界喊话', appBar: MyAppBar(
actionWdiget: Image.asset( centerTitle: '世界喊话',
getCircleImage('push'), actionWdiget: Image.asset(
width: 54.sp, 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( child: Column(
children: [ children: [
Center(
child: Text(
"提示",
style:
TextStyle(color: Colors.white, fontSize: 16.sp),
),
),
Container( Container(
height: 45.sp, margin: EdgeInsets.only(
padding: EdgeInsets.only(left: 17.sp, right: 17.sp), top: 12.sp, left: 14.sp, right: 14.sp),
child: Row( alignment: Alignment.center,
children: [ child: Text(
Text( "是否确认删除该形象照。",
'选择圈子:', textAlign: TextAlign.center,
style: style: TextStyle(
TextStyle(color: Colors.white, fontSize: 16.sp), color: Color(0xCCF7FAFA), fontSize: 16.sp),
), ),
Expanded(child: Container()), ),
Container( Row(
padding: EdgeInsets.only(left: 7.sp, right: 7.sp), mainAxisAlignment: MainAxisAlignment.center,
height: 21.sp, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
alignment: Alignment.center, children: [
GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Container(
margin: EdgeInsets.only(top: 30.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.circular(17),
BorderRadius.circular(21 * 0.5.sp), gradient: LinearGradient(
gradient: const LinearGradient( colors: [
begin: Alignment.centerLeft, Color(0x26FFFFFF),
end: Alignment.centerRight, Color(0x26FFFFFF),
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),
)
], ],
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( SizedBox(width: 24.sp),
'内容规范', GestureDetector(
style: TextStyle( onTap: () {
color: Color(0xff00FFF4), fontSize: 14.sp), 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,
),
),
),
)
],
) )
], ],
), ),
); )
}), ],
), ),
)), ),
);
},
); );
;
} }
} }

View File

@ -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(
@ -46,25 +42,25 @@ class CirclePage extends StatelessWidget {
//使 //使
Expanded( Expanded(
child: Swiper( child: Swiper(
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return _getPageByIndex(index); return _getPageByIndex(index);
}, },
onIndexChanged: (index) { onIndexChanged: (index) {
controller.state.index = index; controller.state.index = index;
if(index==logic.circle.lists.length-1){ if (index == logic.circle.lists.length - 1) {
logic.loadMore(); logic.loadMore();
} }
print(index.toString()); print(index.toString());
controller.update(); controller.update();
}, },
index: controller.state.index, index: controller.state.index,
itemCount: logic.circle.lists.length, itemCount: logic.circle.lists.length,
viewportFraction: 0.95, viewportFraction: 0.95,
// scale: 0.9, // scale: 0.9,
loop: false, loop: false,
// pagination: new SwiperPagination(),// // pagination: new SwiperPagination(),//
// control: new SwiperControl(),// // control: new SwiperControl(),//
)) ))
]), ]),
); );
}), }),
@ -139,34 +135,48 @@ class CirclePage extends StatelessWidget {
circleWidget(String url, {double width = 30}) { circleWidget(String url, {double width = 30}) {
return GestureDetector( return GestureDetector(
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
Image.asset( Image.asset(
getCircleImage('avatar_bg'), getCircleImage('avatar_bg'),
width: width.sp, width: width.sp,
), ),
ClipOval( ClipOval(
child: Image.network( child: Image.network(
url, url,
width: (width - 1).sp, width: (width - 1).sp,
height: (width - 1).sp, height: (width - 1).sp,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
) )
], ],
)); ));
} }
_getPageByIndex(int myIndex) { _getPageByIndex(int myIndex) {
var bean =logic.circle.lists[myIndex]; var bean = logic.circle.lists[myIndex];
TextSpan span = TextSpan( TextSpan descSpan;
text: '查看更多', TextSpan span;
style: TextStyle(color: Color(0xFFFF4DF6), fontSize: 14.sp), if (bean.intro.length > 60) {
); String truncatedText = bean.intro.substring(0, 60);
TextSpan descSpan = TextSpan( descSpan = TextSpan(
text: bean.intro, text: truncatedText,
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),
);
} 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<JoinUser> urlList = bean.lastJoinUsers;
List<Widget> widgets = []; List<Widget> widgets = [];
@ -211,18 +221,25 @@ 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,
child: RichText( height: 30.sp,
overflow: TextOverflow.fade, child: GestureDetector(
maxLines: 2, onTap: () {
text: TextSpan(children: <InlineSpan>[ _showTextContentDialog(
descSpan, context, bean.intro);
span },
])), child: RichText(
overflow: TextOverflow.fade,
maxLines: 2,
text: TextSpan(children: <InlineSpan>[
descSpan,
span
])),
),
), ),
Container( Container(
child: Row( child: Row(
@ -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),
@ -281,7 +298,7 @@ class CirclePage extends StatelessWidget {
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
image: image:
AssetImage(getCircleImage('top_circle_bg')))), AssetImage(getCircleImage('top_circle_bg')))),
child: Row( child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -312,41 +329,41 @@ 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( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
Text( bean.title,
bean.title, style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 18.sp,
fontSize: 18.sp, fontWeight: FontWeight.w600),
fontWeight: FontWeight.w600),
),
SizedBox(
height: 4.sp,
),
Text(
'${bean.joinTotal.toStringAsFixed(0)}万人看过',
textAlign: TextAlign.left,
style: TextStyle(
color: Color(0xff03FEFB),
fontSize: 12.sp,
),
),
],
), ),
)), SizedBox(
height: 4.sp,
),
Text(
'${convertToTenThousand(bean.joinTotal)}人看过',
textAlign: TextAlign.left,
style: TextStyle(
color: Color(0xff03FEFB),
fontSize: 12.sp,
),
),
],
),
)),
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;
@ -437,80 +455,79 @@ class CirclePage extends StatelessWidget {
children: [ children: [
GestureDetector( GestureDetector(
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
Image.asset( Image.asset(
getCircleImage('avatar_bg'), getCircleImage('avatar_bg'),
width: 42.sp, width: 42.sp,
), ),
ClipOval( ClipOval(
child: Image.network( child: Image.network(
'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp', 'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp',
width: 40.sp, width: 40.sp,
height: 40.sp, height: 40.sp,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
) )
], ],
)), )),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.only(left: 8.sp, top: 12.sp), padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 72.sp, height: 72.sp,
child: Column( child: Column(
children: [
Row(
children: [ children: [
Row( Text(
children: [ '圈子名称',
Text( style: TextStyle(
'圈子名称', color: Colors.white,
style: TextStyle( fontSize: 18.sp,
color: Colors.white, fontWeight: FontWeight.w600),
fontSize: 18.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
width: 8.sp,
),
Image.asset(
getCircleImage('vip'),
width: 36.sp,
)
],
), ),
SizedBox( SizedBox(
height: 4.sp, width: 8.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,
),
),
)
],
), ),
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 crossAxisCount: 3, //widget
crossAxisSpacing: 8.sp, crossAxisSpacing: 8.sp,
childAspectRatio: 1.0 //1widget childAspectRatio: 1.0 //1widget
), ),
children: <Widget>[ children: <Widget>[
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(6.sp), borderRadius: BorderRadius.circular(6.sp),
@ -572,10 +589,9 @@ 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'),
width: 60.sp, width: 60.sp,
@ -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 = [
@ -649,80 +666,79 @@ class CirclePage extends StatelessWidget {
children: [ children: [
GestureDetector( GestureDetector(
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
Image.asset( Image.asset(
getCircleImage('avatar_bg'), getCircleImage('avatar_bg'),
width: 42.sp, width: 42.sp,
), ),
ClipOval( ClipOval(
child: Image.network( child: Image.network(
'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp', 'https://p3-passport.byteimg.com/img/user-avatar/eb429d4dbb3c246f580a6f7894f2b246~100x100.awebp',
width: 40.sp, width: 40.sp,
height: 40.sp, height: 40.sp,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
) )
], ],
)), )),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.only(left: 8.sp, top: 12.sp), padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 72.sp, height: 72.sp,
child: Column( child: Column(
children: [
Row(
children: [ children: [
Row( Text(
children: [ '圈子名称',
Text( style: TextStyle(
'圈子名称', color: Colors.white,
style: TextStyle( fontSize: 18.sp,
color: Colors.white, fontWeight: FontWeight.w600),
fontSize: 18.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
width: 8.sp,
),
Image.asset(
getCircleImage('vip'),
width: 36.sp,
)
],
), ),
SizedBox( SizedBox(
height: 4.sp, width: 8.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,
),
),
)
],
), ),
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 crossAxisCount: 3, //widget
crossAxisSpacing: 8.sp, crossAxisSpacing: 8.sp,
childAspectRatio: 1.0 //1widget childAspectRatio: 1.0 //1widget
), ),
children: <Widget>[ children: <Widget>[
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(6.sp), borderRadius: BorderRadius.circular(6.sp),
@ -784,10 +800,9 @@ 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'),
width: 60.sp, 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,
),
),
),
)
],
)
],
),
)
],
),
),
);
},
);
}
} }

View File

@ -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');

View File

@ -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,
@ -39,7 +34,7 @@ class HomePage extends StatelessWidget {
// color: Colors.red, // color: Colors.red,
padding: EdgeInsets.only(left: 50.sp, right: 50.sp, top: 8.sp), padding: EdgeInsets.only(left: 50.sp, right: 50.sp, top: 8.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF423055), color: Color(0xFF423055),
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
image: AssetImage( image: AssetImage(
@ -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,
)))
],),
); );
}); });
} }

View File

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

View File

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

View File

@ -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,11 +38,11 @@ class ConfigBean {
} }
} }
class MyConfigData { class MyConfigData {
String id ; String id;
String name; String name;
bool isSelect; bool isSelect;
MyConfigData(this.id,this.name, this.isSelect); MyConfigData(this.id, this.name, this.isSelect);
} }

View File

@ -34,16 +34,15 @@ class Select_circlePage extends StatelessWidget {
// showToast("提交"); // showToast("提交");
List<MyConfigData> numbers = []; List<MyConfigData> numbers = [];
controller.arrList.forEach((element) { controller.arrList.forEach((element) {
if(element.isSelect){ if (element.isSelect) {
numbers.add(element); numbers.add(element);
} }
}); });
if(numbers.length>0){ if (numbers.length > 0) {
Navigator.pop(context, numbers); Navigator.pop(context, numbers);
}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.update(); 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]), 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), //

View File

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

View File

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

View File

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

View File

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

View File

@ -86,4 +86,14 @@ String filterText(String text) {
text = text.replaceAll(tag, '\n\n'); text = text.replaceAll(tag, '\n\n');
} }
return text; return text;
} }
String convertToTenThousand(int number) {
if (number >= 10000) {
double result = number / 10000;
return '${result.toStringAsFixed(1)}';
} else {
return number.toString();
}
}