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
79dae000
Unverified
Commit
79dae000
authored
Sep 27, 2018
by
xster
Committed by
GitHub
Sep 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support activeIcon in CupertinoTabBar (#22323)
parent
d5b21997
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
bottom_tab_bar.dart
packages/flutter/lib/src/cupertino/bottom_tab_bar.dart
+6
-1
bottom_tab_bar_test.dart
packages/flutter/test/cupertino/bottom_tab_bar_test.dart
+33
-0
No files found.
packages/flutter/lib/src/cupertino/bottom_tab_bar.dart
View file @
79dae000
...
...
@@ -172,7 +172,12 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget {
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
<
Widget
>
[
Expanded
(
child:
Center
(
child:
items
[
index
].
icon
)),
Expanded
(
child:
Center
(
child:
active
?
items
[
index
].
activeIcon
:
items
[
index
].
icon
),
),
items
[
index
].
title
,
],
),
...
...
packages/flutter/test/cupertino/bottom_tab_bar_test.dart
View file @
79dae000
...
...
@@ -68,6 +68,39 @@ void main() {
expect
(
actualActive
.
text
.
style
.
color
,
const
Color
(
0xFF123456
));
});
testWidgets
(
'Use active icon'
,
(
WidgetTester
tester
)
async
{
const
TestImageProvider
activeIcon
=
TestImageProvider
(
16
,
16
);
const
TestImageProvider
inactiveIcon
=
TestImageProvider
(
24
,
24
);
await
pumpWidgetWithBoilerplate
(
tester
,
MediaQuery
(
data:
const
MediaQueryData
(),
child:
CupertinoTabBar
(
items:
const
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
icon:
ImageIcon
(
TestImageProvider
(
24
,
24
)),
title:
Text
(
'Tab 1'
),
),
BottomNavigationBarItem
(
icon:
ImageIcon
(
inactiveIcon
),
activeIcon:
ImageIcon
(
activeIcon
),
title:
Text
(
'Tab 2'
),
),
],
currentIndex:
1
,
activeColor:
const
Color
(
0xFF123456
),
inactiveColor:
const
Color
(
0xFF654321
),
),
));
final
Image
image
=
tester
.
widget
(
find
.
descendant
(
of:
find
.
widgetWithText
(
GestureDetector
,
'Tab 2'
),
matching:
find
.
byType
(
Image
)
));
expect
(
image
.
color
,
const
Color
(
0xFF123456
));
expect
(
image
.
image
,
activeIcon
);
});
testWidgets
(
'Adjusts height to account for bottom padding'
,
(
WidgetTester
tester
)
async
{
final
CupertinoTabBar
tabBar
=
CupertinoTabBar
(
items:
const
<
BottomNavigationBarItem
>[
...
...
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