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
9558ac7d
Commit
9558ac7d
authored
Apr 27, 2017
by
Todd Volkert
Committed by
GitHub
Apr 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assert that url is non-null in NetworkImage (#9626)
parent
2e194d5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
image_provider.dart
packages/flutter/lib/src/services/image_provider.dart
+1
-1
image_provider_test.dart
packages/flutter/test/services/image_provider_test.dart
+14
-0
No files found.
packages/flutter/lib/src/services/image_provider.dart
View file @
9558ac7d
...
...
@@ -311,7 +311,7 @@ class NetworkImage extends ImageProvider<NetworkImage> {
/// Creates an object that fetches the image at the given URL.
///
/// The arguments must not be null.
const
NetworkImage
(
this
.
url
,
{
this
.
scale
:
1.0
});
const
NetworkImage
(
this
.
url
,
{
this
.
scale
:
1.0
})
:
assert
(
url
!=
null
)
;
/// The URL from which the image will be fetched.
final
String
url
;
...
...
packages/flutter/test/services/image_provider_test.dart
0 → 100644
View file @
9558ac7d
// Copyright 2017 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/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
test
(
'NetworkImage non-null url test'
,
()
{
expect
(()
{
new
NetworkImage
(
null
);
// ignore: prefer_const_constructors
},
throwsAssertionError
);
});
}
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