import 'package:flutter/material.dart';
class PersonalData extends StatelessWidget {
final String Name;
final String Alter;
final String urlImage;
PersonalData(this.Name, this.Alter, this.urlImage);
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text(Name),),
body: new Container(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
new Text("Name: " + Name, textAlign: TextAlign.left),
new Text("Alter: " + Alter),
new Image.network(urlImage, height: 200.0, width: 200.0, alignment: Alignment.topRight,),
],
),
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能在文本附近获得图像。目前文本保持左侧,图像位于右侧文本下方
我认为你应该搜索更多的文档和库,这是一个基本要求,他们很好地提供了它:
Widget _getUserDetailsWidget() {
var assetImage = AssetImage("assets/png/cat.jpg");
var image = new Image(image: assetImage, height: 96.0, width: 96.0, fit: BoxFit.fitWidth,);
final ListTile listTile = new ListTile(title: new Text("Silent Sudo"),
leading: image, subtitle: new Text("Location: India"));
return listTile;
}
Run Code Online (Sandbox Code Playgroud)
代替 new Container() => _getUserDetailsWidget()
| 归档时间: |
|
| 查看次数: |
3578 次 |
| 最近记录: |