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
90592f3e
Commit
90592f3e
authored
Sep 09, 2023
by
Nguyễn Minh Nhật
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nmn update
parent
f16c9d4e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
201 additions
and
193 deletions
+201
-193
bottom_sheet_widget.dart
...ourites_view/bottom_sheet_widget/bottom_sheet_widget.dart
+6
-4
competitions_screen.dart
...avourites_view/competitions_view/competitions_screen.dart
+88
-80
teams_screen.dart
lib/view/mobile/favourites_view/teams/teams_screen.dart
+103
-100
teams_screen_controller.dart
...mobile/favourites_view/teams/teams_screen_controller.dart
+4
-9
No files found.
lib/view/mobile/favourites_view/bottom_sheet_widget/bottom_sheet_widget.dart
View file @
90592f3e
...
@@ -13,7 +13,7 @@ class BottomSheetWidget extends StatelessWidget {
...
@@ -13,7 +13,7 @@ class BottomSheetWidget extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Container
(
return
Container
(
padding:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
top:
2
.
h
,
bottom:
10
.
h
),
padding:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
grey
.
shade800
,
color:
Colors
.
grey
.
shade800
,
borderRadius:
const
BorderRadius
.
only
(
borderRadius:
const
BorderRadius
.
only
(
...
@@ -162,7 +162,9 @@ class BottomSheetWidget extends StatelessWidget {
...
@@ -162,7 +162,9 @@ class BottomSheetWidget extends StatelessWidget {
SizedBox
(
SizedBox
(
height:
12
.
h
,
height:
12
.
h
,
),
),
ElevatedButton
(
SizedBox
(
width:
double
.
infinity
,
child:
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
Get
.
back
();
Get
.
back
();
},
},
...
@@ -171,14 +173,14 @@ class BottomSheetWidget extends StatelessWidget {
...
@@ -171,14 +173,14 @@ class BottomSheetWidget extends StatelessWidget {
shape:
RoundedRectangleBorder
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
minimumSize:
Size
.
fromHeight
(
40
.
h
),
),
),
child:
Text
(
child:
Text
(
'Done'
,
'Done'
,
style:
TextStyleUtils
.
sizeText14Weight500
()!
style:
TextStyleUtils
.
sizeText14Weight500
()!
.
copyWith
(
color:
Colors
.
black87
),
.
copyWith
(
color:
Colors
.
black87
),
),
),
)
),
)
],
],
),
),
);
);
...
...
lib/view/mobile/favourites_view/competitions_view/competitions_screen.dart
View file @
90592f3e
...
@@ -42,92 +42,100 @@ class CompetitionsScreen extends StatelessWidget {
...
@@ -42,92 +42,100 @@ class CompetitionsScreen extends StatelessWidget {
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Obx
(()
=>
Wrap
(
SizedBox
(
height:
15
.
h
,),
crossAxisAlignment:
WrapCrossAlignment
.
start
,
Obx
(()
=>
GridView
.
builder
(
spacing:
10
,
scrollDirection:
Axis
.
vertical
,
children:
competitionController
.
listCompetitionsFavourites
.
asMap
().
entries
.
map
((
entry
)
{
itemCount:
competitionController
.
listCompetitionsFavourites
.
length
,
return
GestureDetector
(
shrinkWrap:
true
,
onTap:
()
{
physics:
const
NeverScrollableScrollPhysics
(),
Get
.
toNamed
(
Routes
.
detailTournamentPage
,
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
arguments:
competitionController
.
listCompetitionsFavourites
[
entry
.
key
],
crossAxisSpacing:
10
,
);
mainAxisSpacing:
10
,
},
crossAxisCount:
2
),
child:
Container
(
itemBuilder:
(
context
,
index
)
{
margin:
const
EdgeInsets
.
only
(
top:
15
,
left:
5
),
return
height:
!
Device
.
get
().
isTablet
?
Get
.
width
*
0.45
:
(
isLandScape
)
?
Get
.
width
/
6
-
49
:
Get
.
width
/
4
-
20
,
Obx
(()
=>
GestureDetector
(
width:
!
Device
.
get
().
isTablet
?
Get
.
width
*
0.45
:
(
isLandScape
)
?
Get
.
width
/
6
-
49
:
Get
.
width
/
4
-
20
,
onTap:
()
{
decoration:
BoxDecoration
(
Get
.
toNamed
(
Routes
.
detailTournamentPage
,
gradient:
LinearGradient
(
arguments:
competitionController
.
listCompetitionsFavourites
[
index
],
colors:
[
);
Colors
.
blue
.
shade900
,
},
Colors
.
blue
.
shade300
child:
Container
(
],
height:
!
Device
.
get
().
isTablet
?
Get
.
width
*
0.45
:
(
isLandScape
)
?
Get
.
width
/
6
-
49
:
Get
.
width
/
4
-
20
,
begin:
Alignment
.
bottomCenter
,
width:
!
Device
.
get
().
isTablet
?
Get
.
width
*
0.45
:
(
isLandScape
)
?
Get
.
width
/
6
-
49
:
Get
.
width
/
4
-
20
,
end:
Alignment
.
topCenter
,
decoration:
BoxDecoration
(
tileMode:
TileMode
.
repeated
,
gradient:
LinearGradient
(
),
colors:
[
borderRadius:
const
BorderRadius
.
all
(
Radius
.
circular
(
8
))),
Colors
.
blue
.
shade900
,
child:
Row
(
Colors
.
blue
.
shade300
crossAxisAlignment:
CrossAxisAlignment
.
start
,
],
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
begin:
Alignment
.
bottomCenter
,
children:
[
end:
Alignment
.
topCenter
,
Column
(
tileMode:
TileMode
.
repeated
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
),
borderRadius:
const
BorderRadius
.
all
(
Radius
.
circular
(
8
))),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Container
(
padding:
const
EdgeInsets
.
only
(
left:
20
,
top:
10
),
child:
Image
.
network
(
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
height:
45
,
width:
45
,
),
),
GestureDetector
(
onTap:
()
{
competitionController
.
deleteCompetitionsFavorites
(
competitionController
.
listCompetitionsFavourites
[
index
].
id
!);
competitionController
.
listCompetitions
.
firstWhere
((
element
)
=>
element
.
id
==
competitionController
.
listCompetitionsFavourites
[
index
].
id
).
favourite
=
false
;
competitionController
.
listCompetitions
.
refresh
();
competitionController
.
listCompetitionsFavourites
.
refresh
();
competitionController
.
update
();
},
child:
Container
(
margin:
const
EdgeInsets
.
only
(
right:
20
,
top:
20
),
width:
25
,
height:
25
,
decoration:
const
BoxDecoration
(
color:
Colors
.
grey
,
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
20
))),
child:
const
Icon
(
Icons
.
star_rounded
,
color:
ColorUtils
.
PRIMARY_COLOR
,
size:
19
,
)),
),
],
),
Container
(
width:
!
Device
.
get
().
isTablet
?
Get
.
width
*
0.45
-
45
:
(
isLandScape
)
?
(
Get
.
width
/
6
-
50
)
-
45
:
(
Get
.
width
/
4
-
20
)
-
45
,
padding:
const
EdgeInsets
.
only
(
left:
10
,
bottom:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Container
(
Text
(
'
${competitionController.listCompetitionsFavourites[index].name}
'
,
padding:
const
EdgeInsets
.
only
(
left:
20
,
top:
10
),
softWrap:
true
,
child:
Image
.
network
(
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
maxLines:
3
,
height:
45
,
style:
TextStyleUtils
.
sizeText12Weight600
()!.
copyWith
(
color:
Colors
.
white
),
width:
45
,
),
),
Text
(
competitionController
.
listCompetitionsFavourites
[
index
].
country
!.
name
!,
style:
TextStyleUtils
.
sizeText10Weight400
()!.
copyWith
(
color:
Colors
.
white
),
),
),
Container
(
width:
!
Device
.
get
().
isTablet
?
Get
.
width
*
0.45
-
45
:
(
isLandScape
)
?
(
Get
.
width
/
6
-
50
)
-
45
:
(
Get
.
width
/
4
-
20
)
-
45
,
padding:
const
EdgeInsets
.
only
(
left:
10
,
bottom:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'
${competitionController.listCompetitionsFavourites[entry.key].name}
'
,
softWrap:
true
,
maxLines:
3
,
style:
TextStyleUtils
.
sizeText12Weight600
()!.
copyWith
(
color:
Colors
.
white
),
),
Text
(
competitionController
.
listCompetitionsFavourites
[
entry
.
key
].
country
!.
name
!,
style:
TextStyleUtils
.
sizeText10Weight400
()!.
copyWith
(
color:
Colors
.
white
),
),
],
),
)
],
],
),
),
GestureDetector
(
)
onTap:
()
{
competitionController
.
deleteCompetitionsFavorites
(
competitionController
.
listCompetitionsFavourites
[
entry
.
key
].
id
!);
],
competitionController
.
listCompetitions
.
firstWhere
((
element
)
=>
element
.
id
==
competitionController
.
listCompetitionsFavourites
[
entry
.
key
].
id
).
favourite
=
false
;
competitionController
.
listCompetitions
.
refresh
();
competitionController
.
listCompetitionsFavourites
.
refresh
();
competitionController
.
update
();
},
child:
Container
(
margin:
const
EdgeInsets
.
only
(
right:
20
,
top:
20
),
width:
25
,
height:
25
,
decoration:
const
BoxDecoration
(
color:
Colors
.
grey
,
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
20
))),
child:
const
Icon
(
Icons
.
star_rounded
,
color:
ColorUtils
.
PRIMARY_COLOR
,
size:
19
,
)),
),
],
),
),
),
)
;
)
,
}).
toList
(),
));
),
),
},)
),
const
SizedBox
(
const
SizedBox
(
height:
10
,
height:
10
,
),
),
...
...
lib/view/mobile/favourites_view/teams/teams_screen.dart
View file @
90592f3e
...
@@ -44,106 +44,109 @@ class TeamsScreen extends StatelessWidget {
...
@@ -44,106 +44,109 @@ class TeamsScreen extends StatelessWidget {
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Obx
(
SizedBox
(
height:
15
.
h
,),
()
=>
Wrap
(
Obx
(()
=>
GridView
.
builder
(
crossAxisAlignment:
WrapCrossAlignment
.
start
,
shrinkWrap:
true
,
spacing:
10
,
physics:
const
NeverScrollableScrollPhysics
(),
children:
teamsScreenController
.
favouriteTeams
.
asMap
().
entries
.
map
((
entry
)
{
itemCount:
teamsScreenController
.
favouriteTeams
.
length
,
return
GestureDetector
(
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
onTap:
()
{
crossAxisCount:
2
,
Get
.
toNamed
(
mainAxisSpacing:
10
,
Routes
.
detailTeams
,
arguments:
teamsScreenController
.
favouriteTeams
[
entry
.
key
]
crossAxisSpacing:
10
);
),
itemBuilder:
(
context
,
index
)
{
},
return
child:
Container
(
Obx
(()
=>
GestureDetector
(
margin:
const
EdgeInsets
.
only
(
top:
15
,
left:
5
),
onTap:
()
{
height:
!
Device
.
get
().
isTablet
Get
.
toNamed
(
?
Get
.
width
*
0.45
Routes
.
detailTeams
,
arguments:
teamsScreenController
.
favouriteTeams
[
index
]
:
(
isLandScape
)
?
Get
.
width
/
6
-
49
:
Get
.
width
/
4
-
20
,
);
width:
!
Device
.
get
().
isTablet
},
?
Get
.
width
*
0.45
child:
Container
(
:
(
isLandScape
)
?
Get
.
width
/
6
-
49
:
Get
.
width
/
4
-
20
,
height:
!
Device
.
get
().
isTablet
decoration:
BoxDecoration
(
?
Get
.
width
*
0.45
gradient:
LinearGradient
(
:
(
isLandScape
)
?
Get
.
width
/
6
-
49
:
Get
.
width
/
4
-
20
,
colors:
[
width:
!
Device
.
get
().
isTablet
Colors
.
blue
.
shade900
,
?
Get
.
width
*
0.45
Colors
.
blue
.
shade300
:
(
isLandScape
)
?
Get
.
width
/
6
-
49
:
Get
.
width
/
4
-
20
,
],
decoration:
BoxDecoration
(
begin:
Alignment
.
bottomLeft
,
gradient:
LinearGradient
(
end:
Alignment
.
topRight
,
colors:
[
tileMode:
TileMode
.
repeated
,
Colors
.
blue
.
shade900
,
),
Colors
.
blue
.
shade300
borderRadius:
const
BorderRadius
.
all
(
Radius
.
circular
(
8
),),
],
),
begin:
Alignment
.
bottomLeft
,
child:
Row
(
end:
Alignment
.
topRight
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
tileMode:
TileMode
.
repeated
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
),
children:
[
borderRadius:
const
BorderRadius
.
all
(
Radius
.
circular
(
8
),),
Column
(
),
mainAxisAlignment:
child:
Row
(
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
Container
(
Column
(
padding:
const
EdgeInsets
.
only
(
mainAxisAlignment:
left:
20
,
top:
10
),
MainAxisAlignment
.
spaceBetween
,
child:
Image
.
network
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
teamsScreenController
.
favouriteTeams
[
entry
.
key
]!.
logo
??
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
children:
[
height:
45
,
Container
(
width:
45
,
padding:
const
EdgeInsets
.
only
(
),
left:
20
,
top:
10
),
),
child:
Image
.
network
(
Container
(
teamsScreenController
.
favouriteTeams
[
index
]!.
logo
??
'https://upload.wikimedia.org/wikipedia/vi/thumb/5/5c/Chelsea_crest.svg/1200px-Chelsea_crest.svg.png'
,
width:
!
Device
.
get
().
isTablet
?
Get
.
width
*
0.45
-
45
:
(
isLandScape
)
?
(
Get
.
width
/
6
-
50
)
-
45
:
(
Get
.
width
/
4
-
20
)
-
45
,
height:
45
,
padding:
const
EdgeInsets
.
only
(
left:
10
,
bottom:
10
),
width:
45
,
child:
Column
(
),
crossAxisAlignment:
CrossAxisAlignment
.
start
,
),
children:
[
Container
(
Text
(
'
${teamsScreenController.favouriteTeams[entry.key]!.name}
'
,
width:
!
Device
.
get
().
isTablet
?
Get
.
width
*
0.45
-
45
:
(
isLandScape
)
?
(
Get
.
width
/
6
-
50
)
-
45
:
(
Get
.
width
/
4
-
20
)
-
45
,
softWrap:
true
,
padding:
const
EdgeInsets
.
only
(
left:
10
,
bottom:
10
),
maxLines:
3
,
child:
Column
(
style:
TextStyleUtils
.
sizeText12Weight600
()!.
copyWith
(
color:
Colors
.
white
),
crossAxisAlignment:
CrossAxisAlignment
.
start
,
),
children:
[
Text
(
Text
(
'
${teamsScreenController.favouriteTeams[index]!.name}
'
,
teamsScreenController
.
favouriteTeams
[
entry
.
key
]!.
country
.
name
,
softWrap:
true
,
style:
TextStyleUtils
.
sizeText10Weight400
()!.
copyWith
(
color:
Colors
.
white
),
maxLines:
3
,
),
style:
TextStyleUtils
.
sizeText12Weight600
()!.
copyWith
(
color:
Colors
.
white
),
],
),
),
Text
(
)
teamsScreenController
.
favouriteTeams
[
index
]!.
country
.
name
,
],
style:
TextStyleUtils
.
sizeText10Weight400
()!.
copyWith
(
color:
Colors
.
white
),
),
),
GestureDetector
(
],
onTap:
()
{
),
teamsScreenController
.
deleteFavouriteTeam
(
teamsScreenController
.
favouriteTeams
[
entry
.
key
].
id
);
)
teamsScreenController
.
teams
.
firstWhere
((
element
)
=>
element
.
id
==
teamsScreenController
.
favouriteTeams
[
entry
.
key
].
id
).
favourite
=
false
;
],
teamsScreenController
.
favouriteTeams
.
refresh
();
),
teamsScreenController
.
teams
.
refresh
();
GestureDetector
(
teamsScreenController
.
update
();
onTap:
()
{
},
teamsScreenController
.
deleteFavouriteTeam
(
teamsScreenController
.
favouriteTeams
[
index
].
id
);
child:
Container
(
teamsScreenController
.
teams
.
firstWhere
((
element
)
=>
element
.
id
==
teamsScreenController
.
favouriteTeams
[
index
].
id
).
favourite
=
false
;
margin:
const
EdgeInsets
.
only
(
right:
20
,
top:
20
),
teamsScreenController
.
favouriteTeams
.
refresh
();
width:
25
,
teamsScreenController
.
teams
.
refresh
();
height:
25
,
teamsScreenController
.
update
();
decoration:
const
BoxDecoration
(
},
color:
Colors
.
grey
,
child:
Container
(
borderRadius:
BorderRadius
.
all
(
margin:
const
EdgeInsets
.
only
(
right:
20
,
top:
20
),
Radius
.
circular
(
20
),
width:
25
,
),
height:
25
,
),
decoration:
const
BoxDecoration
(
child:
const
Icon
(
color:
Colors
.
grey
,
Icons
.
star_rounded
,
borderRadius:
BorderRadius
.
all
(
color:
ColorUtils
.
PRIMARY_COLOR
,
Radius
.
circular
(
20
),
size:
19
,
),
)),
),
),
child:
const
Icon
(
],
Icons
.
star_rounded
,
),
color:
ColorUtils
.
PRIMARY_COLOR
,
),
size:
19
,
);
)),
}).
toList
(),
),
),
],
),
),
),
));
},)),
const
SizedBox
(
const
SizedBox
(
height:
10
,
height:
10
,
),
),
...
...
lib/view/mobile/favourites_view/teams/teams_screen_controller.dart
View file @
90592f3e
...
@@ -35,7 +35,7 @@ class TeamsScreenController extends GetxController {
...
@@ -35,7 +35,7 @@ class TeamsScreenController extends GetxController {
@override
@override
void
onInit
()
{
void
onInit
()
{
// TODO: implement onInit
super
.
onInit
();
super
.
onInit
();
getListTeam
(
''
);
getListTeam
(
''
);
getFavouriteTeams
();
getFavouriteTeams
();
...
@@ -43,7 +43,7 @@ class TeamsScreenController extends GetxController {
...
@@ -43,7 +43,7 @@ class TeamsScreenController extends GetxController {
controllerSearchScroll
=
ScrollController
()..
addListener
(
_loadMoreSearch
);
controllerSearchScroll
=
ScrollController
()..
addListener
(
_loadMoreSearch
);
}
}
/// todo: Method refresh
void
onRefresh
()
async
{
void
onRefresh
()
async
{
getListTeam
(
''
);
getListTeam
(
''
);
getFavouriteTeams
();
getFavouriteTeams
();
...
@@ -51,7 +51,7 @@ class TeamsScreenController extends GetxController {
...
@@ -51,7 +51,7 @@ class TeamsScreenController extends GetxController {
}
}
/// todo: Method get teams
void
getListTeam
(
String
?
name
)
async
{
void
getListTeam
(
String
?
name
)
async
{
await
_teamRepo
.
getListTeam
(
0
,
20
,
name
).
then
((
value
)
async
{
await
_teamRepo
.
getListTeam
(
0
,
20
,
name
).
then
((
value
)
async
{
if
(
value
.
state
==
Status
.
SUCCESS
)
{
if
(
value
.
state
==
Status
.
SUCCESS
)
{
...
@@ -60,7 +60,7 @@ class TeamsScreenController extends GetxController {
...
@@ -60,7 +60,7 @@ class TeamsScreenController extends GetxController {
});
});
}
}
/// todo: Method add team to list favourite
void
addFavourite
(
List
<
ItemTeams
>
favourites
,
List
listNotifyMatch
,
List
listNotifyNews
,
ItemTeams
item
)
async
{
void
addFavourite
(
List
<
ItemTeams
>
favourites
,
List
listNotifyMatch
,
List
listNotifyNews
,
ItemTeams
item
)
async
{
await
_teamRepo
.
addTeamFollow
(
favourites
,
listNotifyMatch
,
listNotifyNews
).
then
((
value
)
{
await
_teamRepo
.
addTeamFollow
(
favourites
,
listNotifyMatch
,
listNotifyNews
).
then
((
value
)
{
if
(
value
.
state
==
Status
.
SUCCESS
)
{
if
(
value
.
state
==
Status
.
SUCCESS
)
{
...
@@ -72,7 +72,6 @@ class TeamsScreenController extends GetxController {
...
@@ -72,7 +72,6 @@ class TeamsScreenController extends GetxController {
});
});
}
}
/// todo: Method get list favourite team
void
getFavouriteTeams
()
async
{
void
getFavouriteTeams
()
async
{
await
_teamRepo
.
getFavouriteTeams
().
then
((
value
)
{
await
_teamRepo
.
getFavouriteTeams
().
then
((
value
)
{
if
(
value
.
state
==
Status
.
SUCCESS
)
{
if
(
value
.
state
==
Status
.
SUCCESS
)
{
...
@@ -81,7 +80,6 @@ class TeamsScreenController extends GetxController {
...
@@ -81,7 +80,6 @@ class TeamsScreenController extends GetxController {
});
});
}
}
/// todo: delete favourite team
void
deleteFavouriteTeam
(
String
id
)
async
{
void
deleteFavouriteTeam
(
String
id
)
async
{
await
_teamRepo
.
delFavouriteTeam
(
id
).
then
((
value
)
{
await
_teamRepo
.
delFavouriteTeam
(
id
).
then
((
value
)
{
if
(
value
.
state
==
Status
.
SUCCESS
)
{
if
(
value
.
state
==
Status
.
SUCCESS
)
{
...
@@ -93,7 +91,6 @@ class TeamsScreenController extends GetxController {
...
@@ -93,7 +91,6 @@ class TeamsScreenController extends GetxController {
});
});
}
}
/// todo: add team to favourite list
void
addFavouriteTeam
(
BuildContext
context
,
int
index
,
SwitchController
switchController
)
{
void
addFavouriteTeam
(
BuildContext
context
,
int
index
,
SwitchController
switchController
)
{
teams
[
index
].
favourite
=
!
teams
[
index
].
favourite
;
teams
[
index
].
favourite
=
!
teams
[
index
].
favourite
;
isFavourite
.
value
=
teams
[
index
].
favourite
;
isFavourite
.
value
=
teams
[
index
].
favourite
;
...
@@ -125,7 +122,6 @@ class TeamsScreenController extends GetxController {
...
@@ -125,7 +122,6 @@ class TeamsScreenController extends GetxController {
update
();
update
();
}
}
/// todo: load more
void
_scrollTeams
(){
void
_scrollTeams
(){
if
(
controllerEx
.
position
.
pixels
==
controllerEx
.
position
.
maxScrollExtent
){
if
(
controllerEx
.
position
.
pixels
==
controllerEx
.
position
.
maxScrollExtent
){
if
(
itemLoadMoreEx
.
isNotEmpty
){
if
(
itemLoadMoreEx
.
isNotEmpty
){
...
@@ -146,7 +142,6 @@ class TeamsScreenController extends GetxController {
...
@@ -146,7 +142,6 @@ class TeamsScreenController extends GetxController {
}
}
}
}
/// todo: load more search
void
_loadMoreSearch
(){
void
_loadMoreSearch
(){
if
(
controllerSearchScroll
.
position
.
pixels
==
controllerSearchScroll
.
position
.
maxScrollExtent
){
if
(
controllerSearchScroll
.
position
.
pixels
==
controllerSearchScroll
.
position
.
maxScrollExtent
){
if
(
itemLoadMoreSearch
.
isNotEmpty
){
if
(
itemLoadMoreSearch
.
isNotEmpty
){
...
...
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