增加占位图展示

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,6 +140,10 @@ class _CirclePageState extends State<CirclePage>
children: [
Positioned(
left: 0,
child: GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.FriendsActivity,arguments: '2');
},
child: Container(
width: 30.sp * widgets.length,
@ -155,6 +152,7 @@ class _CirclePageState extends State<CirclePage>
alignment: Alignment.centerLeft,
children: widgets,
),
),
)),
ShaderMask(
shaderCallback: (Rect bounds) {

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,7 +17,11 @@ class FeedbackPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetBuilder(builder: (FeedbackLogic controller) {
return Container(
return GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getBaseImage("home_back")),
@ -163,6 +167,7 @@ class FeedbackPage extends StatelessWidget {
),
),
)),
),
);
});
}

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,7 +16,11 @@ class ReportPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetBuilder(builder: (ReportLogic controller) {
return Container(
return GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getBaseImage("home_back")),
@ -153,6 +157,7 @@ class ReportPage extends StatelessWidget {
],
),
),
),
);
});
}

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) {