美文网首页
flutter Clip剪裁处理圆形

flutter Clip剪裁处理圆形

作者: 喜剧收尾_XWX | 来源:发表于2020-08-15 22:20 被阅读0次
    import 'package:flutter/material.dart';
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        // TODO: implement build
        return MaterialApp(
          title: "Clip剪裁处理",
          theme: ThemeData(
            primaryColor: Colors.lightGreen,
          ),
          home: Scaffold(
              appBar: AppBar(
                title: Text('Clip剪裁处理圆形'),
              ),
              body: Center(
                //圆形剪裁
                child: ClipOval(
                  child: SizedBox(
                    width: 300,
                    height: 300,
                    child: Image.asset(
                      "images/8.jpeg",
                      fit: BoxFit.fill,
                    ),
                  ),
                ),
              )),
        );
      }
    }
    

    相关文章

      网友评论

          本文标题:flutter Clip剪裁处理圆形

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