增加占位图展示

This commit is contained in:
CYH 2023-07-04 16:18:44 +08:00
parent 5cf1946996
commit 18b1468db4
13 changed files with 323 additions and 293 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -1,5 +1,5 @@
import 'package:dio/dio.dart';
// import 'package:flutter_install_app/flutter_install_app.dart';
import 'package:flutter_install_app/flutter_install_app.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
@ -42,7 +42,7 @@ class AboutappLogic extends GetxController {
// SmartDialog.dismiss();
// print(error);
// });
// await AppInstaller.installApk(filePath, actionRequired: false);
await AppInstaller.installApk(filePath, actionRequired: false);
}

View File

@ -11,6 +11,8 @@ class BlacklistLogic extends GetxController {
final RefreshController refreshController = RefreshController();
int page = 1;
List<User> lists = [];
bool isLoad = true;
@override
void onInit() async{
super.onInit();
@ -31,6 +33,7 @@ class BlacklistLogic extends GetxController {
if (bean.isSuccess()) {
lists.addAll(bean.data.lists);
}
isLoad = false;
update();
if (page == 1) {
refreshController.refreshCompleted();

View File

@ -34,7 +34,7 @@ class BlacklistPage extends StatelessWidget {
backgroundColor: Colors.transparent,
appBar: MyAppBar(centerTitle: '黑名单',),
body: SafeArea(
child: SmartRefresher(
child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher(
controller: logic.refreshController,
child: ListView.builder(

View File

@ -68,7 +68,7 @@ class _CirclePageState extends State<CirclePage>
},
index: controller.state.index,
itemCount: logic.circle.lists.length,
viewportFraction: 0.95,
viewportFraction: 0.93,
// scale: 0.9,
loop: false,
// pagination: new SwiperPagination(),//
@ -105,7 +105,7 @@ class _CirclePageState extends State<CirclePage>
List<String> urlList = [];
List infoList = [];
if (logic.statistics != null) {
infoList = logic.statistics!["users"];
infoList = logic.statistics!["last_visit_users"];
if (infoList.isNotEmpty) {
for (var element in infoList) {
urlList.add(element["avatar"]);
@ -119,24 +119,17 @@ class _CirclePageState extends State<CirclePage>
var element = urlList[i];
widgets.add(Positioned(
left: 15.sp * i,
child: GestureDetector(
onTap: () {
logic.pushHome(infoList[i]['id'].toString());
},
child: circleWidget(element),
),
));
);
}
if (urlList.length == 3) {
if (logic.statistics != null) {
widgets.add(Positioned(
left: 15.sp * 3,
child: GestureDetector(
onTap: () {
},
child: circleWidget(logic.statistics!['total'].toString()),
left: 15.sp * urlList.length,
child: circleWidget(logic.statistics!['visit_count'].toString()),
),
));
);
}
return Container(
width: Get.width,
@ -147,13 +140,18 @@ class _CirclePageState extends State<CirclePage>
children: [
Positioned(
left: 0,
child: Container(
child: GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.FriendsActivity,arguments: '2');
},
child: Container(
width: 30.sp * widgets.length,
height: 44.sp,
child: Stack(
alignment: Alignment.centerLeft,
children: widgets,
width: 30.sp * widgets.length,
height: 44.sp,
child: Stack(
alignment: Alignment.centerLeft,
children: widgets,
),
),
)),
ShaderMask(

View File

@ -117,7 +117,7 @@ class _InfoListViewState extends State<InfoListView> {
listLogic.refreshData();
},
child: listLogic.lists.isEmpty
? loaddingWidget(true)
? !listLogic.callOutMore ? noResultWidget() : loaddingWidget(true)
: ListView.builder(
physics: const AlwaysScrollableScrollPhysics(),
scrollDirection: Axis.vertical,

View File

@ -17,152 +17,157 @@ class FeedbackPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetBuilder(builder: (FeedbackLogic controller) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getBaseImage("home_back")),
fit: BoxFit.cover,
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
centerTitle: '意见反馈',
return GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getBaseImage("home_back")),
fit: BoxFit.cover,
),
body: SingleChildScrollView(
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
height: 200,
margin: EdgeInsets.symmetric(
horizontal: 16, vertical: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(13),
color: Color(
0xFF4C3E5F), // Use your desired background color
),
padding: EdgeInsets.all(13),
child: TextField(
maxLength: 200,
onChanged: (msg){
print(msg);
controller.state.maxMsg = '${msg.length}/200';
controller.update();
},
decoration: InputDecoration(
hintText: '请补充详细问题和意见,我们会认真看完的哦~',
counterText: '',
hintStyle: TextStyle(
color: Color(0xFFB7BECC), fontSize: 14.sp),
border: InputBorder.none,
),
maxLines: null,
inputFormatters: [
LengthLimitingTextInputFormatter(200),
],
style: TextStyle(color: Colors.white),
),
),
Positioned(
right: 30.sp,
bottom: 30.sp,
child: Text(
controller.state.maxMsg,
style: TextStyle(color: Colors.white),
))
],
),
Container(
height: 120.sp,
margin: EdgeInsets.only(left: 16.sp, right: 16.sp),
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, //
),
itemCount:controller.state.imaglist.length<3 ? controller.state.imaglist.length+1: controller.state.imaglist.length, // Replace with your item count
itemBuilder: (context, index) {
if (index == 0&&controller.state.imaglist.length<3) {
//
return GestureDetector(
onTap: () {
controller.getImageFile();
},
child: Container(
margin: EdgeInsets.all(5.sp),
child: Image(
image:
AssetImage(getMineImage("icon_img_add")),
),
),
);
} else {
//
// data
// var itemData = data[index - 1]; //
return Container(
margin: EdgeInsets.all(5.sp),
child: Center(
child: _buildImageItem(controller.state.imaglist.length<3 ?
controller.state.imaglist[index-1]: controller.state.imaglist[index], // Replace with your item count
controller,controller.state.imaglist.length<3 ? index-1:index ),
),
);
}
},
),
),
Padding(
padding: EdgeInsets.only(left: 16, top: 10),
child: Text(
'最多选择3张图片',
style:
TextStyle(color: Color(0xFFB7BECC), fontSize: 12),
),
),
SizedBox(height: 50),
GestureDetector(
onTap: () {
// showToast("完善资料");
Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user");
// controller.onInit();
},
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21),
gradient: LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
padding: EdgeInsets.only(
top: 14.sp, bottom: 14.sp, left: 95.sp, right: 95.sp),
child: Text(
"提交",
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
),
),
),
),
],
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
centerTitle: '意见反馈',
),
)),
body: SingleChildScrollView(
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
height: 200,
margin: EdgeInsets.symmetric(
horizontal: 16, vertical: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(13),
color: Color(
0xFF4C3E5F), // Use your desired background color
),
padding: EdgeInsets.all(13),
child: TextField(
maxLength: 200,
onChanged: (msg){
print(msg);
controller.state.maxMsg = '${msg.length}/200';
controller.update();
},
decoration: InputDecoration(
hintText: '请补充详细问题和意见,我们会认真看完的哦~',
counterText: '',
hintStyle: TextStyle(
color: Color(0xFFB7BECC), fontSize: 14.sp),
border: InputBorder.none,
),
maxLines: null,
inputFormatters: [
LengthLimitingTextInputFormatter(200),
],
style: TextStyle(color: Colors.white),
),
),
Positioned(
right: 30.sp,
bottom: 30.sp,
child: Text(
controller.state.maxMsg,
style: TextStyle(color: Colors.white),
))
],
),
Container(
height: 120.sp,
margin: EdgeInsets.only(left: 16.sp, right: 16.sp),
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, //
),
itemCount:controller.state.imaglist.length<3 ? controller.state.imaglist.length+1: controller.state.imaglist.length, // Replace with your item count
itemBuilder: (context, index) {
if (index == 0&&controller.state.imaglist.length<3) {
//
return GestureDetector(
onTap: () {
controller.getImageFile();
},
child: Container(
margin: EdgeInsets.all(5.sp),
child: Image(
image:
AssetImage(getMineImage("icon_img_add")),
),
),
);
} else {
//
// data
// var itemData = data[index - 1]; //
return Container(
margin: EdgeInsets.all(5.sp),
child: Center(
child: _buildImageItem(controller.state.imaglist.length<3 ?
controller.state.imaglist[index-1]: controller.state.imaglist[index], // Replace with your item count
controller,controller.state.imaglist.length<3 ? index-1:index ),
),
);
}
},
),
),
Padding(
padding: EdgeInsets.only(left: 16, top: 10),
child: Text(
'最多选择3张图片',
style:
TextStyle(color: Color(0xFFB7BECC), fontSize: 12),
),
),
SizedBox(height: 50),
GestureDetector(
onTap: () {
// showToast("完善资料");
Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user");
// controller.onInit();
},
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21),
gradient: LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
padding: EdgeInsets.only(
top: 14.sp, bottom: 14.sp, left: 95.sp, right: 95.sp),
child: Text(
"提交",
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
),
),
),
),
],
),
),
)),
),
);
});
}

View File

@ -12,6 +12,7 @@ class FriendslistLogic extends GetxController {
final type = Get.arguments as String;
int page = 1;
int isVip = 0;
bool isLoad = true;
List<UserInfo> lists = [];
@override
void onInit() async{
@ -34,6 +35,7 @@ class FriendslistLogic extends GetxController {
if (bean.isSuccess()) {
lists.addAll(bean.data.lists);
}
isLoad = false;
update();
if(page == 1){
refreshController.refreshCompleted();
@ -50,6 +52,7 @@ class FriendslistLogic extends GetxController {
if (bean.isSuccess()) {
lists.addAll(bean.data.lists);
}
isLoad = false;
update();
if(page == 1){
refreshController.refreshCompleted();
@ -66,6 +69,8 @@ class FriendslistLogic extends GetxController {
if (bean.isSuccess()) {
lists.addAll(bean.data.lists);
}
isLoad = false;
update();
if(page == 1){
refreshController.refreshCompleted();

View File

@ -31,7 +31,7 @@ class FriendslistPage extends StatelessWidget {
centerTitle: _getTitleName(logic.type),
),
body: SafeArea(
child: SmartRefresher(
child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher(
controller: logic.refreshController,
onRefresh: _onRefresh,
onLoading: _onLoading,

View File

@ -61,7 +61,7 @@ class _My_circlePageState extends State<My_circlePage>
},
index: logic.circle.lists.isNotEmpty ? 0 : controller.state.index,
itemCount: logic.circle.lists.length,
viewportFraction: 0.95,
viewportFraction: 0.93,
// scale: 0.9,
loop: false,
onIndexChanged: (index) {

View File

@ -16,141 +16,146 @@ class ReportPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetBuilder(builder: (ReportLogic controller) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getBaseImage("home_back")),
fit: BoxFit.cover,
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
centerTitle: '举报',
actionWdiget: Text(
"提交",
style: TextStyle(color: Colors.white),
return GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getBaseImage("home_back")),
fit: BoxFit.cover,
),
onPressed: () {
logic.onSubmit();
},
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 16, top: 16),
child: Text(
'举报类目',
style: TextStyle(
color: Colors.white,
fontSize: 16,
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
centerTitle: '举报',
actionWdiget: Text(
"提交",
style: TextStyle(color: Colors.white),
),
onPressed: () {
logic.onSubmit();
},
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 16, top: 16),
child: Text(
'举报类目',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
),
Container(
height: 120.sp,
child: _reportAdapter(controller),
),
Expanded(
child: Padding(
padding: EdgeInsets.fromLTRB(16, 20, 16, 0),
child: ListView(
children: [
Text(
'详细截图(请至少上传一张图片,帮助审核处理)',
style: TextStyle(
color: Colors.white70,
fontSize: 16,
Container(
height: 120.sp,
child: _reportAdapter(controller),
),
Expanded(
child: Padding(
padding: EdgeInsets.fromLTRB(16, 20, 16, 0),
child: ListView(
children: [
Text(
'详细截图(请至少上传一张图片,帮助审核处理)',
style: TextStyle(
color: Colors.white70,
fontSize: 16,
),
),
),
SizedBox(height: 20),
// RecyclerViewListView
// : MyRecyclerViewWidget(),
Container(
height: 130.sp,
child: _imageAdapter(controller)),
Text(
'补充说明',
style: TextStyle(
color: Colors.white,
fontSize: 14,
SizedBox(height: 20),
// RecyclerViewListView
// : MyRecyclerViewWidget(),
Container(
height: 130.sp,
child: _imageAdapter(controller)),
Text(
'补充说明',
style: TextStyle(
color: Colors.white,
fontSize: 14,
),
),
),
SizedBox(height: 30),
Container(
// margin: EdgeInsets.only(left: 10, right: 10),
height: 200,
width: double.infinity,
decoration: BoxDecoration(
color: Color(0xFF4C3E5F),
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.all(16.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,
counter: Text('')),
),
),
Positioned(
// right: 1.sp,
top: 160.sp,
child: Text(
'${controller.textEditingController.text.length}/200',
SizedBox(height: 30),
Container(
// margin: EdgeInsets.only(left: 10, right: 10),
height: 200,
width: double.infinity,
decoration: BoxDecoration(
color: Color(0xFF4C3E5F),
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.all(16.sp),
child: Stack(
children: [
Container(
height: 200.sp,
child: TextField(
controller: controller.textEditingController,
onChanged: (value) {
controller.update();
},
style: TextStyle(
color: Colors.white, fontSize: 12.sp),
)),
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,
counter: Text('')),
),
),
Positioned(
// right: 1.sp,
top: 160.sp,
child: Text(
'${controller.textEditingController.text.length}/200',
style: TextStyle(
color: Colors.white, fontSize: 12.sp),
)),
],
)
],
)
// Stack(
// children: [
// TextField(
// decoration: InputDecoration.collapsed(
// hintText: '违规补充说明,帮助审核处理,选填',
// border: InputBorder.none,
// hintStyle: TextStyle(
// color: Color(0xFFB7BECC),
// fontSize: 12,
// ),
// ),
// maxLength: 200,
// style: TextStyle(
// color: Color(0xFFFFFFFF),
// fontSize: 12,
// ),
// ),
// ],
// ),
),
],
// Stack(
// children: [
// TextField(
// decoration: InputDecoration.collapsed(
// hintText: '违规补充说明,帮助审核处理,选填',
// border: InputBorder.none,
// hintStyle: TextStyle(
// color: Color(0xFFB7BECC),
// fontSize: 12,
// ),
// ),
// maxLength: 200,
// style: TextStyle(
// color: Color(0xFFFFFFFF),
// fontSize: 12,
// ),
// ),
// ],
// ),
),
],
),
),
),
),
],
],
),
),
),
);

View File

@ -169,7 +169,7 @@ class Api {
//
static const getInterestsCount = 'up-service/interest/statistics';
static const getInterestsCount = 'user-service/my/statistics';
// /up-service/my/interests /up-service/interest/statistics

View File

@ -74,6 +74,20 @@ loaddingWidget(bool isMore) {
);
}
noResultWidget() {
return Container(
width: Get.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(getBaseImage('no_result'),width: 200.sp,),
SizedBox(height: 8.sp,),
Text('正在等待被填充~',style: TextStyle(color: Color(0xffdbdbdb),fontSize: 15.sp),),
],
),
);
}
///value: fontSize : fontWeightmaxWidthmaxLines
double calculateTextHeight(String value, fontSize, FontWeight fontWeight,
double maxWidth, int maxLines) {