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
bce16609
Commit
bce16609
authored
Aug 04, 2015
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete
parent
78e18a5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
19 deletions
+26
-19
basic.dart
packages/flutter/lib/widgets/basic.dart
+1
-0
tabs.dart
packages/flutter/lib/widgets/tabs.dart
+25
-19
No files found.
packages/flutter/lib/widgets/basic.dart
View file @
bce16609
...
...
@@ -538,6 +538,7 @@ class FutureImage extends StatefulComponent {
image
=
source
.
image
;
width
=
source
.
width
;
height
=
source
.
height
;
colorFilter
=
source
.
colorFilter
;
if
(
needToResolveImage
)
_resolveImage
();
}
...
...
packages/flutter/lib/widgets/tabs.dart
View file @
bce16609
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'dart:sky'
as
sky
;
import
'package:newton/newton.dart'
;
import
'package:sky/animation/animation_performance.dart'
;
...
...
@@ -311,22 +312,29 @@ class Tab extends Component {
Tab
({
Key
key
,
this
.
label
,
this
.
selected
:
false
this
.
color
,
this
.
selected
:
false
,
this
.
selectedColor
})
:
super
(
key:
key
)
{
assert
(
label
.
text
!=
null
||
label
.
icon
!=
null
);
}
final
TabLabel
label
;
final
Color
color
;
final
bool
selected
;
final
Color
selectedColor
;
Widget
_buildLabelText
()
{
assert
(
label
.
text
!=
null
);
return
new
Text
(
label
.
text
);
TextStyle
style
=
new
TextStyle
(
color:
selected
?
selectedColor
:
color
);
return
new
Text
(
label
.
text
,
style:
style
);
}
Widget
_buildLabelIcon
()
{
assert
(
label
.
icon
!=
null
);
return
new
Icon
(
type:
label
.
icon
,
size:
_kTabIconSize
);
Color
iconColor
=
selected
?
selectedColor
:
color
;
sky
.
ColorFilter
filter
=
new
sky
.
ColorFilter
.
mode
(
iconColor
,
sky
.
TransferMode
.
srcATop
);
return
new
Icon
(
type:
label
.
icon
,
size:
_kTabIconSize
,
colorFilter:
filter
);
}
Widget
build
()
{
...
...
@@ -350,13 +358,8 @@ class Tab extends Component {
);
}
Widget
highlightedLabel
=
new
Opacity
(
child:
labelContents
,
opacity:
selected
?
1.0
:
0.7
);
Container
centeredLabel
=
new
Container
(
child:
new
Center
(
child:
highlightedLabel
),
child:
new
Center
(
child:
labelContents
),
constraints:
new
BoxConstraints
(
minWidth:
_kMinTabWidth
),
padding:
_kTabLabelPadding
);
...
...
@@ -489,11 +492,13 @@ class TabBar extends Scrollable {
return
EventDisposition
.
ignored
;
}
Widget
_toTab
(
TabLabel
label
,
int
tabIndex
)
{
Widget
_toTab
(
TabLabel
label
,
int
tabIndex
,
Color
color
,
Color
selectedColor
)
{
return
new
Listener
(
child:
new
Tab
(
label:
label
,
selected:
tabIndex
==
selectedIndex
color:
color
,
selected:
tabIndex
==
selectedIndex
,
selectedColor:
selectedColor
),
onGestureTap:
(
_
)
=>
_handleTap
(
tabIndex
)
);
...
...
@@ -510,14 +515,6 @@ class TabBar extends Scrollable {
Widget
buildContent
()
{
assert
(
labels
!=
null
&&
labels
.
isNotEmpty
);
List
<
Widget
>
tabs
=
<
Widget
>[];
bool
textAndIcons
=
false
;
int
tabIndex
=
0
;
for
(
TabLabel
label
in
labels
)
{
tabs
.
add
(
_toTab
(
label
,
tabIndex
++));
if
(
label
.
text
!=
null
&&
label
.
icon
!=
null
)
textAndIcons
=
true
;
}
ThemeData
themeData
=
Theme
.
of
(
this
);
Color
backgroundColor
=
themeData
.
primaryColor
;
...
...
@@ -539,6 +536,15 @@ class TabBar extends Scrollable {
break
;
}
List
<
Widget
>
tabs
=
<
Widget
>[];
bool
textAndIcons
=
false
;
int
tabIndex
=
0
;
for
(
TabLabel
label
in
labels
)
{
tabs
.
add
(
_toTab
(
label
,
tabIndex
++,
textStyle
.
color
,
indicatorColor
));
if
(
label
.
text
!=
null
&&
label
.
icon
!=
null
)
textAndIcons
=
true
;
}
Matrix4
transform
=
new
Matrix4
.
identity
();
transform
.
translate
(-
scrollOffset
,
0.0
);
...
...
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