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