{"id":983,"date":"2022-04-24T16:06:00","date_gmt":"2022-04-24T08:06:00","guid":{"rendered":"http:\/\/blog.xrhoujie.com\/?p=983"},"modified":"2022-04-28T16:15:39","modified_gmt":"2022-04-28T08:15:39","slug":"flutter%e5%9f%ba%e7%a1%80%e6%95%99%e7%a8%8bhelloword%ef%bc%8cimage%ef%bc%8cwidget","status":"publish","type":"post","link":"http:\/\/blog.xrhoujie.com\/?p=983","title":{"rendered":"flutter\u57fa\u7840\u6559\u7a0b(helloword\uff0cimage\uff0cwidget)"},"content":{"rendered":"\n<p>\u5206\u4eab\u51e0\u4e2a\u5b66\u4e60flutter\u7684\u5b66\u4e60\u7f51\u7ad9\u4e0e\u8d44\u6e90<\/p>\n\n\n\n<p>flutter\u5b9e\u6218\u7b2c\u4e8c\u7248<a href=\"https:\/\/book.flutterchina.club\/chapter6\/gridview.html#_6-6-1-%E9%BB%98%E8%AE%A4%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0\">https:\/\/book.flutterchina.club\/chapter6\/gridview.html#_6-6-1-%E9%BB%98%E8%AE%A4%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0<\/a><\/p>\n\n\n\n<p>flutter\u4e2d\u6587\u6587\u6863<a href=\"https:\/\/flutter.cn\/docs\/get-started\/flutter-for\/web-devs\">https:\/\/flutter.cn\/docs\/get-started\/flutter-for\/web-devs<\/a><\/p>\n\n\n\n<p>\u7a0b\u5e8f\u5165\u95e8\u5f53\u7136\u662f\u6253\u5370<strong>helloword<\/strong>\u4e86\uff0c\u8fd0\u884c\u5373\u53ef<\/p>\n\n\n\n<p>helloWord.dart<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\n\nvoid main()=&gt; runApp(new MyApp());\n\nclass MyApp extends StatelessWidget{\n  @override\n  Widget build(BuildContext context){\n    return new MaterialApp(\n      title: 'welcome to Flutter',\n      home: new Scaffold(\n        appBar: new AppBar(\n          title: Text('wecome'),\n        )\n        body: Center(\n          child: new Text('hello')\n        )\n      )\n    )\n  }\n}<\/code><\/pre>\n\n\n\n<p><strong>flutter\u4e2d\u4f7f\u7528\u56fe\u7247<\/strong><\/p>\n\n\n\n<p>main_image.dart<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\n\nvoid main()=&gt; runApp(new MyApp());\n\nclass MyApp extends StatelessWidget{\n  @override\n  Widget build(BuildContext context){\n    return new MaterialApp(\n      title: 'welcome to Flutter',\n      home: new Scaffold(\n        appBar: new AppBar(\n          title: Text('wecome'),\n        )\n        body: Center(\n          child: Container(\n            child:new Image.network(\n              'xxxxx',\n              fix:boxFit.container,\n            )\n            width:300.0,\n            height:200.0,\n            color:Colors.lightBlue,\n          )\n        )\n      )\n    )\n  }\n}\n\n<\/code><\/pre>\n\n\n\n<p><strong>flutter\u4f7f\u7528widget\u7ec4\u4ef6<\/strong><\/p>\n\n\n\n<p>main_widget.dart<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\n\nvoid main()=&gt; runApp(new MyApp());\n\nclass MyApp extends StatelessWidget{\n  @override\n  Widget build(BuildContext context){\n    return new MaterialApp(\n      title: 'welcome to Flutter',\n      home: new Scaffold(\n        appBar: new AppBar(\n          title: Text('wecome'),\n        )\n        body: Center(\n          child: Container(\n            child: new Text('hello han',style:TextStyle(fontSize:40.0)),\n            alignment: Alignment.topLeft,\n            width:500.0,\n            height:400.0,\n            padding:const EdgInsets.fromLTRB(10.0,100.0,0.0,0.0),\n            margin: const EgdInsets.all(10.0),\n            decoration: new BoxDecoration(\n              border:Border.all(width:2.0,color:Colors.red)\n            )\n          )\n        )\n      )\n    )\n  }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5206\u4eab\u51e0\u4e2a\u5b66\u4e60flutter\u7684\u5b66\u4e60\u7f51\u7ad9\u4e0e\u8d44\u6e90 flutter\u5b9e\u6218\u7b2c\u4e8c\u7248https:\/\/book.flutterc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[43,1],"tags":[42],"_links":{"self":[{"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=\/wp\/v2\/posts\/983"}],"collection":[{"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=983"}],"version-history":[{"count":2,"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=\/wp\/v2\/posts\/983\/revisions"}],"predecessor-version":[{"id":985,"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=\/wp\/v2\/posts\/983\/revisions\/985"}],"wp:attachment":[{"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=983"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.xrhoujie.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}