美文网首页
flutter Image图片组件

flutter Image图片组件

作者: 前端新阳 | 来源:发表于2020-05-15 09:52 被阅读0次
  • main.dart文件:
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Text widget',
        home: Scaffold(
            body: Center(
              child: Container(
                child: new Image.network(
                  'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg',
                  fit: BoxFit.contain,
                  color: Colors.greenAccent,
                  colorBlendMode: BlendMode.darken,
                ),
                width: 500.0,
                height: 200.0,
                color: Color(0x60000000),
              ),
            )
        )
    );
  }
}

效果:


image.png

相关文章

网友评论

      本文标题:flutter Image图片组件

      本文链接:https://www.haomeiwen.com/subject/numqohtx.html