Reputation: 163
Having this problem, mainly due to the image of the url, have tried expanded or flexible still cannot solve this issue.
child: AppBar(
centerTitle: true,
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
children: <Widget>[
Image.asset("assets/images/ic_title_menu.png",height: 16.0,width: 16.0,),
SizedBox(width: 10,),
Image.asset("assets/images/ic_title_search.png",height: 16.0,width: 16.0,)
],
),
Row(
children: <Widget>[
Image.network("http://rcwebsitecss.gbfine.com/Mobile_SportsII/images/logo/display_logo_007.png",),
],
),
Row(
children: <Widget>[
Column(
children: <Widget>[
Text(
'cgb_test_08',
style: TextStyle(color: Colors.white, fontSize: 12),
),
Text(
'1000',
style: TextStyle(color: Colors.white, fontSize: 12),
)
],
),
SizedBox(width: 10,),
Image.asset("assets/images/ic_user_center.png",height: 16.0,width: 16.0,)
],
),
],
),
),
),
body: Center(
Upvotes: 2
Views: 769
Reputation: 27137
You can use Flexible Widget.
Flexible(
child: Image.network(
"http://rcwebsitecss.gbfine.com/Mobile_SportsII/images/logo/display_logo_007.png",
fit: BoxFit.fitWidth,
),
),
Upvotes: 2
Reputation: 658
Try wrapping your Image.network into Container with specific height & width or set constraints as UTKARSH Sharma proposed
Upvotes: 0
Reputation: 836
Try this.
import 'package:flutter/material.dart';
class Amd extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage("Image Address"),
),
),
constraints: BoxConstraints(
maxWidth: 100,
maxHeight: 200,
),
);
}
}
Upvotes: 0