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
2a21c1a1
Unverified
Commit
2a21c1a1
authored
Mar 15, 2019
by
Shi-Hao Hong
Committed by
GitHub
Mar 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add assert if length of TabController and number of tabs do not match (#29332)
parent
87e6beec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+22
-0
No files found.
packages/flutter/lib/src/material/tabs.dart
View file @
2a21c1a1
...
...
@@ -778,6 +778,17 @@ class _TabBarState extends State<TabBar> {
}
return
true
;
}());
assert
(()
{
if
(
newController
.
length
!=
widget
.
tabs
.
length
)
{
throw
FlutterError
(
'Controller
\'
s length property (
${newController.length}
) does not match the
\n
'
'number of tab elements (
${widget.tabs.length}
) present in TabBar
\'
s tabs property.'
);
}
return
true
;
}());
if
(
newController
==
_controller
)
return
;
...
...
@@ -1122,6 +1133,17 @@ class _TabBarViewState extends State<TabBarView> {
}
return
true
;
}());
assert
(()
{
if
(
newController
.
length
!=
widget
.
children
.
length
)
{
throw
FlutterError
(
'Controller
\'
s length property (
${newController.length}
) does not match the
\n
'
'number of elements (
${widget.children.length}
) present in TabBarView
\'
s children property.'
);
}
return
true
;
}());
if
(
newController
==
_controller
)
return
;
...
...
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