Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
CHILD INTELLIGENT ASSESSMENT TOOL
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2020-046
CHILD INTELLIGENT ASSESSMENT TOOL
Commits
87597012
Commit
87597012
authored
Oct 26, 2020
by
Dasun Madushanka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update details category list
parent
34fe4e75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
MainAppDMT/lib/screens/product/components/category_list.dart
MainAppDMT/lib/screens/product/components/category_list.dart
+52
-0
No files found.
MainAppDMT/lib/screens/product/components/category_list.dart
0 → 100644
View file @
87597012
import
'package:flutter/material.dart'
;
import
'../../../constants.dart'
;
// We need statefull widget because we are gonna change some state on our category
class
CategoryList
extends
StatefulWidget
{
@override
_CategoryListState
createState
()
=>
_CategoryListState
();
}
class
_CategoryListState
extends
State
<
CategoryList
>
{
// by default first item will be selected
int
selectedIndex
=
0
;
List
categories
=
[
'All'
,
'Tests'
];
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
kDefaultPadding
/
2
),
height:
30
,
child:
ListView
.
builder
(
scrollDirection:
Axis
.
horizontal
,
itemCount:
categories
.
length
,
itemBuilder:
(
context
,
index
)
=>
GestureDetector
(
onTap:
()
{
setState
(()
{
selectedIndex
=
index
;
});
},
child:
Container
(
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
only
(
left:
kDefaultPadding
,
// At end item it add extra 20 right padding
right:
index
==
categories
.
length
-
1
?
kDefaultPadding
:
0
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
kDefaultPadding
),
decoration:
BoxDecoration
(
color:
index
==
selectedIndex
?
Colors
.
white
.
withOpacity
(
0.4
)
:
Colors
.
transparent
,
borderRadius:
BorderRadius
.
circular
(
6
),
),
child:
Text
(
categories
[
index
],
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
);
}
}
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