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
c1778256
Commit
c1778256
authored
Oct 14, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a ListItem widget
parent
2032d3e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
0 deletions
+69
-0
material.dart
packages/flutter/lib/material.dart
+1
-0
constants.dart
packages/flutter/lib/src/material/constants.dart
+5
-0
list_item.dart
packages/flutter/lib/src/material/list_item.dart
+63
-0
No files found.
packages/flutter/lib/material.dart
View file @
c1778256
...
...
@@ -24,6 +24,7 @@ export 'src/material/icon_button.dart';
export
'src/material/icon.dart'
;
export
'src/material/ink_well.dart'
;
export
'src/material/input.dart'
;
export
'src/material/list_item.dart'
;
export
'src/material/material.dart'
;
export
'src/material/material_app.dart'
;
export
'src/material/material_button.dart'
;
...
...
packages/flutter/lib/src/material/constants.dart
View file @
c1778256
...
...
@@ -16,6 +16,11 @@ const double kStatusBarHeight = 50.0;
const
double
kToolBarHeight
=
56.0
;
const
double
kSnackBarHeight
=
52.0
;
// https://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-keylines-spacing
const
double
kListTitleHeight
=
72.0
;
const
double
kListSubtitleHeight
=
48.0
;
const
double
kListItemHeight
=
72.0
;
const
double
kMaterialDrawerHeight
=
140.0
;
const
double
kScrollbarSize
=
10.0
;
const
Duration
kScrollbarFadeDuration
=
const
Duration
(
milliseconds:
250
);
...
...
packages/flutter/lib/src/material/list_item.dart
0 → 100644
View file @
c1778256
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/gestures.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/widgets.dart'
;
import
'ink_well.dart'
;
import
'constants.dart'
;
class
ListItem
extends
StatelessComponent
{
ListItem
({
Key
key
,
this
.
left
,
this
.
center
,
this
.
right
,
this
.
onTap
,
this
.
onLongPress
})
:
super
(
key:
key
)
{
assert
(
center
!=
null
);
}
final
Widget
left
;
final
Widget
center
;
final
Widget
right
;
final
GestureTapCallback
onTap
;
final
GestureLongPressCallback
onLongPress
;
Widget
build
(
BuildContext
context
)
{
List
<
Widget
>
children
=
new
List
<
Widget
>();
if
(
left
!=
null
)
{
children
.
add
(
new
Container
(
margin:
new
EdgeDims
.
only
(
right:
16.0
),
width:
40.0
,
child:
left
));
}
children
.
add
(
new
Flexible
(
child:
center
));
if
(
right
!=
null
)
{
children
.
add
(
new
Container
(
margin:
new
EdgeDims
.
only
(
left:
8.0
),
width:
40.0
,
child:
right
));
}
return
new
Container
(
height:
kListItemHeight
,
padding:
const
EdgeDims
.
symmetric
(
horizontal:
16.0
),
child:
new
InkWell
(
onTap:
onTap
,
onLongPress:
onLongPress
,
child:
new
Row
(
children
)
)
);
}
}
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