Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
font_awesome_flutter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Kulya
font_awesome_flutter
Commits
c3a17517
Commit
c3a17517
authored
Sep 08, 2017
by
Brian Egan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update GridView to use a builder
parent
9cea0574
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
39 deletions
+45
-39
main.dart
example/lib/main.dart
+45
-39
No files found.
example/lib/main.dart
View file @
c3a17517
...
@@ -33,50 +33,56 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
...
@@ -33,50 +33,56 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
filteredIcons
=
icons
.
where
((
icon
)
=>
_searchTerm
.
isEmpty
||
icon
.
title
.
toLowerCase
().
startsWith
(
_searchTerm
.
toLowerCase
()))
.
toList
();
final
orientation
=
MediaQuery
.
of
(
context
).
orientation
;
return
new
Scaffold
(
return
new
Scaffold
(
appBar:
_isSearching
?
_searchBar
(
context
)
:
_titleBar
(),
appBar:
_isSearching
?
_searchBar
(
context
)
:
_titleBar
(),
body:
new
GridView
.
count
(
body:
new
GridView
.
builder
(
crossAxisCount:
itemCount:
filteredIcons
.
length
,
MediaQuery
.
of
(
context
).
orientation
==
Orientation
.
portrait
gridDelegate:
new
SliverGridDelegateWithFixedCrossAxisCount
(
?
2
crossAxisCount:
orientation
==
Orientation
.
portrait
?
2
:
3
,
:
3
,
),
children:
icons
itemBuilder:
(
context
,
index
)
{
.
where
((
icon
)
=>
final
icon
=
filteredIcons
[
index
];
_searchTerm
.
isEmpty
||
icon
.
title
.
toLowerCase
().
startsWith
(
_searchTerm
.
toLowerCase
()))
return
new
InkWell
(
.
map
((
icon
)
=>
new
InkWell
(
onTap:
()
{
onTap:
()
{
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
new
MaterialPageRoute
<
Null
>(
new
MaterialPageRoute
<
Null
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
new
Container
(
return
new
Container
(
color:
Colors
.
white
,
color:
Colors
.
white
,
child:
new
SizedBox
.
expand
(
child:
new
SizedBox
.
expand
(
child:
new
Hero
(
child:
new
Hero
(
tag:
icon
,
tag:
icon
,
child:
new
Icon
(
child:
new
Icon
(
icon
.
iconData
,
icon
.
iconData
,
size:
100.0
,
size:
100.0
,
),
),
),
),
),
);
},
),
),
);
);
},
},
child:
new
Column
(
),
mainAxisAlignment:
MainAxisAlignment
.
center
,
);
children:
<
Widget
>[
},
new
Hero
(
tag:
icon
,
child:
new
Icon
(
icon
.
iconData
)),
child:
new
Column
(
new
Container
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
padding:
new
EdgeInsets
.
only
(
top:
16.0
),
children:
<
Widget
>[
child:
new
Text
(
icon
.
title
))
new
Hero
(
tag:
icon
,
child:
new
Icon
(
icon
.
iconData
)),
],
new
Container
(
),
padding:
new
EdgeInsets
.
only
(
top:
16.0
),
))
child:
new
Text
(
icon
.
title
))
.
toList
()),
],
),
);
}),
);
);
}
}
...
...
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