Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Betting
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Minh Nhật
Betting
Commits
cf634a70
Commit
cf634a70
authored
Sep 07, 2023
by
Nguyễn Thành Tâm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nmn update
parent
949cb551
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
66 deletions
+61
-66
competitions_screen.dart
...avourites_view/competitions_view/competitions_screen.dart
+1
-1
fixtures_screen.dart
...ites_view/matches_view/list_fixtures/fixtures_screen.dart
+5
-11
item_fixture_widget.dart
...tches_view/list_fixtures/widgets/item_fixture_widget.dart
+50
-43
fixtures_team_info.dart
...w/matches_view/fixtures_team_info/fixtures_team_info.dart
+5
-11
No files found.
lib/view/mobile/favourites_view/competitions_view/competitions_screen.dart
View file @
cf634a70
...
@@ -88,7 +88,7 @@ class CompetitionsScreen extends StatelessWidget {
...
@@ -88,7 +88,7 @@ class CompetitionsScreen extends StatelessWidget {
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Text
(
'
${competitionController.listCompetitionsFavourites[entry.key].name}
'
,
Text
(
'
${competitionController.listCompetitionsFavourites[entry.key].name
?.trim()
}
'
,
softWrap:
true
,
softWrap:
true
,
maxLines:
3
,
maxLines:
3
,
style:
TextStyleUtils
.
sizeText12Weight600
()!.
copyWith
(
color:
Colors
.
white
),
style:
TextStyleUtils
.
sizeText12Weight600
()!.
copyWith
(
color:
Colors
.
white
),
...
...
lib/view/mobile/favourites_view/matches_view/list_fixtures/fixtures_screen.dart
View file @
cf634a70
import
'package:betting/commom/widget/loading_custom.dart'
;
import
'package:betting/commom/widget/loading_custom.dart'
;
import
'package:betting/data/model/res/matches/matches.dart'
;
import
'package:betting/routes/app_pages.dart'
;
import
'package:betting/routes/app_pages.dart'
;
import
'package:betting/view/mobile/favourites_view/matches_view/list_fixtures/fixtures_screen_controller.dart'
;
import
'package:betting/view/mobile/favourites_view/matches_view/list_fixtures/fixtures_screen_controller.dart'
;
import
'package:betting/view/mobile/favourites_view/matches_view/list_fixtures/widgets/item_fixture_widget.dart'
;
import
'package:betting/view/mobile/favourites_view/matches_view/list_fixtures/widgets/item_fixture_widget.dart'
;
...
@@ -54,26 +55,19 @@ class FixturesScreen extends StatelessWidget {
...
@@ -54,26 +55,19 @@ class FixturesScreen extends StatelessWidget {
shrinkWrap:
true
,
shrinkWrap:
true
,
itemCount:
fixtureController
.
listMatChesFavourite
[
index
].
matches
?.
length
,
itemCount:
fixtureController
.
listMatChesFavourite
[
index
].
matches
?.
length
,
itemBuilder:
(
context
,
indexMatches
)
{
itemBuilder:
(
context
,
indexMatches
)
{
Matches
?
match
=
fixtureController
.
listMatChesFavourite
[
index
].
matches
?[
indexMatches
];
return
GestureDetector
(
return
GestureDetector
(
onTap:
()
{
onTap:
()
{
Get
.
toNamed
(
Routes
.
detailMatchesRegions
,
arguments:
fixtureController
.
listMatChesFavourite
[
index
].
matches
![
indexMatches
]);
Get
.
toNamed
(
Routes
.
detailMatchesRegions
,
arguments:
fixtureController
.
listMatChesFavourite
[
index
].
matches
![
indexMatches
]);
},
},
child:
Obx
(
child:
ItemFixtureWidget
(
()
=>
ItemFixtureWidget
(
match:
match
,
date:
'
${fixtureController.listMatChesFavourite[index].matches?[indexMatches].date}
'
,
time:
DateFormat
.
Hm
().
format
(
DateTime
.
parse
(
'
${fixtureController.listMatChesFavourite[index].matches?[indexMatches].date}
${fixtureController.listMatChesFavourite[index].matches![indexMatches].time!}
'
)),
logoTeamHome:
fixtureController
.
listMatChesFavourite
[
index
].
matches
![
indexMatches
].
home
!.
logo
??
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
teamHomeName:
fixtureController
.
listMatChesFavourite
[
index
].
matches
![
indexMatches
].
home
!.
name
!,
logoTeamAway:
fixtureController
.
listMatChesFavourite
[
index
].
matches
![
indexMatches
].
away
!.
logo
??
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
teamNameAway:
fixtureController
.
listMatChesFavourite
[
index
].
matches
![
indexMatches
].
away
!.
name
!,
isHomeFavourite:
fixtureController
.
listMatChesFavourite
[
index
].
matches
![
indexMatches
].
home
!.
favourite
!,
isAwayFavourite:
fixtureController
.
listMatChesFavourite
[
index
].
matches
![
indexMatches
].
away
!.
favourite
!,
funcFavouriteMatch:
()
{
funcFavouriteMatch:
()
{
Get
.
find
<
FootballController
>().
deleteCompetitionsFavorites
(
fixtureController
.
listMatChesFavourite
[
index
].
sId
!);
Get
.
find
<
FootballController
>().
deleteCompetitionsFavorites
(
fixtureController
.
listMatChesFavourite
[
index
].
sId
!);
fixtureController
.
listMatChesFavourite
.
refresh
();
fixtureController
.
listMatChesFavourite
.
refresh
();
},
isFavouriteMatch:
true
,
},
isFavouriteMatch:
true
,
),
),
),
);
);
},
},
),
),
...
...
lib/view/mobile/favourites_view/matches_view/list_fixtures/widgets/item_fixture_widget.dart
View file @
cf634a70
import
'package:betting/commom/utils/color_utils.dart'
;
import
'package:betting/commom/utils/color_utils.dart'
;
import
'package:betting/commom/utils/textstyle.dart'
;
import
'package:betting/commom/utils/textstyle.dart'
;
import
'package:betting/data/model/res/matches/matches.dart'
;
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
class
ItemFixtureWidget
extends
StatelessWidget
{
class
ItemFixtureWidget
extends
StatelessWidget
{
const
ItemFixtureWidget
(
const
ItemFixtureWidget
({
{
Key
?
key
,
this
.
date
,
Key
?
key
,
required
this
.
time
,
required
this
.
isFavouriteMatch
,
required
this
.
logoTeamHome
,
required
this
.
funcFavouriteMatch
,
required
this
.
teamHomeName
,
this
.
match
,
required
this
.
logoTeamAway
,
})
:
super
(
key:
key
);
required
this
.
teamNameAway
,
required
this
.
isHomeFavourite
,
required
this
.
isAwayFavourite
,
required
this
.
isFavouriteMatch
,
required
this
.
funcFavouriteMatch
})
:
super
(
key:
key
);
final
String
?
date
;
final
String
time
;
final
String
logoTeamHome
;
final
String
teamHomeName
;
final
bool
isHomeFavourite
;
final
String
logoTeamAway
;
final
String
teamNameAway
;
final
bool
isAwayFavourite
;
final
bool
isFavouriteMatch
;
final
bool
isFavouriteMatch
;
final
Function
funcFavouriteMatch
;
final
Function
funcFavouriteMatch
;
final
Matches
?
match
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Container
(
return
Container
(
...
@@ -53,21 +42,29 @@ class ItemFixtureWidget extends StatelessWidget {
...
@@ -53,21 +42,29 @@ class ItemFixtureWidget extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
(
date
==
null
)
?
const
SizedBox
()
:
Text
(
(
match
?.
date
==
null
)
date
!,
?
const
SizedBox
()
style:
TextStyleUtils
.
sizeText10Weight500
()!
:
Text
(
.
copyWith
(
color:
Colors
.
white60
),
'
${match?.date}
'
,
),
style:
TextStyleUtils
.
sizeText10Weight500
()!
(
date
==
null
)
?
const
SizedBox
()
:
const
SizedBox
(
height:
16
,),
.
copyWith
(
color:
Colors
.
white60
),
),
(
match
?.
date
==
null
)
?
const
SizedBox
()
:
const
SizedBox
(
height:
16
,
),
Text
(
Text
(
time
,
'
${match?.time}
'
,
style:
TextStyleUtils
.
sizeText10Weight500
()!
style:
TextStyleUtils
.
sizeText10Weight500
()!
.
copyWith
(
color:
Colors
.
white60
),
.
copyWith
(
color:
Colors
.
white60
),
),
),
],
],
),
),
),
),
const
SizedBox
(
width:
10
,),
const
SizedBox
(
width:
10
,
),
Column
(
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
@@ -76,7 +73,8 @@ class ItemFixtureWidget extends StatelessWidget {
...
@@ -76,7 +73,8 @@ class ItemFixtureWidget extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
CachedNetworkImage
(
CachedNetworkImage
(
imageUrl:
logoTeamHome
,
imageUrl:
match
?.
home
?.
logo
??
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
imageBuilder:
(
context
,
imageProvider
)
=>
Container
(
imageBuilder:
(
context
,
imageProvider
)
=>
Container
(
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
DecorationImage
(
...
@@ -85,18 +83,20 @@ class ItemFixtureWidget extends StatelessWidget {
...
@@ -85,18 +83,20 @@ class ItemFixtureWidget extends StatelessWidget {
),
),
),
),
),
),
placeholder:
(
context
,
url
)
=>
const
CupertinoActivityIndicator
(),
placeholder:
(
context
,
url
)
=>
const
CupertinoActivityIndicator
(),
memCacheHeight:
150
,
memCacheHeight:
150
,
memCacheWidth:
150
,
memCacheWidth:
150
,
errorWidget:
(
context
,
url
,
error
)
=>
errorWidget:
(
context
,
url
,
error
)
=>
Image
.
network
(
Image
.
network
(
"https://files.lms.xteldev.com/files/n1/static/img"
,),
"https://files.lms.xteldev.com/files/n1/static/img"
,
),
width:
25
,
width:
25
,
height:
25
,
height:
25
,
),
),
SizedBox
(
SizedBox
(
width:
10
.
w
,
width:
10
.
w
,
),
),
Text
(
teamHomeName
,
Text
(
'
${match?.home?.name}
'
,
maxLines:
3
,
maxLines:
3
,
softWrap:
true
,
softWrap:
true
,
style:
TextStyleUtils
.
sizeText12Weight500
()!
style:
TextStyleUtils
.
sizeText12Weight500
()!
...
@@ -105,7 +105,7 @@ class ItemFixtureWidget extends StatelessWidget {
...
@@ -105,7 +105,7 @@ class ItemFixtureWidget extends StatelessWidget {
width:
5
.
w
,
width:
5
.
w
,
),
),
Visibility
(
Visibility
(
visible:
isHomeFavourite
,
visible:
match
!.
home
!.
favourite
!
,
child:
Icon
(
child:
Icon
(
Icons
.
star_rounded
,
Icons
.
star_rounded
,
color:
Colors
.
white54
,
color:
Colors
.
white54
,
...
@@ -121,7 +121,8 @@ class ItemFixtureWidget extends StatelessWidget {
...
@@ -121,7 +121,8 @@ class ItemFixtureWidget extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
CachedNetworkImage
(
CachedNetworkImage
(
imageUrl:
logoTeamAway
,
imageUrl:
match
?.
away
?.
logo
??
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
imageBuilder:
(
context
,
imageProvider
)
=>
Container
(
imageBuilder:
(
context
,
imageProvider
)
=>
Container
(
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
DecorationImage
(
...
@@ -130,18 +131,20 @@ class ItemFixtureWidget extends StatelessWidget {
...
@@ -130,18 +131,20 @@ class ItemFixtureWidget extends StatelessWidget {
),
),
),
),
),
),
placeholder:
(
context
,
url
)
=>
const
CupertinoActivityIndicator
(),
placeholder:
(
context
,
url
)
=>
const
CupertinoActivityIndicator
(),
memCacheHeight:
150
,
memCacheHeight:
150
,
memCacheWidth:
150
,
memCacheWidth:
150
,
errorWidget:
(
context
,
url
,
error
)
=>
errorWidget:
(
context
,
url
,
error
)
=>
Image
.
network
(
Image
.
network
(
"https://files.lms.xteldev.com/files/n1/static/img"
,),
"https://files.lms.xteldev.com/files/n1/static/img"
,
),
width:
25
,
width:
25
,
height:
25
,
height:
25
,
),
),
SizedBox
(
SizedBox
(
width:
10
.
w
,
width:
10
.
w
,
),
),
Text
(
teamNameAway
,
Text
(
'
${match?.away?.name}
'
,
maxLines:
3
,
maxLines:
3
,
softWrap:
true
,
softWrap:
true
,
style:
TextStyleUtils
.
sizeText12Weight500
()!
style:
TextStyleUtils
.
sizeText12Weight500
()!
...
@@ -150,7 +153,7 @@ class ItemFixtureWidget extends StatelessWidget {
...
@@ -150,7 +153,7 @@ class ItemFixtureWidget extends StatelessWidget {
width:
5
.
w
,
width:
5
.
w
,
),
),
Visibility
(
Visibility
(
visible:
isAwayFavourite
,
visible:
match
!.
away
!.
favourite
!
,
child:
Icon
(
child:
Icon
(
Icons
.
star_rounded
,
Icons
.
star_rounded
,
color:
Colors
.
white54
,
color:
Colors
.
white54
,
...
@@ -167,9 +170,13 @@ class ItemFixtureWidget extends StatelessWidget {
...
@@ -167,9 +170,13 @@ class ItemFixtureWidget extends StatelessWidget {
onTap:
()
=>
funcFavouriteMatch
,
onTap:
()
=>
funcFavouriteMatch
,
child:
Container
(
child:
Container
(
margin:
const
EdgeInsets
.
only
(
right:
8
),
margin:
const
EdgeInsets
.
only
(
right:
8
),
child:
Icon
(
isFavouriteMatch
==
true
?
child:
Icon
(
Icons
.
star_rounded
:
Icons
.
star_border_rounded
,
isFavouriteMatch
==
true
color:
isFavouriteMatch
==
true
?
ColorUtils
.
PRIMARY_COLOR
:
Colors
.
white
,
?
Icons
.
star_rounded
:
Icons
.
star_border_rounded
,
color:
isFavouriteMatch
==
true
?
ColorUtils
.
PRIMARY_COLOR
:
Colors
.
white
,
size:
22
.
sp
,
size:
22
.
sp
,
),
),
),
),
...
...
lib/view/mobile/favourites_view/teams/team_info_view/matches_view/fixtures_team_info/fixtures_team_info.dart
View file @
cf634a70
import
'package:betting/data/model/res/matches/matches.dart'
;
import
'package:betting/routes/app_pages.dart'
;
import
'package:betting/routes/app_pages.dart'
;
import
'package:betting/view/mobile/favourites_view/matches_view/list_fixtures/widgets/item_fixture_widget.dart'
;
import
'package:betting/view/mobile/favourites_view/matches_view/list_fixtures/widgets/item_fixture_widget.dart'
;
import
'package:betting/view/mobile/favourites_view/matches_view/list_fixtures/widgets/tournaments_widget.dart'
;
import
'package:betting/view/mobile/favourites_view/matches_view/list_fixtures/widgets/tournaments_widget.dart'
;
...
@@ -6,7 +7,6 @@ import 'package:betting/view/mobile/home_page/home_controller.dart';
...
@@ -6,7 +7,6 @@ import 'package:betting/view/mobile/home_page/home_controller.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.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'
;
import
'package:intl/intl.dart'
;
class
FixturesTeamInfo
extends
StatelessWidget
{
class
FixturesTeamInfo
extends
StatelessWidget
{
FixturesTeamInfo
({
Key
?
key
})
:
super
(
key:
key
);
FixturesTeamInfo
({
Key
?
key
})
:
super
(
key:
key
);
...
@@ -54,24 +54,18 @@ class FixturesTeamInfo extends StatelessWidget {
...
@@ -54,24 +54,18 @@ class FixturesTeamInfo extends StatelessWidget {
shrinkWrap:
true
,
shrinkWrap:
true
,
itemCount:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
?.
length
,
itemCount:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
?.
length
,
itemBuilder:
(
context
,
indexMatches
)
{
itemBuilder:
(
context
,
indexMatches
)
{
Matches
match
=
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
![
indexMatches
];
return
GestureDetector
(
return
GestureDetector
(
onTap:
()
{
onTap:
()
{
Get
.
toNamed
(
Routes
.
detailMatchesRegions
,
arguments:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
![
indexMatches
]);
Get
.
toNamed
(
Routes
.
detailMatchesRegions
,
arguments:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
![
indexMatches
]);
},
},
child:
Obx
(()
=>
Expanded
(
child:
Expanded
(
child:
ItemFixtureWidget
(
child:
ItemFixtureWidget
(
date:
'
${fixturesTeamController.listMatChesFavouriteOfTeam[index].matches?[indexMatches].date}
'
,
match:
match
,
time:
DateFormat
.
Hm
().
format
(
DateTime
.
parse
(
'
${fixturesTeamController.listMatChesFavouriteOfTeam[index].matches?[indexMatches].date}
${fixturesTeamController.listMatChesFavouriteOfTeam[index].matches![indexMatches].time!}
'
)),
logoTeamHome:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
![
indexMatches
].
home
!.
logo
??
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
teamHomeName:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
![
indexMatches
].
home
!.
name
!,
logoTeamAway:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
![
indexMatches
].
away
!.
logo
??
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
teamNameAway:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
![
indexMatches
].
away
!.
name
!,
isHomeFavourite:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
![
indexMatches
].
home
!.
favourite
!,
isAwayFavourite:
fixturesTeamController
.
listMatChesFavouriteOfTeam
[
index
].
matches
![
indexMatches
].
away
!.
favourite
!,
isFavouriteMatch:
true
,
funcFavouriteMatch:
(){},
isFavouriteMatch:
true
,
funcFavouriteMatch:
(){},
),
),
),
),
),
);
);
},
},
),
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment