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
6f88931d
Commit
6f88931d
authored
Sep 07, 2023
by
Nguyễn Thành Tâm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev/tam_nguyen' into 'develop'
ntt update See merge request
!1
parents
71954c96
dfe2dc6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
110 deletions
+0
-110
test.dart
lib/view/mobile/test.dart
+0
-83
test_controller.dart
lib/view/mobile/test_controller.dart
+0
-27
No files found.
lib/view/mobile/test.dart
deleted
100644 → 0
View file @
71954c96
import
'package:betting/view/mobile/test_controller.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/src/widgets/framework.dart'
;
import
'package:get/get.dart'
;
class
Test
extends
GetWidget
<
TestControler
>{
final
controller
=
Get
.
put
(
TestControler
());
@override
Widget
build
(
BuildContext
context
)
{
return
Column
(
children:
[
Obx
(()
=>
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
controller
.
ischeckall
.
value
==
true
?
Colors
.
green
:
Colors
.
red
),
onPressed:
(){
controller
.
ischeckall
.
value
=!
controller
.
ischeckall
.
value
;
if
(
controller
.
ischeckall
.
value
==
true
){
for
(
int
i
=
0
;
i
<
controller
.
ischecklist
.
length
;
i
++){
controller
.
ischecklist
[
i
]
=
true
;
controller
.
indexx
.
value
=
controller
.
ischecklist
.
length
;
}
print
(
controller
.
ischecklist
);
}
else
{
for
(
int
i
=
0
;
i
<
controller
.
ischecklist
.
length
;
i
++){
controller
.
ischecklist
[
i
]
=
false
;
controller
.
indexx
.
value
=
0
;
}
}
},
child:
Text
(
'text'
))),
Obx
(()
=>
ListView
.
builder
(
shrinkWrap:
true
,
itemCount:
controller
.
list
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Row
(
children:
[
Obx
(()
=>
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
controller
.
ischecklist
[
index
]
==
false
?
Colors
.
red
:
Colors
.
green
),
onPressed:
(){
controller
.
ischecklist
[
index
]
=!
controller
.
ischecklist
[
index
];
if
(
controller
.
ischecklist
[
index
]
==
true
){
controller
.
indexx
.
value
++;
print
(
controller
.
indexx
.
value
);
}
if
(
controller
.
indexx
.
value
==
controller
.
ischecklist
.
length
){
controller
.
ischeckall
.
value
=
true
;
}
if
(
controller
.
ischeckall
.
value
==
true
){
if
(
controller
.
ischecklist
[
index
]
==
false
){
controller
.
indexx
.
value
--;
print
(
controller
.
indexx
.
value
);
controller
.
ischeckall
.
value
=
false
;
}
}
else
{
if
(
controller
.
ischecklist
[
index
]
==
false
){
controller
.
indexx
.
value
--;
print
(
controller
.
indexx
.
value
);
}
}
},
child:
Text
(
'list
${controller.list[index]}
'
))),
Text
(
'
${controller.list[index]}
'
)
],
);
},))
],
);
}
}
\ No newline at end of file
lib/view/mobile/test_controller.dart
deleted
100644 → 0
View file @
71954c96
import
'package:get/get.dart'
;
class
TestControler
extends
GetxController
{
@override
void
onInit
()
async
{
super
.
onInit
();
check
();
}
RxList
<
String
>
list
=
[
"1"
,
"2"
,
"3"
].
obs
;
var
indexx
=
0
.
obs
;
RxList
ischecklist
=[].
obs
;
var
ischeckall
=
false
.
obs
;
check
(){
for
(
int
i
=
0
;
i
<
list
.
length
;
i
++){
ischecklist
.
add
(
false
);
}
}
}
\ No newline at end of file
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