修改背景图片为常量,避免多次绘制,出现屏幕闪烁
This commit is contained in:
parent
4c56a2f618
commit
3783400390
@ -18,6 +18,11 @@ import '../select_circle/logic.dart';
|
||||
import '../userinfo/logic.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
|
||||
const bgWidget = DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage('assets/images/base/home_back.png'));
|
||||
|
||||
class CirclePage extends StatefulWidget {
|
||||
CirclePage({Key? key}) : super(key: key);
|
||||
|
||||
@ -71,11 +76,9 @@ class _CirclePageState extends State<CirclePage>
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF423055),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getBaseImage('home_back')))),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF423055),
|
||||
image: bgWidget),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
|
||||
@ -20,7 +20,10 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../util/SharedPreferencesHelper.dart';
|
||||
import '../../../util/eventBus.dart';
|
||||
|
||||
const listBgWidget = Image(
|
||||
image: AssetImage('assets/images/circle/circle_bg.png'),
|
||||
fit: BoxFit.fill,
|
||||
);
|
||||
class InfoListView extends StatefulWidget {
|
||||
// Get.lazyPut(() => ListLogic());
|
||||
|
||||
@ -267,10 +270,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
child: Image.asset(
|
||||
getCircleImage('circle_bg'),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
child: listBgWidget
|
||||
)),
|
||||
Container(
|
||||
height: Get.height,
|
||||
|
||||
@ -55,14 +55,12 @@ class HomeLogic extends GetxController {
|
||||
userInfo,
|
||||
text,
|
||||
) async {
|
||||
print("收到新消息"+text);
|
||||
unreadSIze.value = (int.parse(unreadSIze.value)+1).toString();
|
||||
print("收到新消息" + text);
|
||||
unreadSIze.value = (int.parse(unreadSIze.value) + 1).toString();
|
||||
//getUnreadSize();
|
||||
});
|
||||
_messageService.addSimpleMsgListener(listener: msgListener);
|
||||
|
||||
|
||||
|
||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
data, (data) => UpdateInfo.fromJson(data));
|
||||
@ -76,35 +74,37 @@ class HomeLogic extends GetxController {
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
.getConversationManager()
|
||||
.getTotalUnreadMessageCount();
|
||||
print("未读数量desc=" + getTotalUnreadMessageCountRes.desc.toString()+"code="+getTotalUnreadMessageCountRes.code.toString()+"data="+getTotalUnreadMessageCountRes.data.toString());
|
||||
print("未读数量desc=" +
|
||||
getTotalUnreadMessageCountRes.desc.toString() +
|
||||
"code=" +
|
||||
getTotalUnreadMessageCountRes.code.toString() +
|
||||
"data=" +
|
||||
getTotalUnreadMessageCountRes.data.toString());
|
||||
|
||||
if (getTotalUnreadMessageCountRes.code == 0) {
|
||||
unreadSIze.value = getTotalUnreadMessageCountRes.data.toString();
|
||||
if (Platform.isAndroid) {
|
||||
setOfflinePushStatus(status: AppStatus.foreground);
|
||||
}
|
||||
|
||||
}else{
|
||||
} else {
|
||||
getUnreadSize();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
Future<V2TimCallback> setOfflinePushStatus(
|
||||
{required AppStatus status, int? totalCount}) {
|
||||
|
||||
if (status == AppStatus.foreground) {
|
||||
// 当应用status为前台时,上报doForeground()
|
||||
return TencentImSDKPlugin.v2TIMManager
|
||||
.getOfflinePushManager()
|
||||
.doForeground();
|
||||
} else {
|
||||
// 当应用status为后台时,上报doBackground(),并带上未读数
|
||||
return TencentImSDKPlugin.v2TIMManager
|
||||
.getOfflinePushManager()
|
||||
.doBackground(unreadCount: totalCount ?? 0);
|
||||
}
|
||||
if (status == AppStatus.foreground) {
|
||||
// 当应用status为前台时,上报doForeground()
|
||||
return TencentImSDKPlugin.v2TIMManager
|
||||
.getOfflinePushManager()
|
||||
.doForeground();
|
||||
} else {
|
||||
// 当应用status为后台时,上报doBackground(),并带上未读数
|
||||
return TencentImSDKPlugin.v2TIMManager
|
||||
.getOfflinePushManager()
|
||||
.doBackground(unreadCount: totalCount ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@ -113,7 +113,6 @@ class HomeLogic extends GetxController {
|
||||
super.onReady();
|
||||
|
||||
FlutterNativeSplash.remove();
|
||||
|
||||
}
|
||||
|
||||
void showReportDialog(
|
||||
|
||||
@ -275,12 +275,12 @@ class InvitePage extends StatelessWidget {
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 15.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Image.asset(getMineImage('invite_title'),width: 256.sp,),
|
||||
child: Image.asset(getMineImage('invite_title'),height: 22.sp,),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
margin: EdgeInsets.only(top: 15.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Image.asset(getMineImage('invite_line'),width: 328.sp,),
|
||||
child: Image.asset(getMineImage('invite_line'),height: 1.2.sp,),
|
||||
),
|
||||
Container(
|
||||
height: 70.sp,
|
||||
@ -353,7 +353,7 @@ class InvitePage extends StatelessWidget {
|
||||
Expanded(child: Container()),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 15.sp, right: 15.sp,bottom: 20.sp),
|
||||
left: 15.sp, right: 15.sp,bottom: 15.sp),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
children: allSpan
|
||||
|
||||
@ -6,7 +6,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
const loginBgWidget = Image(
|
||||
image: AssetImage('assets/images/base/bg.png'),
|
||||
fit: BoxFit.fill,
|
||||
);
|
||||
class LoginPage extends StatelessWidget {
|
||||
LoginPage({Key? key}) : super(key: key);
|
||||
|
||||
@ -19,13 +22,9 @@ class LoginPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Image.asset(
|
||||
getBaseImage('bg'),
|
||||
fit: BoxFit.fill,
|
||||
width: Get.width,
|
||||
height: Get.height,
|
||||
),
|
||||
loginBgWidget,
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
@ -61,10 +60,10 @@ class LoginPage extends StatelessWidget {
|
||||
|
||||
child: Container(
|
||||
width: 280.sp,
|
||||
height: 50.sp,
|
||||
height: 60.sp,
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.white60,
|
||||
borderRadius: BorderRadius.circular(25.sp),
|
||||
borderRadius: BorderRadius.circular(30.sp),
|
||||
border: Border.all(color: Colors.white60,width: 0.5.sp)
|
||||
),)),
|
||||
Row(
|
||||
@ -118,7 +117,7 @@ class LoginPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.sp),
|
||||
margin: EdgeInsets.only(top: 25.sp),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
@ -127,10 +126,10 @@ class LoginPage extends StatelessWidget {
|
||||
|
||||
child: Container(
|
||||
width: 280.sp,
|
||||
height: 50.sp,
|
||||
height: 60.sp,
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.white60,
|
||||
borderRadius: BorderRadius.circular(25.sp),
|
||||
borderRadius: BorderRadius.circular(30.sp),
|
||||
border: Border.all(color: Colors.white60,width: 0.5.sp)
|
||||
),)),
|
||||
Row(
|
||||
@ -205,18 +204,18 @@ class LoginPage extends StatelessWidget {
|
||||
logic.login();
|
||||
},
|
||||
child: Container(
|
||||
width: 168.sp,
|
||||
height: 42.sp,
|
||||
width: 200.sp,
|
||||
height: 50.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(21.sp),
|
||||
borderRadius: BorderRadius.circular(25.sp),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [Color(0xff0AFCFF), Color(0xffD739EA)])),
|
||||
child: Text(
|
||||
'登录',
|
||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
style: TextStyle(color: Colors.white, fontSize: 16.sp,fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -232,13 +231,13 @@ class LoginPage extends StatelessWidget {
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: [
|
||||
!logic.check ? Container(width: 14.sp,height: 14.sp,decoration: BoxDecoration(border: Border.all(color: Colors.white70,width: 1.sp),borderRadius: BorderRadius.circular(10)),): Icon(Icons.check_circle_rounded,size: 15.sp,color: Color(0xff00FFF4),),
|
||||
!logic.check ? Container(width: 18.sp,height: 18.sp,decoration: BoxDecoration(border: Border.all(color: Colors.white70,width: 1.sp),borderRadius: BorderRadius.circular(10)),): Icon(Icons.check_circle_rounded,size: 19.sp,color: Color(0xff00FFF4),),
|
||||
SizedBox(width: 4.sp,),
|
||||
Text(
|
||||
'同意',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 11.sp,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
@ -252,7 +251,7 @@ class LoginPage extends StatelessWidget {
|
||||
'《用户协议》',
|
||||
style: TextStyle(
|
||||
color: Color(0xff00FFF4),
|
||||
fontSize: 11.sp,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
@ -261,7 +260,7 @@ class LoginPage extends StatelessWidget {
|
||||
'和',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 11.sp,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(
|
||||
@ -275,7 +274,7 @@ class LoginPage extends StatelessWidget {
|
||||
'《隐私协议》',
|
||||
style: TextStyle(
|
||||
color: Color(0xff00FFF4),
|
||||
fontSize: 11.sp,
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
|
||||
@ -2,8 +2,10 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/circle/view.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -12,11 +14,18 @@ import '../../util/SharedPreferencesHelper.dart';
|
||||
import '../../util/util.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
const vipIcon = 'assets/images/home/icon_vip.png';
|
||||
|
||||
const MyImageWidget = const Image(
|
||||
image: AssetImage(vipIcon),
|
||||
fit: BoxFit.fill,
|
||||
);
|
||||
class MinefragmentPage extends StatelessWidget {
|
||||
MinefragmentPage({Key? key}) : super(key: key);
|
||||
|
||||
final logic = Get.lazyPut(() => MinefragmentLogic());
|
||||
|
||||
|
||||
final state = Get
|
||||
.find<MinefragmentLogic>()
|
||||
.state;
|
||||
@ -34,11 +43,8 @@ class MinefragmentPage extends StatelessWidget {
|
||||
body: Container(
|
||||
width: Get.width,
|
||||
height: Get.height,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(getBaseImage("home_back")),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
image: bgWidget
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
@ -55,17 +61,14 @@ class MinefragmentPage extends StatelessWidget {
|
||||
showRechargeDialog(logic);
|
||||
},
|
||||
child: Stack(children: [
|
||||
Image(
|
||||
image: AssetImage(getHomeImage("icon_vip")),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
MyImageWidget,
|
||||
Positioned(
|
||||
top: 54.sp,
|
||||
left: 71.3.sp,
|
||||
top: 58.sp,
|
||||
left: 90.sp,
|
||||
child: Text(logic.vipMsg,style: TextStyle(color: const Color(0x99FFFFFF),fontSize: 12.sp),)),
|
||||
Positioned(
|
||||
top: 24.sp,
|
||||
left: 71.3.sp,
|
||||
top: 32.sp,
|
||||
left: 90.sp,
|
||||
child: Text("会员-微乐园贵宾",style: TextStyle(color: const Color(0xFFFFFFFF),fontSize: 16.sp),))
|
||||
],),
|
||||
),
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/circle/view.dart';
|
||||
import 'package:circle_app/common/Widgets/open_vip_tip/view.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
import 'package:circle_app/network/api.dart';
|
||||
@ -63,10 +64,8 @@ class MsgPage extends StatelessWidget {
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getBaseImage('home_back')))),
|
||||
decoration: const BoxDecoration(
|
||||
image: bgWidget),
|
||||
),
|
||||
SafeArea(
|
||||
child: GetBuilder(builder: (MsgLogic controller) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user