Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
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
abdullh.alsoleman
Front-End
Commits
6c03a3f9
Unverified
Commit
6c03a3f9
authored
May 22, 2018
by
Hans Muller
Committed by
GitHub
May 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapt home screen layout for large screen sizes (#17816)
parent
6dbdccf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
home.dart
examples/flutter_gallery/lib/gallery/home.dart
+16
-1
No files found.
examples/flutter_gallery/lib/gallery/home.dart
View file @
6c03a3f9
...
...
@@ -119,7 +119,7 @@ class _CategoriesPage extends StatelessWidget {
child:
new
LayoutBuilder
(
builder:
(
BuildContext
context
,
BoxConstraints
constraints
)
{
final
double
columnWidth
=
constraints
.
biggest
.
width
/
columnCount
.
toDouble
();
final
double
rowHeight
=
columnWidth
*
aspectRatio
;
final
double
rowHeight
=
math
.
min
(
225.0
,
columnWidth
*
aspectRatio
)
;
final
int
rowCount
=
(
categories
.
length
+
columnCount
-
1
)
~/
columnCount
;
// This repaint boundary prevents the inner contents of the front layer
...
...
@@ -286,6 +286,18 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
AnimationController
_controller
;
GalleryDemoCategory
_category
;
static
Widget
_topHomeLayout
(
Widget
currentChild
,
List
<
Widget
>
previousChildren
)
{
List
<
Widget
>
children
=
previousChildren
;
if
(
currentChild
!=
null
)
children
=
children
.
toList
()..
add
(
currentChild
);
return
new
Stack
(
children:
children
,
alignment:
Alignment
.
topCenter
,
);
}
static
const
AnimatedSwitcherLayoutBuilder
_centerHomeLayout
=
AnimatedSwitcher
.
defaultLayoutBuilder
;
@override
void
initState
()
{
super
.
initState
();
...
...
@@ -306,6 +318,8 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
Widget
build
(
BuildContext
context
)
{
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
bool
isDark
=
theme
.
brightness
==
Brightness
.
dark
;
final
MediaQueryData
media
=
MediaQuery
.
of
(
context
);
final
bool
centerHome
=
media
.
orientation
==
Orientation
.
portrait
&&
media
.
size
.
height
<
800.0
;
const
Curve
switchOutCurve
=
const
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
);
const
Curve
switchInCurve
=
const
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
);
...
...
@@ -350,6 +364,7 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
duration:
_kFrontLayerSwitchDuration
,
switchOutCurve:
switchOutCurve
,
switchInCurve:
switchInCurve
,
layoutBuilder:
centerHome
?
_centerHomeLayout
:
_topHomeLayout
,
child:
_category
!=
null
?
new
_DemosPage
(
_category
)
:
new
_CategoriesPage
(
...
...
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