Flutter:: Invalid argument(s): No host specified in URI file://image name
When trying to add images inside gridview.count Widget. Images are not getting loaded and getting flowing error in console.
Images are placed in local - asset Folder
body: center(
child:gridview.count(
crossaxiscount: 3,
childaspectratio: 1.0,
padding: const edgeinsets.all(4.0),
mainaxisspacing: 4.0,
crossaxisspacing: 4.0,
children: <string>[
'spinach_onion_salad.png',
'veggie.png',
].map<widget>((string url) {
return gridtile(
footer: gridtilebar(
title: text(url)
),
child: image.network(url, fit: boxfit.cover)
);
}).tolist(),
),
),
Error:
Error::
Reloaded 0 of 426 libraries in 937ms.
Reloaded 6 of 426 libraries in 1,338ms.
I/flutter (32327): ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
I/flutter (32327): The following ArgumentError was thrown resolving an image codec:
I/flutter (32327): Invalid argument(s): No host specified in URI file:///%20eggie.png
I/flutter (32327):
I/flutter (32327): When the exception was thrown, this was the stack:
I/flutter (32327): #0 _HttpClient._openUrl (dart:_http/http_impl.dart:2121:9)
I/flutter (32327): #1 _HttpClient.getUrl (dart:_http/http_impl.dart:2056:48)
image dart flutter
add a comment |
When trying to add images inside gridview.count Widget. Images are not getting loaded and getting flowing error in console.
Images are placed in local - asset Folder
body: center(
child:gridview.count(
crossaxiscount: 3,
childaspectratio: 1.0,
padding: const edgeinsets.all(4.0),
mainaxisspacing: 4.0,
crossaxisspacing: 4.0,
children: <string>[
'spinach_onion_salad.png',
'veggie.png',
].map<widget>((string url) {
return gridtile(
footer: gridtilebar(
title: text(url)
),
child: image.network(url, fit: boxfit.cover)
);
}).tolist(),
),
),
Error:
Error::
Reloaded 0 of 426 libraries in 937ms.
Reloaded 6 of 426 libraries in 1,338ms.
I/flutter (32327): ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
I/flutter (32327): The following ArgumentError was thrown resolving an image codec:
I/flutter (32327): Invalid argument(s): No host specified in URI file:///%20eggie.png
I/flutter (32327):
I/flutter (32327): When the exception was thrown, this was the stack:
I/flutter (32327): #0 _HttpClient._openUrl (dart:_http/http_impl.dart:2121:9)
I/flutter (32327): #1 _HttpClient.getUrl (dart:_http/http_impl.dart:2056:48)
image dart flutter
1
Are the images local or via network? if they local use Image.assets("")
– Ahmed
Jan 2 at 3:08
Images in local. but not able to add The class 'Image' doesn't have a constructor named 'assets'.
– Nithyanandan Sathiyanathan
Jan 2 at 3:13
ok it is Image.asset("") let me check
– Nithyanandan Sathiyanathan
Jan 2 at 3:15
yes Image.asset("")
– Ahmed
Jan 2 at 3:21
If they are local images do not forget to add them to pubspec.yaml and use Image.asset method
– Ajay Beniwal
Jan 2 at 6:08
add a comment |
When trying to add images inside gridview.count Widget. Images are not getting loaded and getting flowing error in console.
Images are placed in local - asset Folder
body: center(
child:gridview.count(
crossaxiscount: 3,
childaspectratio: 1.0,
padding: const edgeinsets.all(4.0),
mainaxisspacing: 4.0,
crossaxisspacing: 4.0,
children: <string>[
'spinach_onion_salad.png',
'veggie.png',
].map<widget>((string url) {
return gridtile(
footer: gridtilebar(
title: text(url)
),
child: image.network(url, fit: boxfit.cover)
);
}).tolist(),
),
),
Error:
Error::
Reloaded 0 of 426 libraries in 937ms.
Reloaded 6 of 426 libraries in 1,338ms.
I/flutter (32327): ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
I/flutter (32327): The following ArgumentError was thrown resolving an image codec:
I/flutter (32327): Invalid argument(s): No host specified in URI file:///%20eggie.png
I/flutter (32327):
I/flutter (32327): When the exception was thrown, this was the stack:
I/flutter (32327): #0 _HttpClient._openUrl (dart:_http/http_impl.dart:2121:9)
I/flutter (32327): #1 _HttpClient.getUrl (dart:_http/http_impl.dart:2056:48)
image dart flutter
When trying to add images inside gridview.count Widget. Images are not getting loaded and getting flowing error in console.
Images are placed in local - asset Folder
body: center(
child:gridview.count(
crossaxiscount: 3,
childaspectratio: 1.0,
padding: const edgeinsets.all(4.0),
mainaxisspacing: 4.0,
crossaxisspacing: 4.0,
children: <string>[
'spinach_onion_salad.png',
'veggie.png',
].map<widget>((string url) {
return gridtile(
footer: gridtilebar(
title: text(url)
),
child: image.network(url, fit: boxfit.cover)
);
}).tolist(),
),
),
Error:
Error::
Reloaded 0 of 426 libraries in 937ms.
Reloaded 6 of 426 libraries in 1,338ms.
I/flutter (32327): ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
I/flutter (32327): The following ArgumentError was thrown resolving an image codec:
I/flutter (32327): Invalid argument(s): No host specified in URI file:///%20eggie.png
I/flutter (32327):
I/flutter (32327): When the exception was thrown, this was the stack:
I/flutter (32327): #0 _HttpClient._openUrl (dart:_http/http_impl.dart:2121:9)
I/flutter (32327): #1 _HttpClient.getUrl (dart:_http/http_impl.dart:2056:48)
image dart flutter
image dart flutter
edited Jan 2 at 3:13
Nithyanandan Sathiyanathan
asked Jan 2 at 3:04
Nithyanandan SathiyanathanNithyanandan Sathiyanathan
679622
679622
1
Are the images local or via network? if they local use Image.assets("")
– Ahmed
Jan 2 at 3:08
Images in local. but not able to add The class 'Image' doesn't have a constructor named 'assets'.
– Nithyanandan Sathiyanathan
Jan 2 at 3:13
ok it is Image.asset("") let me check
– Nithyanandan Sathiyanathan
Jan 2 at 3:15
yes Image.asset("")
– Ahmed
Jan 2 at 3:21
If they are local images do not forget to add them to pubspec.yaml and use Image.asset method
– Ajay Beniwal
Jan 2 at 6:08
add a comment |
1
Are the images local or via network? if they local use Image.assets("")
– Ahmed
Jan 2 at 3:08
Images in local. but not able to add The class 'Image' doesn't have a constructor named 'assets'.
– Nithyanandan Sathiyanathan
Jan 2 at 3:13
ok it is Image.asset("") let me check
– Nithyanandan Sathiyanathan
Jan 2 at 3:15
yes Image.asset("")
– Ahmed
Jan 2 at 3:21
If they are local images do not forget to add them to pubspec.yaml and use Image.asset method
– Ajay Beniwal
Jan 2 at 6:08
1
1
Are the images local or via network? if they local use Image.assets("")
– Ahmed
Jan 2 at 3:08
Are the images local or via network? if they local use Image.assets("")
– Ahmed
Jan 2 at 3:08
Images in local. but not able to add The class 'Image' doesn't have a constructor named 'assets'.
– Nithyanandan Sathiyanathan
Jan 2 at 3:13
Images in local. but not able to add The class 'Image' doesn't have a constructor named 'assets'.
– Nithyanandan Sathiyanathan
Jan 2 at 3:13
ok it is Image.asset("") let me check
– Nithyanandan Sathiyanathan
Jan 2 at 3:15
ok it is Image.asset("") let me check
– Nithyanandan Sathiyanathan
Jan 2 at 3:15
yes Image.asset("")
– Ahmed
Jan 2 at 3:21
yes Image.asset("")
– Ahmed
Jan 2 at 3:21
If they are local images do not forget to add them to pubspec.yaml and use Image.asset method
– Ajay Beniwal
Jan 2 at 6:08
If they are local images do not forget to add them to pubspec.yaml and use Image.asset method
– Ajay Beniwal
Jan 2 at 6:08
add a comment |
1 Answer
1
active
oldest
votes
return Container(
child: Center(
child: GridView.count(
crossAxisCount: 3,
childAspectRatio: 1.0,
padding: const EdgeInsets.all(4.0),
mainAxisSpacing: 4.0,
children: <String>[
'spinach_onion_salad.png',
'veggie.png',
]
.map<Widget>((String url) => GridTile(
footer: GridTileBar(title: Text(url)),
child: Image.asset(url)))
.toList(),
),
),
);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54000775%2fflutter-invalid-arguments-no-host-specified-in-uri-file-image-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
return Container(
child: Center(
child: GridView.count(
crossAxisCount: 3,
childAspectRatio: 1.0,
padding: const EdgeInsets.all(4.0),
mainAxisSpacing: 4.0,
children: <String>[
'spinach_onion_salad.png',
'veggie.png',
]
.map<Widget>((String url) => GridTile(
footer: GridTileBar(title: Text(url)),
child: Image.asset(url)))
.toList(),
),
),
);
add a comment |
return Container(
child: Center(
child: GridView.count(
crossAxisCount: 3,
childAspectRatio: 1.0,
padding: const EdgeInsets.all(4.0),
mainAxisSpacing: 4.0,
children: <String>[
'spinach_onion_salad.png',
'veggie.png',
]
.map<Widget>((String url) => GridTile(
footer: GridTileBar(title: Text(url)),
child: Image.asset(url)))
.toList(),
),
),
);
add a comment |
return Container(
child: Center(
child: GridView.count(
crossAxisCount: 3,
childAspectRatio: 1.0,
padding: const EdgeInsets.all(4.0),
mainAxisSpacing: 4.0,
children: <String>[
'spinach_onion_salad.png',
'veggie.png',
]
.map<Widget>((String url) => GridTile(
footer: GridTileBar(title: Text(url)),
child: Image.asset(url)))
.toList(),
),
),
);
return Container(
child: Center(
child: GridView.count(
crossAxisCount: 3,
childAspectRatio: 1.0,
padding: const EdgeInsets.all(4.0),
mainAxisSpacing: 4.0,
children: <String>[
'spinach_onion_salad.png',
'veggie.png',
]
.map<Widget>((String url) => GridTile(
footer: GridTileBar(title: Text(url)),
child: Image.asset(url)))
.toList(),
),
),
);
answered Jan 2 at 3:20
AhmedAhmed
42126
42126
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54000775%2fflutter-invalid-arguments-no-host-specified-in-uri-file-image-name%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Are the images local or via network? if they local use Image.assets("")
– Ahmed
Jan 2 at 3:08
Images in local. but not able to add The class 'Image' doesn't have a constructor named 'assets'.
– Nithyanandan Sathiyanathan
Jan 2 at 3:13
ok it is Image.asset("") let me check
– Nithyanandan Sathiyanathan
Jan 2 at 3:15
yes Image.asset("")
– Ahmed
Jan 2 at 3:21
If they are local images do not forget to add them to pubspec.yaml and use Image.asset method
– Ajay Beniwal
Jan 2 at 6:08