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
be083da9
Unverified
Commit
be083da9
authored
Mar 01, 2019
by
Dan Field
Committed by
GitHub
Mar 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve error messages on Text constructors (#28709)
parent
a3683d30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
text.dart
packages/flutter/lib/src/widgets/text.dart
+12
-2
No files found.
packages/flutter/lib/src/widgets/text.dart
View file @
be083da9
...
@@ -222,6 +222,8 @@ class Text extends StatelessWidget {
...
@@ -222,6 +222,8 @@ class Text extends StatelessWidget {
///
///
/// If the [style] argument is null, the text will use the style from the
/// If the [style] argument is null, the text will use the style from the
/// closest enclosing [DefaultTextStyle].
/// closest enclosing [DefaultTextStyle].
///
/// The [data] parameter must not be null.
const
Text
(
this
.
data
,
{
const
Text
(
this
.
data
,
{
Key
key
,
Key
key
,
this
.
style
,
this
.
style
,
...
@@ -234,11 +236,16 @@ class Text extends StatelessWidget {
...
@@ -234,11 +236,16 @@ class Text extends StatelessWidget {
this
.
textScaleFactor
,
this
.
textScaleFactor
,
this
.
maxLines
,
this
.
maxLines
,
this
.
semanticsLabel
,
this
.
semanticsLabel
,
})
:
assert
(
data
!=
null
),
})
:
assert
(
data
!=
null
,
'A non-null String must be provided to a Text widget.'
,
),
textSpan
=
null
,
textSpan
=
null
,
super
(
key:
key
);
super
(
key:
key
);
/// Creates a text widget with a [TextSpan].
/// Creates a text widget with a [TextSpan].
///
/// The [textSpan] parameter must not be null.
const
Text
.
rich
(
this
.
textSpan
,
{
const
Text
.
rich
(
this
.
textSpan
,
{
Key
key
,
Key
key
,
this
.
style
,
this
.
style
,
...
@@ -251,7 +258,10 @@ class Text extends StatelessWidget {
...
@@ -251,7 +258,10 @@ class Text extends StatelessWidget {
this
.
textScaleFactor
,
this
.
textScaleFactor
,
this
.
maxLines
,
this
.
maxLines
,
this
.
semanticsLabel
,
this
.
semanticsLabel
,
})
:
assert
(
textSpan
!=
null
),
})
:
assert
(
textSpan
!=
null
,
'A non-null TextSpan must be provided to a Text.rich widget.'
,
),
data
=
null
,
data
=
null
,
super
(
key:
key
);
super
(
key:
key
);
...
...
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