zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

Flutter组件学习之ClipOval圆形裁剪——筑梦之路

flutter组件学习 筑梦之路 裁剪 圆形
2023-09-14 09:16:00 时间
import 'package:flutter/material.dart';

/**
 * 装饰效果之裁剪
 * 圆形裁剪
 * p223
 */
void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'ClipOval 圆形裁剪',
      home: Scaffold(
        appBar: AppBar(
          title: Text(
            'ClipOVal 圆形裁剪示例',
            style: TextStyle(color: Colors.white),
          ),
        ),
        body: Center(
          child: new ClipOval(
            child: new SizedBox(
              width: 300.0,
              height: 300.0,
              child: new Image.asset(
                "images/a.jpg",
                fit: BoxFit.fill,
              ),
            ),
          ),
        ),
      ),
    );
  }
}