Commit bd3eec99 authored by Nguyễn Minh Nhật's avatar Nguyễn Minh Nhật

nmn update

parent cdc60293
...@@ -18,7 +18,7 @@ class CacheNetWorkCustom extends StatelessWidget { ...@@ -18,7 +18,7 @@ class CacheNetWorkCustom extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: imageProvider, image: imageProvider,
fit: BoxFit.cover, fit: BoxFit.fill,
), ),
), ),
), ),
......
...@@ -169,11 +169,11 @@ class DetailMatchesRegionsController extends GetxController { ...@@ -169,11 +169,11 @@ class DetailMatchesRegionsController extends GetxController {
} }
checkHeight() { checkHeight() {
if(isVisiablebackgroudYt.value == true){ if(isVisiablebackgroudYt.value == true){
return 320.h; return 330.h;
}else if(isVisiable.value == true){ }else if(isVisiable.value == true){
return 360.h; return 360.h;
}else if(isVisiableYt.value == true){ }else if(isVisiableYt.value == true){
return 320.h; return 330.h;
}else{ }else{
return 150.h; return 150.h;
} }
......
...@@ -61,130 +61,8 @@ class FootballPage extends GetView<FootballController> { ...@@ -61,130 +61,8 @@ class FootballPage extends GetView<FootballController> {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, indexMatches) { itemBuilder: (context, indexMatches) {
return InkWell( return
onTap: () { itemListScore(controller, index, indexMatches);
Get.toNamed(Routes.detailMatchesRegions, arguments: controller.listMatches[index].matches![indexMatches]);
},
child: Container(
margin: EdgeInsets.only(bottom: 4.h),
padding: EdgeInsets.symmetric(vertical: 8.h),
decoration: BoxDecoration(
color: const Color.fromRGBO(255, 255, 255, 0.1),
borderRadius: BorderRadius.circular(6.r)
),
child: Row(
children: [
controller.listMatches[index].matches![indexMatches].status =='IN PLAY'?
SizedBox(
width: 40.w,
child: Row(
children: [
Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(topRight: Radius.circular(6), bottomRight: Radius.circular(6)),
color: ColorUtils.PRIMARY_COLOR,
),
width: 4.w,
height: 40.h,
),
SizedBox(width: 6.w,),
Text('${controller.listMatches[index].matches![indexMatches].matchTime}\'',style: const TextStyle(color:ColorUtils.PRIMARY_COLOR, fontWeight: FontWeight.bold))
],
),
):
Column(
children: [
SizedBox(
width: 40.w,
child: Text(controller.getMatchTimeText(index, indexMatches),textAlign: TextAlign.center,style: const TextStyle(color: Colors.white),),
),
],
),
SizedBox(width: 8.w,),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
SizedBox(
height: 18.h,
width:18.h,
child: CacheNetWorkCustom(urlImage: '${controller.listMatches[index].matches![indexMatches].home?.logo}',),
),
SizedBox(width: 8.w,),
RichText(text: TextSpan(
children: [
TextSpan(text:"${controller.listMatches[index].matches![indexMatches].home!.name}",style: const TextStyle(color: Colors.white)),
WidgetSpan(child: controller.listMatches[index].matches![indexMatches].home!.favourite == true ? Container(
margin: EdgeInsets.only(left: 4.w),
child: const Icon(Icons.star,color:Colors.grey, size: 16,),): Container(),
)
]
)),
SizedBox(width: 8.w,),
const Spacer(),
controller.listMatches[index].matches![indexMatches].status =='FINISHED'?
Text( controller.listMatches[index].matches![indexMatches].ftScore!=""?controller.listMatches[index].matches![indexMatches].ftScore!.substring(0,1):'',style: const TextStyle(color: Colors.white),):
controller.listMatches[index].matches![indexMatches].status =='IN PLAY'?
controller.listMatches[index].matches![indexMatches].score!= "" ?
Text(controller.listMatches[index].matches![indexMatches].score!.substring(0,1),style: const TextStyle(color: Colors.white),):
const Text('0',style: TextStyle(color: Colors.white)):
const Text(''),
],
),
SizedBox(height: 4.h,),
Row(
children: [
SizedBox(
height: 18.h,
width: 18.h,
child: CacheNetWorkCustom(urlImage: '${controller.listMatches[index].matches![indexMatches].away!.logo}',),
),
SizedBox(width: 6.5.w,),
SizedBox(
width: 160.w,
child: Text("${controller.listMatches[index].matches![indexMatches].away!.name}",style: const TextStyle(color: Colors.white),),
),
SizedBox(width: 6.5.w,),
controller.listMatches[index].matches![indexMatches].away!.favourite == true ? const Icon(Icons.star,color:Colors.grey, size: 16,): Container(),
const Spacer(),
controller.listMatches[index].matches![indexMatches].status =='FINISHED'?
Text(controller.listMatches[index].matches![indexMatches].ftScore!="" ? controller.listMatches[index].matches![indexMatches].ftScore!.substring(4,5):'',style: const TextStyle(color: Colors.white),):
controller.listMatches[index].matches![indexMatches].status =='IN PLAY'?
controller.listMatches[index].matches![indexMatches].score!= "" ?
Text(controller.listMatches[index].matches![indexMatches].score!.substring(4,5),style: const TextStyle(color: Colors.white),):
const Text('0',style: TextStyle(color: Colors.white)):
const Text(''),
],
)
],
),
),
SizedBox(width: 8.w,),
controller.listMatches[index].matches![indexMatches].status =='INIT' ?
InkWell(
onTap: (){
controller.listMatches[index].matches![indexMatches].favourite =! controller.listMatches[index].matches![indexMatches].favourite!;
if(controller.listMatches[index].matches![indexMatches].favourite ==true){
controller.addMatchesFavorites(controller.listMatches[index].matches![indexMatches].sId!, index);
controller.listMatches.refresh();
}else{
controller.deleteCompetitionsFavorites( controller.listMatches[index].matches![indexMatches].sId!);
}
},
child: controller.listMatches[index].matches![indexMatches].favourite==true ?
const Icon(Icons.star_rounded,color:ColorUtils.PRIMARY_COLOR,) :
const Icon(Icons.star_border_rounded,color: Colors.white,),
) : const Icon(Icons.star_border_rounded,color: Colors.grey,),
SizedBox(width: 8.w,),
],
),
),
);
},)), },)),
index == 0 ? index == 0 ?
NativeAdsCustom(height: 130.h,nativeAdManager:controller.nativeAds[0] ,radius: 0.r,) :const SizedBox(), NativeAdsCustom(height: 130.h,nativeAdManager:controller.nativeAds[0] ,radius: 0.r,) :const SizedBox(),
...@@ -202,10 +80,139 @@ class FootballPage extends GetView<FootballController> { ...@@ -202,10 +80,139 @@ class FootballPage extends GetView<FootballController> {
Get.find<HomeController>().onRefreshPressed(); Get.find<HomeController>().onRefreshPressed();
controller. getListMatchesOnDay('',controller.outputDateToDateFormat.format(DateTime.now()),''); controller. getListMatchesOnDay('',controller.outputDateToDateFormat.format(DateTime.now()),'');
controller.listMatches.refresh(); controller.listMatches.refresh();
},) },)
:const LoadingCustom(); :const LoadingCustom();
},); },);
} }
InkWell itemListScore(FootballController controller, int index, int indexMatches) {
return InkWell(
onTap: () {
Get.toNamed(Routes.detailMatchesRegions, arguments: controller.listMatches[index].matches![indexMatches]);
},
child: Container(
margin: EdgeInsets.only(bottom: 4.h),
padding: EdgeInsets.symmetric(vertical: 8.h),
decoration: BoxDecoration(
color: const Color.fromRGBO(255, 255, 255, 0.1),
borderRadius: BorderRadius.circular(6.r)
),
child: Row(
children: [
controller.listMatches[index].matches![indexMatches].status =='IN PLAY'?
SizedBox(
width: 40.w,
child: Row(
children: [
Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(topRight: Radius.circular(6), bottomRight: Radius.circular(6)),
color: ColorUtils.PRIMARY_COLOR,
),
width: 4.w,
height: 40.h,
),
SizedBox(width: 6.w,),
Text('${controller.listMatches[index].matches![indexMatches].matchTime}\'',style: const TextStyle(color:ColorUtils.PRIMARY_COLOR, fontWeight: FontWeight.bold))
],
),
):
Column(
children: [
SizedBox(
width: 40.w,
child: Text(controller.getMatchTimeText(index, indexMatches),textAlign: TextAlign.center,style: const TextStyle(color: Colors.white),),
),
],
),
SizedBox(width: 8.w,),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
SizedBox(
height: 20.h,
width:18.h,
child: CacheNetWorkCustom(urlImage:
controller.listMatches[index].matches![indexMatches].home?.logo!= null ?
'${controller.listMatches[index].matches![indexMatches].home?.logo}':
"https://upload.wikimedia.org/wikipedia/vi/thumb/c/c7/Logo_Real_Madrid.svg/1432px-Logo_Real_Madrid.svg.png"
,),
),
SizedBox(width: 8.w,),
RichText(text: TextSpan(
children: [
TextSpan(text:"${controller.listMatches[index].matches![indexMatches].home!.name}",style: const TextStyle(color: Colors.white)),
WidgetSpan(child: controller.listMatches[index].matches![indexMatches].home!.favourite == true ? Container(
margin: EdgeInsets.only(left: 4.w),
child: const Icon(Icons.star,color:Colors.grey, size: 16,),): Container(),
)
]
)),
SizedBox(width: 8.w,),
const Spacer(),
controller.listMatches[index].matches![indexMatches].status =='FINISHED'?
Text( controller.listMatches[index].matches![indexMatches].ftScore!=""?controller.listMatches[index].matches![indexMatches].ftScore!.substring(0,1):'',style: const TextStyle(color: Colors.white),):
controller.listMatches[index].matches![indexMatches].status =='IN PLAY'?
controller.listMatches[index].matches![indexMatches].score!= "" ?
Text(controller.listMatches[index].matches![indexMatches].score!.substring(0,1),style: const TextStyle(color: Colors.white),):
const Text('0',style: TextStyle(color: Colors.white)):
const Text(''),
],
),
SizedBox(height: 4.h,),
Row(
children: [
SizedBox(
height: 20.h,
width: 18.h,
child: CacheNetWorkCustom(urlImage:
controller.listMatches[index].matches?[indexMatches].away?.logo!= null ?
'${controller.listMatches[index].matches?[indexMatches].away?.logo}' :
"https://upload.wikimedia.org/wikipedia/vi/thumb/1/1d/Manchester_City_FC_logo.svg/2048px-Manchester_City_FC_logo.svg.png",),
),
SizedBox(width: 6.5.w,),
SizedBox(
width: 160.w,
child: Text("${controller.listMatches[index].matches![indexMatches].away!.name}",style: const TextStyle(color: Colors.white),),
),
SizedBox(width: 6.5.w,),
controller.listMatches[index].matches![indexMatches].away!.favourite == true ? const Icon(Icons.star,color:Colors.grey, size: 16,): Container(),
const Spacer(),
controller.listMatches[index].matches![indexMatches].status =='FINISHED'?
Text(controller.listMatches[index].matches![indexMatches].ftScore!="" ? controller.listMatches[index].matches![indexMatches].ftScore!.substring(4,5):'',style: const TextStyle(color: Colors.white),):
controller.listMatches[index].matches![indexMatches].status =='IN PLAY'?
controller.listMatches[index].matches![indexMatches].score!= "" ?
Text(controller.listMatches[index].matches![indexMatches].score!.substring(4,5),style: const TextStyle(color: Colors.white),):
const Text('0',style: TextStyle(color: Colors.white)):
const Text(''),
],
)
],
),),
SizedBox(width: 8.w,),
controller.listMatches[index].matches![indexMatches].status =='INIT' ?
InkWell(
onTap: (){
controller.listMatches[index].matches![indexMatches].favourite =! controller.listMatches[index].matches![indexMatches].favourite!;
if(controller.listMatches[index].matches![indexMatches].favourite ==true){
controller.addMatchesFavorites(controller.listMatches[index].matches![indexMatches].sId!, index);
controller.listMatches.refresh();
}else{
controller.deleteCompetitionsFavorites( controller.listMatches[index].matches![indexMatches].sId!);
}
},
child: controller.listMatches[index].matches![indexMatches].favourite==true ?
const Icon(Icons.star_rounded,color:ColorUtils.PRIMARY_COLOR,) :
const Icon(Icons.star_border_rounded,color: Colors.white,),
) : const Icon(Icons.star_border_rounded,color: Colors.grey,),
SizedBox(width: 8.w,),
],
),
),
);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment